VS Code中的C#语义突出显示

时间:2020-06-15 17:03:56

标签: c# visual-studio-code

我正在尝试利用VS Code的新功能,以使用新语义突出显示C#代码。

虽然代码本身已成功突出显示,但同时悬停工具提示时忽略了我的更改。 问题是它缺少这项新的“语义突出显示”功能的功能,还是我错过了一些东西。

enter image description here

我的settings.json

{
    "editor.semanticHighlighting.enabled": true,
    "csharp.semanticHighlighting.enabled": true,
    "editor.semanticTokenColorCustomizations": {
        "enabled": true,
        "rules": {
            "plainKeyword": {
                "foreground": "#ff0000",
            },
            "class": "#ffff00",
            "interface": {
                "foreground": "#00ff00",
                "fontStyle": "italic",
            }
        }
    }
}

因此它成功检测到interfaceclasskeyword语义并设置了正确的样式。但是在弹出窗口中,它仍然是默认样式。 (已选择默认的深色主题)

我知道我可以通过以下方式为悬停工具提示调整颜色而无需语义:

"editor.tokenColorCustomizations": {
        "textMateRules": [
            {
                "scope": [
                    "storage.type.cs",
                ],
                "settings": {
                    "foreground": "#00FF00",
                    "fontStyle": "italic"
                }
            }
        ]
    }

弹出窗口将获得新样式,但是它不使用C#语义并且无法在类和接口之间理解:

enter image description here

这是一个错误,是我所缺乏的知识还是设计使然?

0 个答案:

没有答案