vscode-nim icon indicating copy to clipboard operation
vscode-nim copied to clipboard

Control flow keywords are highlighted differently

Open Araq opened this issue 3 years ago • 3 comments

if, case and the like have a different color than e.g. proc. This makes little sense in Nim where templates can provide new control flow structures. There should not be a distinction between "keyword related to control flow" and other keywords. (Besides, I'm not aware of any usability study that shows benefits for having all these different kinds of keyword sets.)

Araq avatar Mar 09 '21 07:03 Araq

This is more of a bug with the theme than with the plugin - vscode-nim doesn't define any colors but it does differentiate control keywords from normal onas.

This is how it's done in a lot of other languages too, see the TextMate example grammar - https://macromates.com/manual/en/language_grammars - "For example the first rule above assigns the name keyword.control.untitled to the following keywords: if, while, for and return"

Yardanico avatar Mar 15 '21 23:03 Yardanico

With monokai vibrant (or even VSCode dark) it's all the same colour: image

image

So if you don't want custom themes my suggestion would be to use VSCode Dark. Preferences icon in the bottom right - Color Theme - "Dark (Visual Studio)" (the default one is "Dark+")

Yardanico avatar Mar 15 '21 23:03 Yardanico

The definition in the extension does not set the colour, that is correct.

The syntax highlighting definition does classify various syntax using a dot separated string with some conventions.

Those conventions are then used by the theming to colour the various items. It's this classification that needs fixing.

saem avatar Mar 15 '21 23:03 saem