diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 086cd3c68f43..1c2ffdc62b8c 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -5,6 +5,7 @@ | bash | ✓ | | | `bash-language-server` | | bass | ✓ | | | `bass` | | beancount | ✓ | | | | +| bicep | ✓ | | | `bicep-langserver` | | c | ✓ | ✓ | ✓ | `clangd` | | c-sharp | ✓ | ✓ | | `OmniSharp` | | cairo | ✓ | | | | diff --git a/languages.toml b/languages.toml index 839b6223af99..78e3a35d999a 100644 --- a/languages.toml +++ b/languages.toml @@ -1966,3 +1966,17 @@ roots = [] [[grammar]] name = "ini" source = { git = "https://github.com/justinmk/tree-sitter-ini", rev = "4d247fb876b4ae6b347687de4a179511bf67fcbc" } + +[[language]] +name = "bicep" +scope = "source.bicep" +file-types = ["bicep"] +roots = [] +auto-format = true +comment-token = "//" +indent = { tab-width = 2, unit = " "} +language-server = { command = "bicep-langserver" } + +[[grammar]] +name = "bicep" +source = { git = "https://github.com/Sjord/tree-sitter-bicep", rev = "60795d3a1b493e064b263a64cb4f7f758a3394d7" } diff --git a/runtime/queries/bicep/highlights.scm b/runtime/queries/bicep/highlights.scm new file mode 100644 index 000000000000..b6f928726333 --- /dev/null +++ b/runtime/queries/bicep/highlights.scm @@ -0,0 +1,73 @@ +; Keywords + +[ + "module" + "var" + "param" + "import" + "resource" + "existing" + "if" + "targetScope" + "output" +] @keyword + +; Functions + +(decorator) @function.builtin + +(functionCall) @function + +(functionCall + (functionArgument + (variableAccess) @variable)) + +; Literals/Types + +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket + +(resourceDeclaration + (string + (stringLiteral) @string.special)) + +(moduleDeclaration + (string + (stringLiteral) @string.special)) + +[ + (string) + (stringLiteral) +] @string + +(nullLiteral) @keyword +(booleanLiteral) @constant.builtin.boolean +(integerLiteral) @constant.numeric.integer +(comment) @comment + +(string + (variableAccess + (identifier) @variable)) + +(type) @type + +; Variables + +(localVariable) @variable + +; Statements + +(object + (objectProperty + (identifier) @identifier)) + +(propertyAccess + (identifier) @identifier) + +(ifCondition) @keyword.control.conditional