on master help sign in
Add support for Bicep files (#4403)
commit1233c9a989f419315a9fc2ed0bc10f9338aa8322 authorJonathan <jon.lundholm@gmail.com> dateTue 15 Nov 2022, 02:43 (4 years ago) parent4791bd6
3 files changed+88
book/src/generated/lang-support.md+1 languages.toml+14 runtime/queries/bicep/highlights.scm+73
book/src/generated/lang-support.md+1
@@ -5,6 +5,7 @@
55| bash | ✓ | | | `bash-language-server` |
66| bass | ✓ | | | `bass` |
77| beancount | ✓ | | | |
8+| bicep | ✓ | | | `bicep-langserver` |
89| c | ✓ | ✓ | ✓ | `clangd` |
910| c-sharp | ✓ | ✓ | | `OmniSharp` |
1011| cairo | ✓ | | | |
languages.toml+14
@@ -1966,3 +1966,17 @@ roots = []
19661966[[grammar]]
19671967name = "ini"
19681968source = { git = "https://github.com/justinmk/tree-sitter-ini", rev = "4d247fb876b4ae6b347687de4a179511bf67fcbc" }
1969+
1970+[[language]]
1971+name = "bicep"
1972+scope = "source.bicep"
1973+file-types = ["bicep"]
1974+roots = []
1975+auto-format = true
1976+comment-token = "//"
1977+indent = { tab-width = 2, unit = " "}
1978+language-server = { command = "bicep-langserver" }
1979+
1980+[[grammar]]
1981+name = "bicep"
1982+source = { git = "https://github.com/Sjord/tree-sitter-bicep", rev = "60795d3a1b493e064b263a64cb4f7f758a3394d7" }
runtime/queries/bicep/highlights.scmnew file+73
@@ -0,0 +1,73 @@
1+; Keywords
2+
3+[
4+ "module"
5+ "var"
6+ "param"
7+ "import"
8+ "resource"
9+ "existing"
10+ "if"
11+ "targetScope"
12+ "output"
13+] @keyword
14+
15+; Functions
16+
17+(decorator) @function.builtin
18+
19+(functionCall) @function
20+
21+(functionCall
22+ (functionArgument
23+ (variableAccess) @variable))
24+
25+; Literals/Types
26+
27+[
28+ "("
29+ ")"
30+ "["
31+ "]"
32+ "{"
33+ "}"
34+] @punctuation.bracket
35+
36+(resourceDeclaration
37+ (string
38+ (stringLiteral) @string.special))
39+
40+(moduleDeclaration
41+ (string
42+ (stringLiteral) @string.special))
43+
44+[
45+ (string)
46+ (stringLiteral)
47+] @string
48+
49+(nullLiteral) @keyword
50+(booleanLiteral) @constant.builtin.boolean
51+(integerLiteral) @constant.numeric.integer
52+(comment) @comment
53+
54+(string
55+ (variableAccess
56+ (identifier) @variable))
57+
58+(type) @type
59+
60+; Variables
61+
62+(localVariable) @variable
63+
64+; Statements
65+
66+(object
67+ (objectProperty
68+ (identifier) @identifier))
69+
70+(propertyAccess
71+ (identifier) @identifier)
72+
73+(ifCondition) @keyword.control.conditional