This is an archive of the discontinued LLVM Phabricator instance.

[clangd] prototype: for singly-instantiated templates, examine the instantiation
Needs ReviewPublic

Authored by sammccall on Feb 18 2022, 7:06 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

This prototype is crude and breaks things (e.g. including rename).
It has this behavior for all selections and nothing else.
A real version would use it for *some* selections (not rename!) and some other
traversals too (syntax highlighting).

It does allow hover/go-to-definition to work in cases like:

void callMeWithFoos(std::function<void(Foo)>);
...
callMeWithFoos([](auto &&x) {
  x.^bar(); // will jump to Foo::bar
});

as well as other cases handled in D119537

Diff Detail