[clangd-dev] Does clangd support global rename?
Ilya Biryukov via clangd-dev
clangd-dev at lists.llvm.org
Mon Jul 1 00:52:46 PDT 2019
Hi Michael,
clangd does not yet support global rename and we are *not* working on it
actively at the moment.
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.
On the implementation side, we were discussing using the cross-references
information available in clangd.
Following is my personal summary, the final design could end up being be
very different from what I describe here.
It is backed the index abstraction, we were discussing if we could base
rename on top of the index.
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.
But this is all very sketchy, our index at the moment:
1. can be stale and we do not rebuild it during clangd operation (only when
clangd starts up),
2. can miss some references (e.g., if the references are different,
depending on the preprocessor context),
3. may not be enough if we decide to add more features (e.g. conflict
detection, etc.).
Note that current limitations of the index also hurt the quality of
cross-references, so they will need to be fixed in any case.
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.
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.
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).
--
Regards,
Ilya Biryukov
вс, 30 июн. 2019 г. в 07:51, Michael Pozulp via clangd-dev <
clangd-dev at lists.llvm.org>:
> 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 :)
> _______________________________________________
> clangd-dev mailing list
> clangd-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/clangd-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/clangd-dev/attachments/20190701/24679e9a/attachment.html>
More information about the clangd-dev
mailing list