Compare commits

...

2 Commits

Author SHA1 Message Date
Jarred-Sumner
3414c27a50 bun run prettier 2025-05-19 16:58:32 +00:00
Jarred Sumner
120c4299d2 feat(vscode): add shell template syntax 2025-05-19 09:55:52 -07:00
2 changed files with 50 additions and 0 deletions

View File

@@ -83,6 +83,12 @@
"type": "string",
"default": "",
"description": "Custom script to use instead of `bun test`, for example script from `package.json`"
},
"bun.shellTaggedTemplates.enabled": {
"type": "boolean",
"scope": "window",
"default": true,
"description": "Highlight `$` tagged template literals from Bun as shell scripts."
}
}
},
@@ -339,6 +345,19 @@
}
}
}
],
"grammars": [
{
"scopeName": "bun.inline.shell",
"path": "./syntaxes/bun-shell.tmLanguage.json",
"language": "shellscript",
"injectTo": [
"source.ts",
"source.tsx",
"source.js",
"source.jsx"
]
}
]
},
"description": "The Visual Studio Code extension for Bun.",

View File

@@ -0,0 +1,31 @@
{
"scopeName": "bun.inline.shell",
"injectionSelector": "L:source -comment -string",
"patterns": [
{
"name": "string.template.shell.bun",
"begin": "(\\bBun\\.\\$|\\$)\\s*(?=`)",
"beginCaptures": {
"0": { "name": "entity.name.function.tagged-template.js" }
},
"end": "(?<=`)",
"patterns": [{ "include": "#embedded-shell" }]
}
],
"repository": {
"embedded-shell": {
"name": "string.template.js",
"contentName": "meta.embedded.block.shell",
"begin": "`",
"beginCaptures": { "0": { "name": "punctuation.definition.string.template.begin.js" } },
"end": "`",
"endCaptures": { "0": { "name": "punctuation.definition.string.template.end.js" } },
"patterns": [
{ "include": "source.ts#template-substitution-element" },
{ "include": "source.ts#string-character-escape" },
{ "include": "source.shell" },
{ "match": "." }
]
}
}
}