Skip to content

Commit 5ffadd3

Browse files
hyangahgopherbot
authored andcommitted
docs: mention advanced semantic token options
They are: "ui.noSemanticNumber": true, "ui.noSemanticString": true Updates #2682 Change-Id: I942b735af16ed7d070615baad231df4cdcba5d73 GitHub-Last-Rev: 9ac0a3e GitHub-Pull-Request: #2684 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/471280 Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Peter Weinberger <pjw@google.com> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> Auto-Submit: Hyang-Ah Hana Kim <hyangah@gmail.com>
1 parent 72249dc commit 5ffadd3

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

docs/features.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,18 @@ Quickly toggle between a file and its corresponding test file by using the [`Go:
112112

113113
The default syntax highlighting for Go files is implemented in Visual Studio Code using TextMate grammar, not by this extension.
114114

115-
If you are using `gopls`, you can enable [Semantic Highlighting](https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide) for more accurate syntax highlighting based on semantic tokenization using `"gopls": { "ui.semanticTokens": true }`.
115+
If you are using `gopls`, you can enable [Semantic Highlighting](https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide) for more accurate syntax highlighting based on semantic tokenization using this setting:
116+
117+
```
118+
"gopls": {
119+
"ui.semanticTokens": true,
120+
121+
// you can optionally turn on these features for more colors
122+
// see https://go.dev/issue/45753 and https://go.dev/issue/45792
123+
"ui.noSemanticString": true, // delegates string syntax highlighting to vscode
124+
"ui.noSemanticNumber": true, // delegates number syntax highlighting to vscode
125+
}
126+
```
116127

117128
### Go template syntax highlighting
118129

0 commit comments

Comments
 (0)