<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"><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/<wbr>index.jsp?topic=%2Forg.<wbr>eclipse.jdt.doc.user%<wbr>2Freference%2Fref-menu-<wbr>refactor.htm</a>) and ReSharper C++ Refactoring (<a href="https://www.jetbrains.com/resharper-cpp/features/#refactorings" target="_blank">https://www.jetbrains.com/<wbr>resharper-cpp/features/#<wbr>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/<wbr>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>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Best regards,<div>Kirill Bobyrev</div></div></div>
</div>