-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make lsp-ui-imenu hierarchical #73
Comments
rls: @Xanewok |
I agree that something should be done to have symbols hierarchy. I think that containerName can just be rename to parentId: interface SymbolInformation {
name: string; // Name display to the user
kind: number;
location: Location;
id: string // A unique identifier
parentId?: string // An optional pointer to its parent. Could be a string[] ?
} The RLS doesn't provide yet such hierarchy, but it shouldn't be difficult to implement. @Xanewok ? Related discussions: |
Some issues for consideration re hierarchies.
And 'location'
(from https://microsoft.github.io/language-server-protocol/specification) Further discussion of symbol hierarchy is here microsoft/language-server-protocol#327 , here microsoft/vscode#34968 and here microsoft/language-server-protocol#136 . It seems from these issues that creating a separate method for getting symbol hierarchies is in the works ? My own experience is that getting proper hierarchies is a big pain and may require an AST if we choose to just adopt ad-hoc hacks. |
May I loop @beacoder in as he has recently published https://github.com/beacoder/call-graph which provide similar features. |
@MaskRay ,thanks for loop me in. Some explanation in Chinese(due to poor english): hope this is of some help to you guys, thanks. |
emacs-cquery now has hierarchial trees for This uses yet another custom tree implementation, which i would be perfectly willing to hand over to lsp-ui for this. |
Thanks! I have done some minor work based on yours. On the cquery server side, these hierarchies have been unified (in terms of the interface),
In |
@topisani I think a big issue is that your code is licensed under MIT but most Emacs packages are under GPL 3. I am not a big fan of GPL 3 but I think it is better to keep the convention. Without switching to GPL 3 it is very difficult for anyone to pick it up. And also the copyright notice in https://github.com/emacs-lsp/lsp-ui/blob/master/lsp-ui.el |
@MaskRay makes sense, feel free to relicense any of my emacs-cquery code to GPL3. Also all of lsp-ui should cite @sebastiencs as the author |
@topisani can you make the relicense change?.. I cannot do it for you as otherwise I would make a similar mistake as that (presumably) made by esr |
Fixed by #179 |
The file was initially created as a placeholder for UI stuff by topisani. Sebastien Chapuis contributed most components and I polished them and touched most lines in this particular file. Move away from the confusing mix of GPL 3 and MIT. This was agreed by topisani: #73 (comment)
lsp--imenu-create-index
fromlsp-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:may expand to
is visualized as:
is visualized as:
LSP spec
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.
The text was updated successfully, but these errors were encountered: