Skip to content
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

Multi-Document-Information in DocumentSymbolsRequest #1149

Closed
Trias opened this issue Nov 24, 2020 · 4 comments
Closed

Multi-Document-Information in DocumentSymbolsRequest #1149

Trias opened this issue Nov 24, 2020 · 4 comments
Labels
info-needed Issue requires more information from poster

Comments

@Trias
Copy link

Trias commented Nov 24, 2020

This is not a feature request as such, but rather I'm asking for advice on how to model our use case in lsp.

We want to display nested, but multi-document (think: inheritance) symbol-Information with textDocument/symbols.

DocumentSymbols defines two response-types: SymbolInformation[], which represents a flat list with a location-Field and DocumentSymbol[] which defines a hierarchical representation.

Now first choice would be the hierarchical representation, but it implies that all ranges point to the current document. SymbolInformation on the other hand does explicitly forbid infering hierarchical structures, but allows location in other doucments. It accepts a containerName, however this is apparently only intended to be used for grouping.

Is it possible to represent our use case in LSP without abusing the protocol? If not, how would an Interface look like which is acceptable to the lsp spec?

@rwols
Copy link
Contributor

rwols commented Nov 24, 2020

The hierarchy in textDocument/symbol is supposed to convey hierarchy in the sense of nested code blocks, not type information.

Instead of textDocument/symbol, I think you're looking for a "type hierarchy" kind of request (client->server):

#136
#1041
microsoft/vscode-languageserver-node#426

@Trias
Copy link
Author

Trias commented Nov 24, 2020

yes i believe this is a good match. With the caveat that we dont plan to use position-dependent information. Maybe we can integrate this use case into the proposal? i.E. make range optional to display document-level type-hierarchies?

As the PR is closed but not merged and this is as i understand not yet part of the spec, can you tell me what the status of this proposal is?

@dbaeumer
Copy link
Member

dbaeumer commented Jan 4, 2021

@Trias is it ok for you to fold this with #136.

@dbaeumer dbaeumer added info-needed Issue requires more information from poster and removed discussion labels Jan 4, 2021
@Trias
Copy link
Author

Trias commented Jan 4, 2021

yes i think my question has been answered, although i would of course prefer that lsp would provide such a request type. I'm going with a custom solution now.

@Trias Trias closed this as completed Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants