Skip to content

Commit 5050657

Browse files
committed
gopls/fake: add semantic token modifiers to fake editor
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 <[email protected]> Run-TryBot: Peter Weinberger <[email protected]> Reviewed-by: Robert Findley <[email protected]> gopls-CI: kokoro <[email protected]>
1 parent 88a3548 commit 5050657

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

gopls/internal/lsp/fake/editor.go

+4
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,10 @@ func (e *Editor) initialize(ctx context.Context) error {
265265
"event", "function", "method", "macro", "keyword", "modifier", "comment",
266266
"string", "number", "regexp", "operator",
267267
}
268+
params.Capabilities.TextDocument.SemanticTokens.TokenModifiers = []string{
269+
"declaration", "definition", "readonly", "static",
270+
"deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary",
271+
}
268272

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

0 commit comments

Comments
 (0)