mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-05 21:10:15 -04:00
feat!: drop modules, general refactor and cleanup
This commit is contained in:
parent
c13e28f894
commit
2c8f2f2fad
829 changed files with 4905 additions and 8010 deletions
25
runtime/queries/bicep/folds.scm
Normal file
25
runtime/queries/bicep/folds.scm
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
[
|
||||
(module_declaration)
|
||||
(metadata_declaration)
|
||||
(output_declaration)
|
||||
(parameter_declaration)
|
||||
(resource_declaration)
|
||||
(type_declaration)
|
||||
(variable_declaration)
|
||||
|
||||
(parenthesized_expression)
|
||||
|
||||
(decorators)
|
||||
(array)
|
||||
(object)
|
||||
|
||||
(if_statement)
|
||||
(for_statement)
|
||||
|
||||
(subscript_expression)
|
||||
(ternary_expression)
|
||||
|
||||
(string)
|
||||
|
||||
(comment)
|
||||
] @fold
|
||||
230
runtime/queries/bicep/highlights.scm
Normal file
230
runtime/queries/bicep/highlights.scm
Normal file
|
|
@ -0,0 +1,230 @@
|
|||
; Includes
|
||||
|
||||
(import_statement
|
||||
"import" @include)
|
||||
|
||||
(import_with_statement
|
||||
"import" @include
|
||||
"with" @include)
|
||||
|
||||
; 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.call)
|
||||
|
||||
; Properties
|
||||
|
||||
(object_property
|
||||
(identifier) @property
|
||||
":" @punctuation.delimiter
|
||||
(_))
|
||||
|
||||
(object_property
|
||||
(compatible_identifier) @property
|
||||
":" @punctuation.delimiter
|
||||
(_))
|
||||
|
||||
(property_identifier) @property
|
||||
|
||||
; 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_declaration
|
||||
(identifier)
|
||||
"="
|
||||
(array_type (identifier) @type))
|
||||
|
||||
(type
|
||||
(identifier) @type)
|
||||
|
||||
(resource_declaration
|
||||
(identifier) @type)
|
||||
|
||||
(resource_expression
|
||||
(identifier) @type)
|
||||
|
||||
; Parameters
|
||||
|
||||
(parameter_declaration
|
||||
(identifier) @parameter
|
||||
(_))
|
||||
|
||||
(call_expression
|
||||
function: (_)
|
||||
(arguments (identifier) @parameter))
|
||||
|
||||
(call_expression
|
||||
function: (_)
|
||||
(arguments (member_expression object: (identifier) @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" @conditional
|
||||
|
||||
(ternary_expression
|
||||
"?" @conditional.ternary
|
||||
":" @conditional.ternary)
|
||||
|
||||
; Loops
|
||||
|
||||
(for_statement
|
||||
"for" @repeat
|
||||
"in"
|
||||
":" @punctuation.delimiter)
|
||||
|
||||
; Keywords
|
||||
|
||||
[
|
||||
"module"
|
||||
"metadata"
|
||||
"output"
|
||||
"param"
|
||||
"resource"
|
||||
"existing"
|
||||
"targetScope"
|
||||
"type"
|
||||
"var"
|
||||
] @keyword
|
||||
|
||||
; Operators
|
||||
|
||||
[
|
||||
"+"
|
||||
"-"
|
||||
"*"
|
||||
"/"
|
||||
"%"
|
||||
"||"
|
||||
"&&"
|
||||
"|"
|
||||
"=="
|
||||
"!="
|
||||
"=~"
|
||||
"!~"
|
||||
">"
|
||||
">="
|
||||
"<="
|
||||
"<"
|
||||
"??"
|
||||
"="
|
||||
"!"
|
||||
] @operator
|
||||
|
||||
[
|
||||
"in"
|
||||
] @keyword.operator
|
||||
|
||||
|
||||
; Literals
|
||||
|
||||
(string) @string
|
||||
(import_string
|
||||
"'" @string
|
||||
(import_name) @namespace
|
||||
"@" @symbol
|
||||
(import_version) @string.special)
|
||||
|
||||
(escape_sequence) @string.escape
|
||||
|
||||
(number) @number
|
||||
|
||||
(boolean) @boolean
|
||||
|
||||
(null) @constant.builtin
|
||||
|
||||
; Misc
|
||||
|
||||
(compatible_identifier
|
||||
"?" @punctuation.special)
|
||||
|
||||
(nullable_return_type) @punctuation.special
|
||||
|
||||
["{" "}"] @punctuation.bracket
|
||||
|
||||
["[" "]"] @punctuation.bracket
|
||||
|
||||
["(" ")"] @punctuation.bracket
|
||||
|
||||
[
|
||||
"."
|
||||
"::"
|
||||
"=>"
|
||||
] @punctuation.delimiter
|
||||
|
||||
|
||||
; Interpolation
|
||||
|
||||
(interpolation) @none
|
||||
|
||||
(interpolation
|
||||
"${" @punctuation.special
|
||||
"}" @punctuation.special)
|
||||
|
||||
(interpolation
|
||||
(identifier) @variable)
|
||||
|
||||
; Comments
|
||||
|
||||
[
|
||||
(comment)
|
||||
(diagnostic_comment)
|
||||
] @comment @spell
|
||||
18
runtime/queries/bicep/indents.scm
Normal file
18
runtime/queries/bicep/indents.scm
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
[
|
||||
(array)
|
||||
(object)
|
||||
] @indent.begin
|
||||
|
||||
"}" @indent.end
|
||||
|
||||
[ "{" "}" ] @indent.branch
|
||||
|
||||
[ "[" "]" ] @indent.branch
|
||||
|
||||
[ "(" ")" ] @indent.branch
|
||||
|
||||
[
|
||||
(ERROR)
|
||||
(comment)
|
||||
(diagnostic_comment)
|
||||
] @indent.auto
|
||||
5
runtime/queries/bicep/injections.scm
Normal file
5
runtime/queries/bicep/injections.scm
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
([
|
||||
(comment)
|
||||
(diagnostic_comment)
|
||||
] @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
74
runtime/queries/bicep/locals.scm
Normal file
74
runtime/queries/bicep/locals.scm
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
; Scopes
|
||||
|
||||
[
|
||||
(infrastructure)
|
||||
(call_expression)
|
||||
|
||||
(lambda_expression)
|
||||
(subscript_expression)
|
||||
|
||||
(if_statement)
|
||||
(for_statement)
|
||||
|
||||
(array)
|
||||
(object)
|
||||
(interpolation)
|
||||
] @scope
|
||||
|
||||
; References
|
||||
|
||||
(property_identifier) @reference
|
||||
|
||||
(call_expression
|
||||
(identifier) @reference)
|
||||
|
||||
(object_property
|
||||
(_)
|
||||
":"
|
||||
(identifier) @reference)
|
||||
|
||||
(resource_expression
|
||||
(identifier) @reference)
|
||||
|
||||
; Definitions
|
||||
|
||||
(type) @definition.associated
|
||||
|
||||
(object_property
|
||||
(identifier) @definition.field
|
||||
(_))
|
||||
|
||||
(object_property
|
||||
(compatible_identifier) @definition.field
|
||||
(_))
|
||||
|
||||
(import_name) @definition.import
|
||||
|
||||
(module_declaration
|
||||
(identifier) @definition.namespace)
|
||||
|
||||
(parameter_declaration
|
||||
(identifier) @definition.parameter
|
||||
(_))
|
||||
|
||||
(type_declaration
|
||||
(identifier) @definition.type
|
||||
(_))
|
||||
|
||||
(variable_declaration
|
||||
(identifier) @definition.var
|
||||
(_))
|
||||
|
||||
(metadata_declaration
|
||||
(identifier) @definition.var
|
||||
(_))
|
||||
|
||||
(output_declaration
|
||||
(identifier) @definition.var
|
||||
(_))
|
||||
|
||||
(for_statement
|
||||
"for"
|
||||
(for_loop_parameters
|
||||
(loop_variable) @definition.var
|
||||
(loop_enumerator) @definition.var))
|
||||
Loading…
Add table
Add a link
Reference in a new issue