Skip to content

Centralize SymbolInformation rendering #2310

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

Merged
merged 2 commits into from
Nov 9, 2020

Conversation

nbfalcon
Copy link
Member

@nbfalcon nbfalcon commented Nov 6, 2020

In various different parts of lsp, where SymbolInformation has to be
rendered (lsp-ivy, lsp-treemacs, lsp-imenu), only the :name is shown as
a string. This is insufficient, as other information is then ignore
displayed (currently only :deprecated?).

Add a function, lsp-render-symbol-information, which behaves similar
to lsp-render-symbol. Use it in lsp--imenu-create-non-hierarchical
index.

In various different parts of `lsp', where SymbolInformation has to be
rendered (lsp-ivy, lsp-treemacs, lsp-imenu), only the :name is shown as
a string. This is insufficient, as other information is then ignore
displayed (currently only :deprecated?).

Add a function, `lsp-render-symbol-information', which behaves similar
to `lsp-render-symbol'. Use it in `lsp--imenu-create-non-hierarchical'
index.
Copy link
Member

@yyoncho yyoncho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not part of this review ATM the issue is that you cannot navigate to element if it has children which is a very big limitation when we are rendering DocumentSymbol. The proposal is to build a list(not tree) with the following structure

Container1 / Container2 / Node

Willing to address this limitation?

@nbfalcon
Copy link
Member Author

nbfalcon commented Nov 6, 2020

I'm sorry, but I don't understand your request. SymbolInformation has no :children field. It's :container-name? field is also probably hacky to rely on, as the LSP Protocol spec says "[...] It [containerName] cannot be used to re-infer a hierarchy". Also, hierarchical imenu works like a charm for me (both with imenu-list and normal imenu).

@yyoncho
Copy link
Member

yyoncho commented Nov 6, 2020

@nbfalcon
Copy link
Member Author

nbfalcon commented Nov 6, 2020

That is coincidentally exactly what I am working on right now.

@nbfalcon
Copy link
Member Author

nbfalcon commented Nov 9, 2020

The CI failure isn't my fault - "spinner" isn't installable.

@yyoncho yyoncho merged commit 34de304 into master Nov 9, 2020
@yyoncho yyoncho deleted the refactor/centralize-SymbolInformation-rendering branch December 17, 2020 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants