How to change the color of the keyword #1224
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
@jiashengguo These are just done using different scopes for the textMate tokenizer. You can inspect the scope of a token in vscode by executing the To change this you need to modify the generated textMate grammar to use a different scope for your keywords. Since Langium doesn't really know which keyword belongs to which scope (see also the discussion over at #818), it will just generate all keywords into the default keyword scope ( To use the blue colored keywords in your example, you need to switch from the
In vscode, it's completely up to the theme designer to change the color certain scopes use. The language server/textMate grammars have no influence over the actual coloring, they just give the editor some syntactic/semantic token data. The actual coloring is purely depended on the theme. |
Beta Was this translation helpful? Give feedback.
@jiashengguo These are just done using different scopes for the textMate tokenizer. You can inspect the scope of a token in vscode by executing the
Developer: Inspect Editor Tokens and Scopes
command.To change this you need to modify the generated textMate grammar to use a different scope for your keywords. Since Langium doesn't really know which keyword belongs to which scope (see also the discussion over at #818), it will just generate all keywords into the default keyword scope (
keyword.control.<id>
).To use the blue colored keywords in your example, you need to switch from the
keyword.control.<id>
to thekeyword.storage.<id>
scope.