Skip to content

Commit

Permalink
Add support for Bicep files (#4403)
Browse files Browse the repository at this point in the history
  • Loading branch information
lunjon authored Nov 15, 2022
1 parent 4791bd6 commit 1233c9a
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 0 deletions.
1 change: 1 addition & 0 deletions book/src/generated/lang-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
| bash || | | `bash-language-server` |
| bass || | | `bass` |
| beancount || | | |
| bicep || | | `bicep-langserver` |
| c |||| `clangd` |
| c-sharp ||| | `OmniSharp` |
| cairo || | | |
Expand Down
14 changes: 14 additions & 0 deletions languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
73 changes: 73 additions & 0 deletions runtime/queries/bicep/highlights.scm
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1233c9a

Please sign in to comment.