Hi,
I implemented textDocument/cursorInfo method based on consensus in https://reviews.llvm.org/D54529.
I'd like to ask for early feedback - what's still missing is relevant client capability.
Couple things that I'd love to hear opinions about are:
- conditional return in getCursorInfo - Should we return for example data with empty USR?
- containerName of local variables - It's currently empty even if semantic parent has a name (say it's a function). (Please search for local.cpp in the test.) Is that what we want?
- For now I used getSymbolAtPosition() as it's simpler and fits the context better. However I assume I could use this optimization from tooling::getNamedDeclAt() (in a separate patch): https://github.com/llvm-mirror/clang/blob/master/lib/Tooling/Refactoring/Rename/USRFinder.cpp#L82
- One thing I am wondering about is whether we could use (and whether it's a significant improvement) some early return in indexTopLevelDecls (using DeclarationAndMacrosFinder) also for hover and definition use-cases. Is it correct to assume that at a given Location there can be maximum of one declaration and one definition?
P. S. Alex and Ben have thanksgiving break now so they'll probably add any feedback next week.