Skip to content

Commit

Permalink
gopls/fake: add semantic token modifiers to fake editor
Browse files Browse the repository at this point in the history
This change will make it possible to do semantic token regtests.

Change-Id: I9963c60f61af30f973a2ee4cd32aaa5545bdc4ec
Reviewed-on: https://go-review.googlesource.com/c/tools/+/448296
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Peter Weinberger <pjw@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
  • Loading branch information
pjweinbgo committed Nov 7, 2022
1 parent 88a3548 commit 5050657
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gopls/internal/lsp/fake/editor.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ func (e *Editor) initialize(ctx context.Context) error {
"event", "function", "method", "macro", "keyword", "modifier", "comment",
"string", "number", "regexp", "operator",
}
params.Capabilities.TextDocument.SemanticTokens.TokenModifiers = []string{
"declaration", "definition", "readonly", "static",
"deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary",
}

// This is a bit of a hack, since the fake editor doesn't actually support
// watching changed files that match a specific glob pattern. However, the
Expand Down

0 comments on commit 5050657

Please sign in to comment.