https://github.com/redcmd/json-embedded-languages
VSCode Extension: Syntax highlighting ShellScript inside package.json "scripts"
https://github.com/redcmd/json-embedded-languages
package-json shell-script textmate-grammar
Last synced: 2 months ago
JSON representation
VSCode Extension: Syntax highlighting ShellScript inside package.json "scripts"
- Host: GitHub
- URL: https://github.com/redcmd/json-embedded-languages
- Owner: RedCMD
- License: mit
- Created: 2024-08-27T04:17:35.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-01T01:40:09.000Z (10 months ago)
- Last Synced: 2024-12-01T02:28:46.398Z (10 months ago)
- Topics: package-json, shell-script, textmate-grammar
- Homepage: https://marketplace.visualstudio.com/items?itemName=RedCMD.json-embedded-languages
- Size: 231 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# JSON Embedded Languages
Syntax Highlighting for embedded languages within `JSON` and `JSONC` files.
It does so by overriding the default `JSON` and `JSONC` languages and assigning a scopeName to each object with the form `.meta.embedded.objectkey.`.
Then using multiple injection grammars that target those scopeNames and inject specific languages into it.## Features
* ShellScript within `"scripts"` for `package.json` (`JSON`)
* [when-clause-contexts](https://code.visualstudio.com/api/references/when-clause-contexts) within `"when"` for `package.json` (`JSON`)
* JSON escaped JavaScript Regular Expressions within `"wordPattern"`, `"folding"`, `"onEnterRules"` and `"indentationRules"` for `language-configuration.json` (`JSONC`)
* Snippets, Regex and Markdown within `"defaultSnippets"`, `"pattern"` and `"markdownDescription"` for `.schema.json` (`JSON`)
Recommend the [Snippets Snippets](https://marketplace.visualstudio.com/items?itemName=RedCMD.snippets-snippets) extension
## Known Issues
This extension targets every `JSON` and `JSONC` file, not just `package.json`.
There will be false positives and false negatives.
Please report any you come across.VSCode TextMate injections are rather slow.
It may take longer for documents to fully syntax highlight.
The `regexp` `"injectionSelector"` is almost 10,000 characters long.## For more information
* The GitHub [Issue](https://github.com/microsoft/vscode/issues/224581) that spawned the idea
* [Repository](https://github.com/RedCMD/JSON-Embedded-Languages)
* [Marketplace](https://marketplace.visualstudio.com/items?itemName=RedCMD.json-embedded-languages)## TODO:
* `globs`/`"filenamePatterns"`
* Improve performance