-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/tools/gopls: semantic tokenizing of numeric modifiers and imaginary unit #45792
Comments
/cc @pjweinb |
|
I could really do without the |
@pjweinb FYI I added the numeric number highlighting here jeff-hykin/better-go-syntax@43a6d98 in the textmate rule. I don't know if this makes sense for 'semantic token' feature - they are all numbers. |
Semantic highlighting and LSP spec allows custom token types/modifiers (https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide#custom-token-types-and-modifiers). I wonder if we can at least differentiate hex/dec/binary numbers using modifiers. |
i think the right way to do this is to use the new options
'noSemanticString' and 'noSemanticNumber' which disables semantic tokens
for strings and numbers, allowing the native colorization to show through,
(It's hard for users to get useful colors from the semantic token modifiers)
…On Tue, Sep 6, 2022 at 9:02 AM Hyang-Ah Hana Kim ***@***.***> wrote:
0x, 0b, etc are not keywords strictly speaking.
Semantic highlighting and LSP spec allows custom token types/modifiers (
https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide#custom-token-types-and-modifiers).
I wonder if we can at least differentiate hex/dec/binary numbers using
modifiers.
—
Reply to this email directly, view it on GitHub
<#45792 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABJIAI3XS5JDGUEZWRJUDX3V446FRANCNFSM43T6WICA>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
Closing as the |
What version of Go are you using (
go version
)?What did you do?
Write following code in VSCode with semanticTokens enabled
What did you expect to see?
Semantic tokenization of
0x
,0b
,E
, ande
numeric modifiers. This was colored before enabling LSP semantic tokenization. The coloring for these could bekeyword
(this was the default coloring I was accustomed to seeing before enabling semantic tokenizing). As a bonus maybe the0
in octal notation could be colored for clarity?I'm not sure how
i
(imaginary unit) should be tokenized. It seems to serve a different purpose as it is a number by itself. It would probably be helpful to color it though! Maybeproperty
token for it?What did you see instead?
Monocolor numbers.
The text was updated successfully, but these errors were encountered: