mc-color is an extension that will format Minecraft color escape characters (§) in the editor.
The default configuration is:
// Whether the extension is enabled or not.
// Marker type provides a few means of highlighting text.
// Specfic languages to highlight on.
// You can also do "!language" to not tokenize just that language.
// Delimiters are characters that are used to STOP tokenization.
// When the tokenizer hits these character it will not color any further
// no matter what.
// Prefixes are characters that will start tokenization. (§) is the
// default Minecraft token and (&) is used for many server tools.
You can edit these settings by navigating to vscode settings:
⚙ -> settings and searching
mc-color in the search bar at the top!
Known Issues and Their Current Fixes.
There is no direct way the plugin can tell when not to color anymore when if you dont end the string with
Ending string without §r
Ending the string with §r
We also implemented "delimiters" (can be configured in settings). The way it works is you can provide an array of 1 byte characters and if it hits one of those during tokenization it will stop.
By default we have backtick (`) set which will as shown in this screenshot stop tokenization without all the excess coloring occuring like shown above:
In conclusion, to avoid this issue either
- End your strings with
- Add delimiters that will force stop tokenization.
If anyone has an idea on how to avoid this feel free to pull request!