Skip to content

Only sends a textDocument/documentHighlight request when on an identifier #1303

Closed
@Veykril

Description

@Veykril

VSCode doesn't seem to send a textDocument/documentHighlight request when the cursor isn't on an identifier(whatever this means to vscode). The LSP documentation doesn't state that this request should only be sent in that case though.

The document highlight request is sent from the client to the server to resolve a document highlights for a given text document position.
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_documentHighlight

We ran into this in rust-analyzer when trying to highlight exit points, which in rust can have the form of a simple ? character. So having the cursor on this character currently can't trigger the highlight. rust-lang/rust-analyzer#9375

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