-
Notifications
You must be signed in to change notification settings - Fork 34.7k
Description
The built in json-language-features
extension provides plenty of nice features for JSON Schemas, such as markdownDescription
and defaultSnippets
.
I would love for it to also enable indicating that the value of a property is an embedded language.
Specifically I would love for the built in npm
extension to be able to indicate that values within the "scripts"
property of package.json
files are shellscript
values.
Would make it easier to interpret and author complex npm-scripts setup such as this:
Implementation brainstorming
The current schema that the npm
extension uses is json.schemastore.org/package:
vscode/extensions/npm/package.json
Lines 314 to 318 in 444d7a4
"jsonValidation": [ | |
{ | |
"fileMatch": "package.json", | |
"url": "https://json.schemastore.org/package" | |
}, |
It actually already contains something similar that's aimed at IntelliJ – "x-intellij-language-injection": "Shell Script"
, which IntelliJ added in JetBrains/intellij-community@2e490ce
Here's how it looks in the package.json
schema:
"scriptsInstallAfter": {
"description": "Run AFTER the package is installed.",
"type": "string",
"x-intellij-language-injection": "Shell Script"
},
Maybe something similar, such as "x-vscode-language-injection": "shellscript"
could work? Or, considering that Shell Script
is an alias of shellscript
, consume x-intellij-language-injection
wherever it is available?
Related discussions
Mostly stumbled upon people requesting this for yaml:
- Desire for embedded languages in GitHub Action workflow files: Add support for embedding languages for the
runs
keyword github/vscode-github-actions#266 - Desire for embedded languages at large in yaml files: Support syntax highlight from different language for multi-line strings with a special comment redhat-developer/vscode-yaml#943