Language extension for VSCode/Bluemix Code that adds syntax colorization for both the output/debug/extensions panel and *.log
files.
Note: If you are using other extensions that colorize the output panel, it could override and disable this extension.
Colorization should work with most themes because it uses common theme token style names. It also works with most instances of the output panel. Initially attempts to match common literals (strings, dates, numbers, guids) and warning|info|error|server|local messages.
You can customize the semantic identification of the output by adding entries to outputcolorizer.semantics.
In settings.json:
"outputcolorizer.semantics": [
{
"pattern": "{.*}",
"applies": "between",
"tokenType": "info",
"tokenModifier": "output"
},
]
This will identify anything inside the matching regex pattern as info.output semantics. Now you are free to add your own color rule:
// settings.json
"editor.semanticTokenColorCustomizations": {
"rules": {
"error.output": "#ff0000",
"info.output": "#00ff00"
},
},
interface SemanticObject {
pattern: string; // A Regex compliant string
applies: 'between' | 'eol' | 'eof';
tokenType: string;
tokenModifier: string;
}
-
pattern
This is a regex string fed into RegExp() class. Escape rules apply just as they would to the RegExp class in javascript.
-
applies
Applies Description between From the start to the end of the regex will be identified by the semantic tokenType.tokenModifier eol From the start of the regex match to the end of the line will be identified by the sematnic tokenType.tokenModifier, unless another token occurs before then eof From the start of the regex match to the end of the file will be identified by the sematnic tokenType.tokenModifier, unless another token occurs before then -
tokenType
This can be either a standard token or a custom name that you would like to assign values to separately.
-
tokenModifier
This can be either a standard modifier or a custom name that you would like to assign values to separately.
- 0.1.2 - Updated for compliance with upcoming VS Code marketplace changes
- 0.1.1 - Regex updates for color coding support
You can contribute to the project by reading the Contribution guidelines
- https://code.visualstudio.com/docs/customization/colorizer
- http://stackoverflow.com/questions/33403324/how-to-create-a-simple-custom-language-colorization-to-vs-code
- http://manual.macromates.com/en/language_grammars
You can open an issue on the GitHub repo
Portions of the language grammar are based off of a StackOverflow question, asked by user emilast and answered by user Wosi, availble under Creative Commons at: http://stackoverflow.com/questions/33403324/how-to-create-a-simple-custom-language-colorization-to-vs-code