lsp--imenu-create-index
from lsp-imenu.el
(in lsp-mode) does not take hierarchy into consideration. I think it might be useful if it can be used to visualize arbitrary symbol hierarchy, where the most common ones are:
struct B { B* x; int b; }; struct A { B b; int c; };
may expand to
A
B b
int b
B* x // pointer types can optionally be expanded
int b
B* x // but the client needs to explicitly trigger the expansion to avoid infinite recursion
int b
B* x
int c
void foo() { bar(); quz(); foo(); } void bar() { quz(); }
is visualized as:
quz
foo
foo // explicit expansion to avoid infinite recursion
bar
foo
foo
struct B : A {}; struct C : B {}; struct D : B {};
is visualized as:
interface SymbolInformation { name: string; // id is missing; name may be insufficient to identify a symbol kind: number; location: Location; containerName?: string; // containerName is a string. If it was an identifier, it could be used to describe a parent pointer tree }
When the point is at a reference of a symbol, textDocument/documentHighlight
or other mechanism can be employed to highlight the imenu entry and there can be some keys to trigger these different kinds of hierarchies.
I'd like to know if such extensions have been implemented in other servers. We should unify these server API interfaces and even standardize it.
Alexander-Miller, iromise, tutysara and artisdom
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4