Skip to content

Use augmentsSyntaxTokens parameter instead of reportSyntacticHighlightInSemanticTokens in initialization request #2767

Description

@DimaKozhinov

Description

Starting with Swift 6.4, a new parameter has been added to the initialization request: reportSyntacticHighlightInSemanticTokens. This new parameter is not part of the official lsp specification, and is placed in the initializationOptions section of the initialization request (user provided initialization options).

When the reportSyntacticHighlightInSemanticTokens is false (the default), sourcekit-lsp does not include syntactic highlight in its response to the textDocument/semanticTokens/full request. It is assumed that the client already has its own syntactic highlighting, and sourcekit-lsp should only augment it with semantic tokens.

The official lsp specification already has similar parameter: augmentsSyntaxTokens in semanic tokens client capabilities section. This parameter is currently not used by sourcekit-lsp.

See these parameters placement in the params of the initialization request (note that when one parameter is true, the other is false for the same effect):

{
    "initializationOptions": {
        "reportSyntacticHighlightInSemanticTokens": true
    },
    "capabilities": {
        "textDocument": {
            "semanticTokens": {
                "augmentsSyntaxTokens": false
            }
        }
    }
}

This feature request proposes using the officially supported augmentsSyntaxTokens parameter instead of custom reportSyntacticHighlightInSemanticTokens.

Activity

  1. arulagarwal commented on Sep 21, 2026

    @arulagarwal

    I'd like to take this one.

    Plan: read augmentsSyntaxTokens from the standard textDocument.semanticTokens client capabilities and use it in place of the reportSyntacticHighlightInSemanticTokens initialization option, preserving today's default (syntactic highlighting excluded from semantic tokens unless the client asks for it). The two have inverted senses, so the mapping is reportSyntacticHighlightInSemanticTokens == !augmentsSyntaxTokens.

    One question before I start: should reportSyntacticHighlightInSemanticTokens stay supported as a deprecated fallback for existing clients, or be removed outright?

  2. DimaKozhinov commented on Sep 22, 2026

    @DimaKozhinov
    Author

    I think reportSyntacticHighlightInSemanticTokens should stay supported as a deprecated fallback for existing clients.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions