<div dir="ltr">Great idea! And I like the idea of having the tool being a Swiss army knife like git.<div><br></div><div>I am currently working on a refactoring tool that move class/function definitions across namespaces, and I think the tool can also live under the "clang-refactor" umbrella! </div><div><br></div><div>Besides designing the easily extensible interfaces, another interesting problem would be designing infrastructure for multi-TU changes IMO. </div><div><span style="line-height:1.5"><br></span></div><div><span style="line-height:1.5">Cheers,</span><br></div><div>Eric</div><div dir="ltr"><div><div><div class="gmail_quote"><div dir="ltr">On Tue, Aug 9, 2016 at 7:32 PM Kirill Bobyrev via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Oops, didn’t actually CC people.<div><br><div>+CC: Saleem Abdulrasool, Manuel Klimek, Alexander Kornienko</div></div></div><div style="word-wrap:break-word"><div><div><br></div><div><div><div><blockquote type="cite"><div>On 09 Aug 2016, at 19:27, Piotr Padlewski via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:</div><br class="m_-8672572581702019908m_-6506482609783641993Apple-interchange-newline"><div><div dir="ltr">I think that clang-refactor is a good idea.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 9, 2016 at 8:52 AM, Kirill Bobyrev via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks to Saleem Abdulrasool for originally proposing this approach in the mentioned discussion.<div>+CC: Saleem Abdulrasool</div></div><div class="gmail_extra"><div><div class="m_-8672572581702019908m_-6506482609783641993h5"><br><div class="gmail_quote">On Tue, Aug 9, 2016 at 2:07 PM, Kirill Bobyrev <span dir="ltr"><<a href="mailto:kbobyrev@google.com" target="_blank">kbobyrev@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi everyone!</div><div><br></div><div>As you know we have several useful Clang-based tools: clang-format for code formatting, clang-tidy for for diagnosing and fixing typical programming errors, clang-include-fixer for automatic management of #include directives and a few others.</div><div><br></div><div>I am working on clang-rename, whose purpose is to perform efficient renaming actions in large-scale projects such as renaming classes, functions, variables, arguments, namespaces etc. It is clearly meant for refactoring code and doesn’t fit into any of above mentioned tools. And at this point we only have clang-rename for code refactoring.</div><div><br></div><div>However, there are many other interesting refactoring actions, which are typically provided by third-party editor plugins or IDEs (and which we ideally would like to have), such as:</div><div><br></div><div>* Extract method</div><div>* Inline local variable, method or constant</div><div>* Change method signature</div><div><br></div><div>And many others. For a sample list of some popular refactoring techniques see Eclipse Refactorings list (<a href="http://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fref-menu-refactor.htm" target="_blank">http://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fref-menu-refactor.htm</a>) and ReSharper C++ Refactoring (<a href="https://www.jetbrains.com/resharper-cpp/features/#refactorings" target="_blank">https://www.jetbrains.com/resharper-cpp/features/#refactorings</a>).</div><div><br></div><div>We recently had a related short discussion in <a href="https://reviews.llvm.org/D23279" target="_blank">https://reviews.llvm.org/D23279</a>, which introduced a simple tool for field reordering. The main point is that neither clang-rename nor clang-tidy are a good place for such a tool, but we don’t want to end up with too many binaries in clang-tools-extra, too.</div><div><br></div><div>My proposed solution is to create clang-refactor tool, which would be an “umbrella” for other refactoring modules. A prototype of clang-refactor would merge clang-rename inside of it and other modules and refactorings would be added later.</div><div><br></div><div>A properly designed clang-refactor tool would be able to process multiple Translation Units, which is crucial for all mentioned refactorings.</div><div><br></div><div>I am very excited about the idea of having Clang-based refactoring tool and I see a lot of potential in it.</div><div><br></div><div>I want to bring up a Community discussion and get feedback on these ideas.</div><div><br></div><div>Best regards,</div><div>Kirill Bobyrev</div>
</div>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span class="m_-8672572581702019908m_-6506482609783641993HOEnZb"><font color="#888888">-- <br><div class="m_-8672572581702019908m_-6506482609783641993m_7620110871294586240gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Best regards,<div>Kirill Bobyrev</div></div></div>
</font></span></div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>
_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br></div></blockquote></div><br></div></div></div></div>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div></div></div></div></div>