Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'runtime/queries/bicep/highlights.scm')
| -rw-r--r-- | runtime/queries/bicep/highlights.scm | 255 |
1 files changed, 48 insertions, 207 deletions
diff --git a/runtime/queries/bicep/highlights.scm b/runtime/queries/bicep/highlights.scm index b80de7fd..b6f92872 100644 --- a/runtime/queries/bicep/highlights.scm +++ b/runtime/queries/bicep/highlights.scm @@ -1,232 +1,73 @@ -; Includes -[ - "import" - "provider" - "with" - "as" - "from" -] @keyword.control.import - -; Namespaces -(module_declaration - (identifier) @namespace) - -; Builtins -(primitive_type) @type.builtin - -((member_expression - object: (identifier) @type.builtin) - (#eq? @type.builtin "sys")) - -; Functions -(call_expression - function: (identifier) @function) - -(user_defined_function - name: (identifier) @function) - -; Properties -(object_property - (identifier) @function.method - ":" @punctuation.delimiter - (_)) - -(object_property - (compatible_identifier) @function.method - ":" @punctuation.delimiter - (_)) - -(property_identifier) @function.method - -; Attributes -(decorator - "@" @attribute) - -(decorator - (call_expression - (identifier) @attribute)) - -(decorator - (call_expression - (member_expression - object: (identifier) @attribute - property: (property_identifier) @attribute))) - -; Types -(type_declaration - (identifier) @type) - -(type_declaration - (identifier) - "=" - (identifier) @type) - -(type - (identifier) @type) - -(resource_declaration - (identifier) @type) - -(resource_expression - (identifier) @type) - -; Parameters -(parameter_declaration - (identifier) @variable.parameter - (_)) - -(call_expression - function: (_) - (arguments - (identifier) @variable.parameter)) - -(call_expression - function: (_) - (arguments - (member_expression - object: (identifier) @variable.parameter))) - -(parameter - . - (identifier) @variable.parameter) - -; Variables -(variable_declaration - (identifier) @variable - (_)) - -(metadata_declaration - (identifier) @variable - (_)) - -(output_declaration - (identifier) @variable - (_)) - -(object_property - (_) - ":" - (identifier) @variable) - -(for_statement - "for" - (for_loop_parameters - (loop_variable) @variable - (loop_enumerator) @variable)) - -; Conditionals -"if" @keyword.conditional - -(ternary_expression - "?" @keyword.control.conditional - ":" @keyword.control.conditional) - -; Loops -(for_statement - "for" @keyword.control.repeat - "in" - ":" @punctuation.delimiter) - ; Keywords + [ "module" - "metadata" - "output" + "var" "param" + "import" "resource" "existing" + "if" "targetScope" - "type" - "var" - "using" - "test" + "output" ] @keyword -"func" @keyword.function - -"assert" @keyword.control.exception - -; Operators -[ - "+" - "-" - "*" - "/" - "%" - "||" - "&&" - "|" - "==" - "!=" - "=~" - "!~" - ">" - ">=" - "<=" - "<" - "??" - "=" - "!" - ".?" -] @operator - -(subscript_expression - "?" @operator) - -(nullable_type - "?" @operator) - -"in" @keyword.operator - -; Literals -(string) @string - -(escape_sequence) @constant.character - -(number) @constant.number +; Functions -(boolean) @constant.builtin.boolean +(decorator) @function.builtin -(null) @constant.builtin +(functionCall) @function -; Misc -(compatible_identifier - "?" @punctuation.special) +(functionCall + (functionArgument + (variableAccess) @variable)) -(nullable_return_type) @punctuation.special +; Literals/Types [ + "(" + ")" + "[" + "]" "{" "}" ] @punctuation.bracket -[ - "[" - "]" -] @punctuation.bracket +(resourceDeclaration + (string + (stringLiteral) @string.special)) -[ - "(" - ")" -] @punctuation.bracket +(moduleDeclaration + (string + (stringLiteral) @string.special)) [ - "." - ":" - "::" - "=>" -] @punctuation.delimiter + (string) + (stringLiteral) +] @string -; Interpolation -(interpolation - "${" @punctuation.special - "}" @punctuation.special) +(nullLiteral) @keyword +(booleanLiteral) @constant.builtin.boolean +(integerLiteral) @constant.numeric.integer +(comment) @comment -(interpolation - (identifier) @variable) +(string + (variableAccess + (identifier) @variable)) -; Comments -[ - (comment) - (diagnostic_comment) -] @comment +(type) @type + +; Variables + +(localVariable) @variable + +; Statements + +(object + (objectProperty + (identifier) @identifier)) + +(propertyAccess + (identifier) @identifier) + +(ifCondition) @keyword.control.conditional |