Binaryify / OneDark-Pro

Atom's iconic One Dark theme for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=zhuangtongfa.Material-theme
MIT License
1.52k stars 289 forks source link

C/C++ variables are set red #390

Closed w-xy closed 4 years ago

w-xy commented 4 years ago

In C/C++, all variables are set red. It's too harsh when the C codes are full of variables. I wonder if it's a bug, if not, how can I set the variables gray as in python codes?

捕获


OS: Win7 Pro SP1 VSCode: 1.44.2 One Dark Pro: 3.5.0

sagar-barapatre commented 4 years ago

Hello, Either you can change your theme to material theme or you can change your IDE. I personally use both Sublime text as well as VS code But in sublime text, the variables are not in red color. So it's completely your choice which option to choose to. Happy Coding!!!

w-xy commented 4 years ago

@sagarbarapatre02 Thanks for your suggestion, but I don't have a commercial lincense of sublime text, so vs code is the only choise for me. I use atom in my personal computer, and I really enjoy the One-Dark theme. I cannot give up easily...

Binaryify commented 4 years ago

could you provide the code in your screenshot

w-xy commented 4 years ago

@Binaryify

#include <stdio.h>

void main()
{
   char *name = "Jack";
   printf("Hello, %s\n", name);
}
Binaryify commented 4 years ago

did you installed other extensions? that name is not red in my vscode image

w-xy commented 4 years ago

@Binaryify I reproduced the problem in my personal computer. I installed the offcial extension: C/C++, and the name turned red immediately. When I disable the extension, it turns gray. I noticed that there's a wavy line in your screenshot, which seems to mean you didn't install C/C++ extension, or you didn't configure the include path so the header file cannot be identified. If you have installed the extension, you can just reproduct the problem without any header by this: void main() { char *name = "Jack"; }

Binaryify commented 4 years ago

ok

Binaryify commented 4 years ago

image still can't reproduced, did I miss something?

w-xy commented 4 years ago

It seems good in my WSL too. Could you please try it in Windows?

Binaryify commented 4 years ago

image

w-xy commented 4 years ago

捕获 捕获2

Binaryify commented 4 years ago

oh, I see that in my vscode insider image will try to fixed that

w-xy commented 4 years ago

thank you

Binaryify commented 4 years ago

just fixed this in v3.6.1

w-xy commented 4 years ago

Thanks. It's fine now in my personal machine. I'll check it tomorrow.

GenhaoLi commented 2 years ago

Hi, it seems that the same problem happens again. All kinds of variable in C are coral now.

This can be reproduced on both Windows 10 and Ubuntu 16.04 with the only other extension C/C++ by Microsoft.

image

Local variables are light white only if C/C++ extension is disabled.

Binaryify commented 2 years ago

@Gytobp will fix that soon

Binaryify commented 2 years ago

@Gytobp you can check v3.12.3

e-potashkin commented 2 years ago

In C#, all variables also are set red. Could you please change it too? =)

Binaryify commented 2 years ago

@e-potashkin ok

MoonChasing commented 2 years ago

@Binaryify Hello,I am accustomed to the coral color of the variables in the C language. Now it was fixed as a bug. I am very uncomfortable. Can you make this an option?

Binaryify commented 2 years ago

@MoonChasing you can add this in your settings.json

 "editor.semanticTokenColorCustomizations": {
    "rules": {
      "variable:c": {
        "foreground": "#e06c75"
      },
      "variable:cpp": {
        "foreground": "#e06c75"
      },
      "variable:cs": {
        "foreground": "#e06c75"
      }
    }
  },
MoonChasing commented 2 years ago

@Binaryify Thank you very much.

tristan957 commented 2 years ago

Initially it was a jarring change. Wondering what Atom One Dark Pro does in this situation. It was kind of nice to be able to see the parameters at a glance easily. Don't really care enough to stray from the default behavior however.

Binaryify commented 2 years ago

discussion link https://github.com/Binaryify/OneDark-Pro/discussions

BenJSouthwell commented 2 years ago

It should be consistent with the original implementation of the theme. They should be grey. If red is preferred by some it could be a potential option. But if you are to make a clone of a colour theme then you should be consistent with it, otherwise what is the point ?

Andreasgdp commented 1 year ago

If you just want to keep using the defaults of one dark pro but still use the c/c++ extension, you can set the following extension setting:

"C_Cpp.enhancedColorization": "disabled"