-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does the plugin configuration support using JSON or YAML TextMate grammars? #75
Comments
I tried using a TextMate grammar in JSON format, but no success. |
I faced this challenge again recently, and I think I know how to support JSON formatted Textmate grammars. Vscode knows about the grammar thanks to the contribution point in package.json, which is currently generated like: {"language": "${configuration.language}", "scopeName": "${configuration.textmateGrammarScope}", "path": "./grammar.tmLanguage"} Importantly, the path is hardcoded to grammar.tmLanguage. From my experimentation, vscode uses file extensions to determine the format of the Textmate grammar file before parsing and using it. I have tested referencing the same grammar in JSON format from a file ending in Knowing this, I suggest preserving the filename of the file set as textmate grammar in the configuration. Both while copying the file: Lines 302 to 308 in 0597e0c
and also while referencing it: Lines 186 to 196 in 0597e0c
|
As for YAML, Vscode does not support YAML grammars natively, they must be converted to JSON or XML.
|
Refer to the Kuki language server implementation for a concrete example of how to support JSON formatted grammars: |
Does the plugin support using TextMate grammars defined as JSON or YAML? It seems that only XML definitions are supported and used to build a grammar definition - what if we want to re-use the JSON/YAML grammar from an existing Visual Studio Code extension?
The text was updated successfully, but these errors were encountered: