Closed 103sbavert closed 4 months ago
Another issue I noticed, unlike most IDEs, in VSC most keywords are dark blue but not all. For example the return keyword is pinkish. I don't think that's a good idea. All keywords should be the same color or at least we should be able to make them all the same color.
Looks very similar to jeff-hykin/better-cpp-syntax#200.
jeff-hykin/better-cpp-syntax@ad31cfa only fixed its cpp grammar, and indeed the issue doesn't happen when set to cpp mode.
(c)
(cpp)
Copied my reply from https://github.com/microsoft/vscode/issues/138695#issuecomment-990025943
Another issue I noticed, unlike most IDEs, in VSC most keywords are dark blue but not all. For example the return keyword is pinkish. I don't think that's a good idea. All keywords should be the same color or at least we should be able to make them all the same color.
@sbeve72 you can customize any theme for any language to have exactly the colors you want just by editing your settings. Short tutorial here
(I don't control the default theme btw)
Keyword is pretty broad. There's operators, control flow, entity declarations, built in primitives, built-in modifiers, built in pointers, built in macros, built in functions, type casting, access specifiers, and more. It would be a major loss of information if the parser didn't distinguish between them. If you want to make them all the same color you're welcome to find or make a theme that does, but the capability will exist for theme designers who want to deeply color different code functionality.
Can I do anything about the bug that I mentioned in the original comment? Is there a way to customize the theme to fix that?
You can change the color, but the original thing is a legitimate bug that is broken on the parser side. Right now the C parser needs to be rewritten, and that coloring is happening because it thinks int and char are parameters instead of types
Checklist
"C_Cpp.enhancedColorization": "Disabled"
The code with a problem is (A function declaration without the paramter identifier):
It looks like:
It should look like:
As you can see, in the code above with the C programming language, both
int
andchar
should be colored dark blue instead of light blue (which is used for parameter identifiers in VSC). The problem is only persistent with C and not C++.int
andchar
being keywords should be highlighted with dark blue as all other keywords are but that isn't the case.