fisheva / Eva-Theme

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

A little display error in CPP #107

Closed ShanruChuan closed 4 months ago

ShanruChuan commented 7 months ago

Screenshot

Code Snippet

int n_int = INT_MAX;
sizeof(int); // first
sizeof n_int; //second

Supplement

sizeof两种用法颜色不同(eva-dark)。sizeof(int);中“sizeof"呈现蓝色,与函数名的颜色相同。sizeof n_int;中”sizeof"的颜色为白色,与变量名的颜色相同。sizeof在Cpp中是关键字,不是函数。其实无论是何种颜色,sizeof两种用法颜色统一即可。

fisheva commented 6 months ago

主题是根据字符的scope值为字符添加颜色的,字符的scope值由VSCode给定。您可以通过按Ctrl+Shift+P(Windows)或Cmd+Shift+P(Mac)并选择Inspect Editor Tokens and Scopes来检查它们。 _20231215141429 _20231215141443

这里第二种写法的 sizeof 是变量颜色是由于VSCode对C++的支持不够深,字符的scope值给予的不够详细导致的,如果要强行颜色一致,只有把第一种颜色改成 变量颜色,但我觉得那样不好。