<div dir="ltr"><div>Hi Michael,</div><div><br></div><div>clangd does not yet support global rename and we are <b>not</b> working on it actively at the moment.</div><div>We are planning our work for the next quarter right now, we might or might not prioritize it, I'll update the thread when we have final plans.</div><div><br></div><div>On the implementation side, we were discussing using the cross-references information available in clangd.</div><div>Following is my personal summary, the final design could end up being be very different from what I describe here.<br></div><div><br></div><div>It is backed the index abstraction, we were discussing if we could base rename on top of the index.</div><div>This leads to a design where we would not even need to run the Clang parser on the files when index is up-to-date, therefore getting very good performance.<br></div><div><br></div><div>But this is all very sketchy, our index at the moment:</div><div>1. can be stale and we do not rebuild it during clangd operation (only when clangd starts up),</div><div>2. can miss some references (e.g., if the references are different, depending on the preprocessor context),</div><div>3. may not be enough if we decide to add more features (e.g. conflict detection, etc.).</div><div>Note that current limitations of the index also hurt the quality of cross-references, so they will need to be fixed in any case.<br></div><div><br></div><div>Another alternative is parsing a subset of files that can have references to the symbol and using the AST-based implementation of rename we currently have.</div><div>The resulting performance will end up being much slower (parsing C++ is really slow), but we have more freedom to provide a correct and robust implementation.</div><div><br></div><div>I would expect the final design to end up a combination of the two (some files could be processed purely using the index, some require AST parsing).</div><div><br></div><div>--</div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">Regards,</div><div>Ilya Biryukov</div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">вс, 30 июн. 2019 г. в 07:51, Michael Pozulp via clangd-dev <<a href="mailto:clangd-dev@lists.llvm.org">clangd-dev@lists.llvm.org</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">If not, is anyone working on it? How would you implement it? I noticed that Haojian Wu added (local) rename support to clangd in r317780 in November 2017. I CC'd them here in case they know. Thanks :)<br></div>
_______________________________________________<br>
clangd-dev mailing list<br>
<a href="mailto:clangd-dev@lists.llvm.org" target="_blank">clangd-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/clangd-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/clangd-dev</a><br>
</blockquote></div>