Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Semantic Highlighting #85

@chergert

Description

@chergert

Unfortunately, the Language Server Protocol does not yet include API for proper Semantic Highlighting. In Builder, I landed a hack to work around this that has a small caveat.

I've abused the textDocument/documentSymbol API to get a list of symbols in a file and then fuzzy match on them when highlighting the source document. As you might imagine, this limits what we can semantically highlight to symbols that exist within the current rust document.

However, if we were to have an API that allowed us to get an index of all symbols within the project, we could build our index for the highlighter from that, giving us something close to being correct.

Basically all I need from the API is the name and kind property from the textDocument/documentSymbols endpoint so that I can select the proper highlight style in from our style scheme. I think this might be doable simply by implementing the workspace/symbol endpoint and returning everything for an empty query.

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions