Closed aliceif closed 2 years ago
I think the strike through might be intentional. My VS Code is saying that is invalid.
Here is what what I did.
Developer: Inspect Editor Tokens And Scopes
in the command paletteCan you confirm that you also get?
title | value |
---|---|
textmate scopes | invalid.illegal.constant.numeric.cssource.cs |
foreground | invalid |
If so then that is the expected behaviour, unless I need to install a plugin. I installed the c# plugin but still got this.
Ok, with the .ToString example it lines up exactly with what I see - the popup is identical. Must be a mistake in Visual Studio Code's tokenization then - calling a method on a number in C# is 100% valid.
In another case there is seemingly a difference - I defined an extension method for the integer type and with the doki theme it gives me this:
But with the default dark theme I get this:
Which has a "semantic token type" entry. To be honest I don't know anything about color theme development and if this is in any way significant - it seems like the invalid.illegal.constant.numeric thing is the root cause.
Thanks for the guidance, I think this issue can be closed since this doesn't look like a problem here specifically.
Got it! That's a shame, if they eventually fix the token parsing stuff, I'll be happy to make sure it is themed correctly.
I'll leave you with a hacky workaround.
Just plop this into your settings.json
file, and it will override the incorrect behaviour. So your thing that is wrong will look right. Whether you are ready for it to come back and bite you in the future is up to you 😄
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
"invalid.illegal.constant.numeric.cs"
],
"settings": {
"foreground": "#8097E3",
"fontStyle": ""
}
},
]
},
Describe the bug In a C# file, any method calls on a numeric literal are rendered with strikethrough for some reason. This differs from the default vscode styles and from the doki themes for VS2022 so i assume it is unintentional.
To Reproduce
System.Console.WriteLine(1.23.ToString());
Expected Behavior Have syntax rendering that follows established patterns.
Environment Version: 1.67.2 (user setup) Commit: c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5 Date: 2022-05-17T18:15:52.058Z Electron: 17.4.1 Chromium: 98.0.4758.141 Node.js: 16.13.0 V8: 9.8.177.13-electron.0 OS: Windows_NT x64 10.0.22000
Doki Theme v78.1.4
Screenshots VSCode Darkness-Dark
VS2022 Darkness-Dark
VSCode built-in