fisheva / Eva-Theme

A comfortable and semantic theme.
https://marketplace.visualstudio.com/items?itemName=fisheva.eva-theme
MIT License
457 stars 38 forks source link

Textmate colorization for `new` expression in `csharp` keyword incorrect #109

Closed sharpchen closed 10 months ago

sharpchen commented 11 months ago

target-typed new should be treated as regular keyword

Screenshot

Code Snippet

Person p = new();
Person p = new Person();
int[] arr = new[] { 1, 2, 3 };
if (true) throw new Exception();

Notes

sharpchen commented 11 months ago

@fisheva Shall I include all colorization issue for csharp in one issue or separate them? I got some similar issue, may be annoying.

fisheva commented 11 months ago

It is best to put similar issues in the same issue, but for already opened issues, just put them there. It's okay.

sharpchen commented 11 months ago

Ok, thank you. I just found so many issues of textmate rules for csharp, I think I'd better learn something about textmate rules, and maybe make a PR someday?

fisheva commented 11 months ago

Of course you can! I don't write C# in my daily work. I am looking forward to your PR.

sharpchen commented 11 months ago

I wonder how should I test my changes in my machine? Build visx in local and install it?

fisheva commented 11 months ago

There are two methods for testing:

1)Find the installation folder of the VSCode plugin, locate the Eva Theme, directly edit the theme file in the Themes folder, and then restart VSCode to see the changes take effect. 2) Add the following text to the VSCode settings.json.

    "editor.tokenColorCustomizations": {
        //effect Eva Dark Italic Bold only
        "[Eva Dark Italic Bold]": {
            "textMateRules": [
                {
                    "scope": "source.cs keyword.operator.expression",
                    "settings": {
                        "foreground": "#A78CFA",
                        "fontStyle": "italic bold"
                    },
                },
            ],
        },
        //effect all themes
        "textMateRules": [
            {
                "scope": "entity.name.type.parameter",
                "settings": {
                    "foreground": "#FF6AB3",
                    "fontStyle": ""
                },
            },
        ],
}

Method 2nd doesn't need to restart VSCode, and the color modifications will override the first method.

fisheva commented 11 months ago

I have fixed the C# syntax highlighting errors you mentioned today. Please upgrade Eva Theme to 2.4.6.

WX20231219-221351@2x

I am going to bed now, see you.

sharpchen commented 11 months ago

Actually, didn't fixed somehow. I will PR my changes tomorrow, includes issues I raise today.