Skip to content

Multi-Document-Information in DocumentSymbolsRequest #1149

Description

@Trias

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?

Activity

  1. rwols commented on Nov 24, 2020

    @rwols
    Contributor

    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

  2. Trias commented on Nov 24, 2020

    @Trias
    Author

    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?

  3. dbaeumer commented on Jan 4, 2021

    @dbaeumer
    Member

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

  4. Trias commented on Jan 4, 2021

    @Trias
    Author

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    info-neededIssue requires more information from poster

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions