Developer Notes for language contributions
have your grammar as a 3rd party language module
Create a language grammar definition file, a file which defines a function accepting a reference to the library and returning a language object.
- https://github.com/highlightjs/highlight.js/blob/master/extra/3RD_PARTY_QUICK_START.md Links to two instances of example language grammars.
Main repository
Table of all supported languages
Documentation page
New language request redirect
https://github.com/highlightjs/highlight.js/blob/master/src/languages/python.js
Evolution of commits to python.js https://github.com/highlightjs/highlight.js/commits/122e363f2b257488d67c2fd2202f855e22190280/src/languages/python.js
Starlark Language
Starlark Rules & Tools
TODO update the above mark down with the future highlight.js implementation
https://github.com/bazelbuild/vscode-bazel/blob/12c20773c5bbbdbbd30cc393c414622059c05537/package.json#L193-L221
This direct json file should it be converted to a highlight.js
equivalent would solve the missing piece for bazel
syntax highlight support needed for Reviewable capabilities.
VS Code's tokenization engine is powered by TextMate grammars. TextMate grammars are a structured collection of regular expressions and are written as a plist (XML) or JSON files. https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide#tokenization
The nitty gritty language definitions, seemingly more nuanced that highlight JS, seems more structured and semantic and actually leans on hierarchical structure by leveraging existing https://github.com/bazelbuild/vscode-bazel/blob/master/syntaxes/starlark.tmLanguage.json https://github.com/bazelbuild/vscode-bazel/blob/master/syntaxes/starlark.configuration.json