Add VSCode syntax highlighting extension for Flux

Adds the vscode-flux extension with TextMate grammar covering keywords,
types, literals, operators, comments, and function/struct name highlighting.
Supports .flux and .flx file extensions.
This commit is contained in:
2026-03-10 14:42:46 +01:00
parent 73e36fac71
commit 0e08640f59
3 changed files with 278 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
{
"comments": {
"lineComment": "//",
"blockComment": ["/*", "*/"]
},
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
],
"autoClosingPairs": [
{ "open": "{", "close": "}" },
{ "open": "[", "close": "]" },
{ "open": "(", "close": ")" },
{ "open": "\"", "close": "\"", "notIn": ["string", "comment"] },
{ "open": "'", "close": "'", "notIn": ["string", "comment"] },
{ "open": "/*", "close": " */" }
],
"surroundingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""],
["'", "'"]
],
"onEnterRules": [
{
"beforeText": { "pattern": "^\\s*/\\*\\*(?!/)([^*]|\\*(?!/))*$" },
"action": { "indent": "indentOutdent", "appendText": " * " }
},
{
"beforeText": { "pattern": "^\\s* \\* (?!/).*$" },
"action": { "indent": "none", "appendText": "* " }
},
{
"beforeText": { "pattern": "^\\s* \\*/$" },
"action": { "indent": "none", "removeText": 1 }
}
],
"indentationRules": {
"increaseIndentPattern": { "pattern": "^.*\\{[^}\"']*$" },
"decreaseIndentPattern": { "pattern": "^\\s*\\}" }
},
"wordPattern": { "pattern": "[a-zA-Z_][a-zA-Z0-9_]*" }
}