doki-theme / doki-theme-vscode

Cute anime character themes for VS-Code.
https://marketplace.visualstudio.com/items?itemName=unthrottled.doki-theme
MIT License
885 stars 49 forks source link

Method calls on numeric literals are rendered as strikethrough #149

Closed aliceif closed 2 years ago

aliceif commented 2 years ago

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

  1. Create an empty C# file
  2. Add a line: 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

image

VS2022 Darkness-Dark

image

VSCode built-in

image
Unthrottled commented 2 years ago

I think the strike through might be intentional. My VS Code is saying that is invalid.

Screen Shot 2022-05-25 at 5 12 06 PM

Here is what what I did.

  1. Put my caret over the token I wanted to inspect
  2. Ran Developer: Inspect Editor Tokens And Scopes in the command palette

Can 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.

aliceif commented 2 years ago

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:

image

But with the default dark theme I get this:

image

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.

Unthrottled commented 2 years ago

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": ""
                }
            },
        ]
    },
Screen Shot 2022-05-25 at 6 40 07 PM