mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
refactor(queries): Remove quotes from properties in set! directive
This commit is contained in:
parent
88aa09e6e9
commit
51bba660a8
45 changed files with 95 additions and 95 deletions
|
|
@ -287,7 +287,7 @@ A conceal can be restricted to part of the capture via the [`#offset!` directive
|
||||||
#### Priority
|
#### Priority
|
||||||
|
|
||||||
Captures can be assigned a priority to control precedence of highlights via the
|
Captures can be assigned a priority to control precedence of highlights via the
|
||||||
`#set! "priority" <number>` directive (see `:h treesitter-highlight-priority`).
|
`#set! priority <number>` directive (see `:h treesitter-highlight-priority`).
|
||||||
The default priority for treesitter highlights is `100`; queries should only
|
The default priority for treesitter highlights is `100`; queries should only
|
||||||
set priorities between `90` and `120`, to avoid conflict with other sources of
|
set priorities between `90` and `120`, to avoid conflict with other sources of
|
||||||
highlighting (such as diagnostics or LSP semantic tokens).
|
highlighting (such as diagnostics or LSP semantic tokens).
|
||||||
|
|
@ -336,7 +336,7 @@ doSomething(); // Should point to the declaration as the definition
|
||||||
```query
|
```query
|
||||||
(function_declaration
|
(function_declaration
|
||||||
((identifier) @local.definition.var)
|
((identifier) @local.definition.var)
|
||||||
(#set! "definition.var.scope" "parent"))
|
(#set! definition.var.scope "parent"))
|
||||||
```
|
```
|
||||||
|
|
||||||
Possible scope values are:
|
Possible scope values are:
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
; Lower priority to prefer @variable.parameter when identifier appears in parameter_declaration.
|
; Lower priority to prefer @variable.parameter when identifier appears in parameter_declaration.
|
||||||
((identifier) @variable
|
((identifier) @variable
|
||||||
(#set! "priority" 95))
|
(#set! priority 95))
|
||||||
|
|
||||||
(preproc_def
|
(preproc_def
|
||||||
(preproc_arg) @variable)
|
(preproc_arg) @variable)
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
; have multiple highlight groups applied to them.
|
; have multiple highlight groups applied to them.
|
||||||
; >> Literals
|
; >> Literals
|
||||||
((dis_expr) @comment
|
((dis_expr) @comment
|
||||||
(#set! "priority" 105)
|
(#set! priority 105)
|
||||||
; Higher priority to mark the whole sexpr as a comment
|
; Higher priority to mark the whole sexpr as a comment
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
(module_def
|
(module_def
|
||||||
(module_declaration
|
(module_declaration
|
||||||
(module_fqn) @local.definition.namespace)
|
(module_fqn) @local.definition.namespace)
|
||||||
(#set! "definition.namespace.scope" "global"))
|
(#set! definition.namespace.scope "global"))
|
||||||
|
|
||||||
(enum_declaration
|
(enum_declaration
|
||||||
(enum_member
|
(enum_member
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
(raw_block)
|
(raw_block)
|
||||||
(frontmatter)
|
(frontmatter)
|
||||||
] @markup.raw.block
|
] @markup.raw.block
|
||||||
(#set! "priority" 90))
|
(#set! priority 90))
|
||||||
|
|
||||||
; Remove @markup.raw for code with a language spec
|
; Remove @markup.raw for code with a language spec
|
||||||
(code_block
|
(code_block
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
(code_block_marker_begin)
|
(code_block_marker_begin)
|
||||||
(language)
|
(language)
|
||||||
(code) @none
|
(code) @none
|
||||||
(#set! "priority" 90))
|
(#set! priority 90))
|
||||||
|
|
||||||
[
|
[
|
||||||
(code_block_marker_begin)
|
(code_block_marker_begin)
|
||||||
|
|
@ -204,12 +204,12 @@
|
||||||
(#set! conceal ""))
|
(#set! conceal ""))
|
||||||
|
|
||||||
((math) @markup.math
|
((math) @markup.math
|
||||||
(#set! "priority" 90))
|
(#set! priority 90))
|
||||||
|
|
||||||
(verbatim) @markup.raw
|
(verbatim) @markup.raw
|
||||||
|
|
||||||
((raw_inline) @markup.raw
|
((raw_inline) @markup.raw
|
||||||
(#set! "priority" 90))
|
(#set! priority 90))
|
||||||
|
|
||||||
(comment
|
(comment
|
||||||
"%" @comment
|
"%" @comment
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@
|
||||||
|
|
||||||
((heredoc_block
|
((heredoc_block
|
||||||
(heredoc_line) @string)
|
(heredoc_line) @string)
|
||||||
(#set! "priority" 90))
|
(#set! priority 90))
|
||||||
|
|
||||||
(expansion
|
(expansion
|
||||||
[
|
[
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
((tag_name) @keyword
|
((tag_name) @keyword
|
||||||
(#set! "priority" 105))
|
(#set! priority 105))
|
||||||
|
|
||||||
[
|
[
|
||||||
"@code"
|
"@code"
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@
|
||||||
(ExternalID
|
(ExternalID
|
||||||
(SystemLiteral
|
(SystemLiteral
|
||||||
(URI) @string.special.url))
|
(URI) @string.special.url))
|
||||||
(#set! "priority" 105))
|
(#set! priority 105))
|
||||||
|
|
||||||
; Attlist declaration
|
; Attlist declaration
|
||||||
(AttlistDecl
|
(AttlistDecl
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
((atom) @constant
|
((atom) @constant
|
||||||
(#set! "priority" "90"))
|
(#set! priority "90"))
|
||||||
|
|
||||||
(var) @variable
|
(var) @variable
|
||||||
|
|
||||||
|
|
@ -86,15 +86,15 @@
|
||||||
|
|
||||||
; Macros
|
; Macros
|
||||||
((macro_call_expr) @constant.macro
|
((macro_call_expr) @constant.macro
|
||||||
(#set! "priority" 101))
|
(#set! priority 101))
|
||||||
|
|
||||||
; Preprocessor
|
; Preprocessor
|
||||||
(pp_define
|
(pp_define
|
||||||
lhs: _ @constant.macro
|
lhs: _ @constant.macro
|
||||||
(#set! "priority" 101))
|
(#set! priority 101))
|
||||||
|
|
||||||
(_preprocessor_directive) @keyword.directive
|
(_preprocessor_directive) @keyword.directive
|
||||||
(#set! "priority" 99)
|
(#set! priority 99)
|
||||||
|
|
||||||
; Attributes
|
; Attributes
|
||||||
(pp_include) @keyword.import
|
(pp_include) @keyword.import
|
||||||
|
|
@ -108,7 +108,7 @@
|
||||||
(export_type_attribute
|
(export_type_attribute
|
||||||
types: (fa
|
types: (fa
|
||||||
fun: _ @type
|
fun: _ @type
|
||||||
(#set! "priority" 101)))
|
(#set! priority 101)))
|
||||||
|
|
||||||
(behaviour_attribute) @keyword.import
|
(behaviour_attribute) @keyword.import
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@
|
||||||
] @variable.member
|
] @variable.member
|
||||||
|
|
||||||
((field_id) @variable.member
|
((field_id) @variable.member
|
||||||
(#set! "priority" 105))
|
(#set! priority 105))
|
||||||
|
|
||||||
(port
|
(port
|
||||||
(identifier) @variable.member)
|
(identifier) @variable.member)
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@
|
||||||
; Function Definition
|
; Function Definition
|
||||||
((function_definition
|
((function_definition
|
||||||
(name) @local.definition.function)
|
(name) @local.definition.function)
|
||||||
(#set! "definition.function.scope" "parent"))
|
(#set! definition.function.scope "parent"))
|
||||||
|
|
||||||
; Lambda
|
; Lambda
|
||||||
; lambda names are not accessible and are only for debugging.
|
; lambda names are not accessible and are only for debugging.
|
||||||
|
|
@ -74,7 +74,7 @@
|
||||||
; Class
|
; Class
|
||||||
((class_definition
|
((class_definition
|
||||||
(name) @local.definition.type)
|
(name) @local.definition.type)
|
||||||
(#set! "definition.type.scope" "parent"))
|
(#set! definition.type.scope "parent"))
|
||||||
|
|
||||||
(class_definition
|
(class_definition
|
||||||
(body
|
(body
|
||||||
|
|
@ -102,7 +102,7 @@
|
||||||
(body
|
(body
|
||||||
(function_definition
|
(function_definition
|
||||||
(name) @local.definition.method)))
|
(name) @local.definition.method)))
|
||||||
(#set! "definition.method.scope" "parent"))
|
(#set! definition.method.scope "parent"))
|
||||||
|
|
||||||
; Enum
|
; Enum
|
||||||
(enum_definition
|
(enum_definition
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
|
|
||||||
((scoped_type_identifier
|
((scoped_type_identifier
|
||||||
path: (_) @module)
|
path: (_) @module)
|
||||||
(#set! "priority" 105))
|
(#set! priority 105))
|
||||||
|
|
||||||
; Keywords
|
; Keywords
|
||||||
[
|
[
|
||||||
|
|
@ -93,7 +93,7 @@
|
||||||
|
|
||||||
; Labels
|
; Labels
|
||||||
((label) @label
|
((label) @label
|
||||||
(#set! "priority" 105))
|
(#set! priority 105))
|
||||||
|
|
||||||
; Functions
|
; Functions
|
||||||
(function_declaration
|
(function_declaration
|
||||||
|
|
@ -144,7 +144,7 @@
|
||||||
((member_expression
|
((member_expression
|
||||||
"."
|
"."
|
||||||
(_) @variable.member)
|
(_) @variable.member)
|
||||||
(#set! "priority" 105))
|
(#set! priority 105))
|
||||||
|
|
||||||
(field
|
(field
|
||||||
.
|
.
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
((attribute
|
((attribute
|
||||||
(quoted_attribute_value) @string)
|
(quoted_attribute_value) @string)
|
||||||
(#set! "priority" 99))
|
(#set! priority 99))
|
||||||
|
|
||||||
(text) @none @spell
|
(text) @none @spell
|
||||||
|
|
||||||
|
|
@ -94,7 +94,7 @@
|
||||||
(quoted_attribute_value
|
(quoted_attribute_value
|
||||||
(attribute_value) @string.special.url))
|
(attribute_value) @string.special.url))
|
||||||
(#any-of? @_attr "href" "src")
|
(#any-of? @_attr "href" "src")
|
||||||
(#set! @string.special.url "url" @string.special.url))
|
(#set! @string.special.url url @string.special.url))
|
||||||
|
|
||||||
[
|
[
|
||||||
"<"
|
"<"
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
(field
|
(field
|
||||||
function: (fieldname
|
function: (fieldname
|
||||||
(id) @local.definition.function)
|
(id) @local.definition.function)
|
||||||
(#set! "definition.function.scope" "parent"))
|
(#set! definition.function.scope "parent"))
|
||||||
|
|
||||||
(bind
|
(bind
|
||||||
(id) @local.definition.var)
|
(id) @local.definition.var)
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@
|
||||||
; Fallback highlighting for recipe bodies
|
; Fallback highlighting for recipe bodies
|
||||||
(recipe
|
(recipe
|
||||||
(recipe_body) @string
|
(recipe_body) @string
|
||||||
(#set! "priority" 90))
|
(#set! priority 90))
|
||||||
|
|
||||||
; Ref: https://just.systems/man/en/chapter_26.html
|
; Ref: https://just.systems/man/en/chapter_26.html
|
||||||
;(setting (identifier) @error)
|
;(setting (identifier) @error)
|
||||||
|
|
|
||||||
|
|
@ -58,13 +58,13 @@
|
||||||
|
|
||||||
(node
|
(node
|
||||||
(node_comment)
|
(node_comment)
|
||||||
(#set! "priority" 105)) @comment
|
(#set! priority 105)) @comment
|
||||||
|
|
||||||
(node
|
(node
|
||||||
(node_field
|
(node_field
|
||||||
(node_field_comment)
|
(node_field_comment)
|
||||||
(#set! "priority" 105)) @comment)
|
(#set! priority 105)) @comment)
|
||||||
|
|
||||||
(node_children
|
(node_children
|
||||||
(node_children_comment)
|
(node_children_comment)
|
||||||
(#set! "priority" 105)) @comment
|
(#set! priority 105)) @comment
|
||||||
|
|
|
||||||
|
|
@ -13,13 +13,13 @@
|
||||||
(function_declaration
|
(function_declaration
|
||||||
.
|
.
|
||||||
(simple_identifier) @local.definition.function
|
(simple_identifier) @local.definition.function
|
||||||
(#set! "definition.function.scope" "parent"))
|
(#set! definition.function.scope "parent"))
|
||||||
|
|
||||||
(class_body
|
(class_body
|
||||||
(function_declaration
|
(function_declaration
|
||||||
.
|
.
|
||||||
(simple_identifier) @local.definition.method)
|
(simple_identifier) @local.definition.method)
|
||||||
(#set! "definition.method.scope" "parent"))
|
(#set! definition.method.scope "parent"))
|
||||||
|
|
||||||
; Variables
|
; Variables
|
||||||
(function_declaration
|
(function_declaration
|
||||||
|
|
@ -52,11 +52,11 @@
|
||||||
; Types
|
; Types
|
||||||
(class_declaration
|
(class_declaration
|
||||||
(type_identifier) @local.definition.type
|
(type_identifier) @local.definition.type
|
||||||
(#set! "definition.type.scope" "parent"))
|
(#set! definition.type.scope "parent"))
|
||||||
|
|
||||||
(type_alias
|
(type_alias
|
||||||
(type_identifier) @local.definition.type
|
(type_identifier) @local.definition.type
|
||||||
(#set! "definition.type.scope" "parent"))
|
(#set! definition.type.scope "parent"))
|
||||||
|
|
||||||
; Scopes
|
; Scopes
|
||||||
[
|
[
|
||||||
|
|
|
||||||
|
|
@ -181,7 +181,7 @@
|
||||||
(address_literal)
|
(address_literal)
|
||||||
(signature_literal)
|
(signature_literal)
|
||||||
((affine_group_literal)
|
((affine_group_literal)
|
||||||
(#set! "priority" 101))
|
(#set! priority 101))
|
||||||
(field_literal)
|
(field_literal)
|
||||||
(product_group_literal)
|
(product_group_literal)
|
||||||
(scalar_literal)
|
(scalar_literal)
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,7 @@
|
||||||
"["
|
"["
|
||||||
"]"
|
"]"
|
||||||
] @type)
|
] @type)
|
||||||
(#set! "priority" 105))
|
(#set! priority 105))
|
||||||
|
|
||||||
(type) @type
|
(type) @type
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@
|
||||||
(indented_code_block) @markup.raw.block
|
(indented_code_block) @markup.raw.block
|
||||||
|
|
||||||
((fenced_code_block) @markup.raw.block
|
((fenced_code_block) @markup.raw.block
|
||||||
(#set! "priority" 90))
|
(#set! priority 90))
|
||||||
|
|
||||||
(fenced_code_block
|
(fenced_code_block
|
||||||
(fenced_code_block_delimiter) @markup.raw.block
|
(fenced_code_block_delimiter) @markup.raw.block
|
||||||
|
|
@ -103,13 +103,13 @@
|
||||||
(task_list_marker_checked) @markup.list.checked
|
(task_list_marker_checked) @markup.list.checked
|
||||||
|
|
||||||
((block_quote) @markup.quote
|
((block_quote) @markup.quote
|
||||||
(#set! "priority" 90))
|
(#set! priority 90))
|
||||||
|
|
||||||
([
|
([
|
||||||
(plus_metadata)
|
(plus_metadata)
|
||||||
(minus_metadata)
|
(minus_metadata)
|
||||||
] @keyword.directive
|
] @keyword.directive
|
||||||
(#set! "priority" 90))
|
(#set! priority 90))
|
||||||
|
|
||||||
[
|
[
|
||||||
(block_continuation)
|
(block_continuation)
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@
|
||||||
(inline_link
|
(inline_link
|
||||||
(link_text) @_label
|
(link_text) @_label
|
||||||
(link_destination) @_url
|
(link_destination) @_url
|
||||||
(#set! @_label "url" @_url))
|
(#set! @_label url @_url))
|
||||||
|
|
||||||
; Conceal image links
|
; Conceal image links
|
||||||
(image
|
(image
|
||||||
|
|
@ -89,11 +89,11 @@
|
||||||
] @markup.link.url @nospell
|
] @markup.link.url @nospell
|
||||||
|
|
||||||
((link_destination) @_url
|
((link_destination) @_url
|
||||||
(#set! @_url "url" @_url))
|
(#set! @_url url @_url))
|
||||||
|
|
||||||
((uri_autolink) @_url
|
((uri_autolink) @_url
|
||||||
(#offset! @_url 0 1 0 -1)
|
(#offset! @_url 0 1 0 -1)
|
||||||
(#set! @_url "url" @_url))
|
(#set! @_url url @_url))
|
||||||
|
|
||||||
(entity_reference) @nospell
|
(entity_reference) @nospell
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
; =============================================================================
|
; =============================================================================
|
||||||
; catch all rules
|
; catch all rules
|
||||||
((identifier) @variable
|
((identifier) @variable
|
||||||
(#set! "priority" 99))
|
(#set! priority 99))
|
||||||
|
|
||||||
; NOTE: we need priority, since (identifier) is most specific and we have to
|
; NOTE: we need priority, since (identifier) is most specific and we have to
|
||||||
; capture nodes containing (identifier) as a whole, while overruling the
|
; capture nodes containing (identifier) as a whole, while overruling the
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
(type_expression) @type
|
(type_expression) @type
|
||||||
|
|
||||||
; NOTE: has to be after
|
; NOTE: has to be after
|
||||||
; ((identifier) @variable (#set! "priority" 99))
|
; ((identifier) @variable (#set! priority 99))
|
||||||
; overrule identifiers in pragmas in (proc_type)s and (pragma_expression)s
|
; overrule identifiers in pragmas in (proc_type)s and (pragma_expression)s
|
||||||
(proc_type
|
(proc_type
|
||||||
pragmas: (pragma_list) @variable)
|
pragmas: (pragma_list) @variable)
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
(exported_symbol
|
(exported_symbol
|
||||||
(accent_quoted) @local.definition.function)
|
(accent_quoted) @local.definition.function)
|
||||||
]
|
]
|
||||||
(#set! "definition.function.scope" "parent"))
|
(#set! definition.function.scope "parent"))
|
||||||
|
|
||||||
(func_declaration
|
(func_declaration
|
||||||
name: [
|
name: [
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
(exported_symbol
|
(exported_symbol
|
||||||
(accent_quoted) @local.definition.function)
|
(accent_quoted) @local.definition.function)
|
||||||
]
|
]
|
||||||
(#set! "definition.function.scope" "parent"))
|
(#set! definition.function.scope "parent"))
|
||||||
|
|
||||||
(iterator_declaration
|
(iterator_declaration
|
||||||
name: [
|
name: [
|
||||||
|
|
@ -55,7 +55,7 @@
|
||||||
(exported_symbol
|
(exported_symbol
|
||||||
(accent_quoted) @local.definition.function)
|
(accent_quoted) @local.definition.function)
|
||||||
]
|
]
|
||||||
(#set! "definition.function.scope" "parent"))
|
(#set! definition.function.scope "parent"))
|
||||||
|
|
||||||
(converter_declaration
|
(converter_declaration
|
||||||
name: [
|
name: [
|
||||||
|
|
@ -66,7 +66,7 @@
|
||||||
(exported_symbol
|
(exported_symbol
|
||||||
(accent_quoted) @local.definition.function)
|
(accent_quoted) @local.definition.function)
|
||||||
]
|
]
|
||||||
(#set! "definition.function.scope" "parent"))
|
(#set! definition.function.scope "parent"))
|
||||||
|
|
||||||
; ==============================================================================
|
; ==============================================================================
|
||||||
; @local.definition.method ; methods
|
; @local.definition.method ; methods
|
||||||
|
|
@ -79,7 +79,7 @@
|
||||||
(exported_symbol
|
(exported_symbol
|
||||||
(accent_quoted) @local.definition.method)
|
(accent_quoted) @local.definition.method)
|
||||||
]
|
]
|
||||||
(#set! "definition.method.scope" "parent"))
|
(#set! definition.method.scope "parent"))
|
||||||
|
|
||||||
; ==============================================================================
|
; ==============================================================================
|
||||||
; @local.definition.var ; variables
|
; @local.definition.var ; variables
|
||||||
|
|
@ -193,7 +193,7 @@
|
||||||
(exported_symbol
|
(exported_symbol
|
||||||
(accent_quoted) @local.definition.macro)
|
(accent_quoted) @local.definition.macro)
|
||||||
]
|
]
|
||||||
(#set! "definition.macro.scope" "parent"))
|
(#set! definition.macro.scope "parent"))
|
||||||
|
|
||||||
(macro_declaration
|
(macro_declaration
|
||||||
name: [
|
name: [
|
||||||
|
|
@ -204,7 +204,7 @@
|
||||||
(exported_symbol
|
(exported_symbol
|
||||||
(accent_quoted) @local.definition.macro)
|
(accent_quoted) @local.definition.macro)
|
||||||
]
|
]
|
||||||
(#set! "definition.macro.scope" "parent"))
|
(#set! definition.macro.scope "parent"))
|
||||||
|
|
||||||
; ==============================================================================
|
; ==============================================================================
|
||||||
; @local.definition.type ; types or classes
|
; @local.definition.type ; types or classes
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@
|
||||||
;----------
|
;----------
|
||||||
; Don't let normal parens take priority over this
|
; Don't let normal parens take priority over this
|
||||||
((unit) @constant.builtin
|
((unit) @constant.builtin
|
||||||
(#set! "priority" 105))
|
(#set! priority 105))
|
||||||
|
|
||||||
(boolean) @boolean
|
(boolean) @boolean
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@
|
||||||
"else"
|
"else"
|
||||||
"when"
|
"when"
|
||||||
] @keyword.conditional.ternary)
|
] @keyword.conditional.ternary)
|
||||||
(#set! "priority" 105))
|
(#set! priority 105))
|
||||||
|
|
||||||
; Repeats
|
; Repeats
|
||||||
[
|
[
|
||||||
|
|
|
||||||
|
|
@ -270,4 +270,4 @@
|
||||||
")"
|
")"
|
||||||
] @punctuation.bracket
|
] @punctuation.bracket
|
||||||
; priority hack so nvim + ts-cli behave the same
|
; priority hack so nvim + ts-cli behave the same
|
||||||
(#set! "priority" 90))
|
(#set! priority 90))
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
((command_paragraph
|
((command_paragraph
|
||||||
(command) @keyword
|
(command) @keyword
|
||||||
(content) @string)
|
(content) @string)
|
||||||
(#set! "priority" 99))
|
(#set! priority 99))
|
||||||
|
|
||||||
(command_paragraph
|
(command_paragraph
|
||||||
(command) @keyword
|
(command) @keyword
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@
|
||||||
|
|
||||||
((ffi_method
|
((ffi_method
|
||||||
(string) @string.special)
|
(string) @string.special)
|
||||||
(#set! "priority" 105))
|
(#set! priority 105))
|
||||||
|
|
||||||
(call_expression
|
(call_expression
|
||||||
callee: [
|
callee: [
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@
|
||||||
; Decorators
|
; Decorators
|
||||||
((decorator
|
((decorator
|
||||||
"@" @attribute)
|
"@" @attribute)
|
||||||
(#set! "priority" 101))
|
(#set! priority 101))
|
||||||
|
|
||||||
(decorator
|
(decorator
|
||||||
(identifier) @attribute)
|
(identifier) @attribute)
|
||||||
|
|
|
||||||
|
|
@ -674,12 +674,12 @@
|
||||||
.
|
.
|
||||||
(symbol) @keyword.import
|
(symbol) @keyword.import
|
||||||
(#eq? @keyword.import "require")
|
(#eq? @keyword.import "require")
|
||||||
(#set! "priority" 101))
|
(#set! priority 101))
|
||||||
|
|
||||||
(quote
|
(quote
|
||||||
.
|
.
|
||||||
(symbol)
|
(symbol)
|
||||||
(#set! "priority" 105)) @string.special.symbol
|
(#set! priority 105)) @string.special.symbol
|
||||||
|
|
||||||
((sexp_comment) @comment
|
((sexp_comment) @comment
|
||||||
(#set! "priority" 110))
|
(#set! priority 110))
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
(comment)
|
(comment)
|
||||||
(directive)
|
(directive)
|
||||||
] @comment
|
] @comment
|
||||||
(#set! "priority" 105))
|
(#set! priority 105))
|
||||||
|
|
||||||
(escape_sequence) @string.escape
|
(escape_sequence) @string.escape
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@
|
||||||
|
|
||||||
(trait_statement
|
(trait_statement
|
||||||
(shape_id
|
(shape_id
|
||||||
(#set! "priority" 105)) @attribute)
|
(#set! priority 105)) @attribute)
|
||||||
|
|
||||||
; Operators
|
; Operators
|
||||||
[
|
[
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,11 @@
|
||||||
((sub_select
|
((sub_select
|
||||||
(select_clause
|
(select_clause
|
||||||
(var) @local.definition.var))
|
(var) @local.definition.var))
|
||||||
(#set! "definition.var.scope" "parent"))
|
(#set! definition.var.scope "parent"))
|
||||||
|
|
||||||
((select_query
|
((select_query
|
||||||
(select_clause
|
(select_clause
|
||||||
(var) @local.definition.var))
|
(var) @local.definition.var))
|
||||||
(#set! "definition.var.scope" "parent"))
|
(#set! definition.var.scope "parent"))
|
||||||
|
|
||||||
(var) @local.reference
|
(var) @local.reference
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@
|
||||||
"="
|
"="
|
||||||
":"
|
":"
|
||||||
])
|
])
|
||||||
(#set! "priority" 105))
|
(#set! priority 105))
|
||||||
|
|
||||||
; Types
|
; Types
|
||||||
((identifier) @type
|
((identifier) @type
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@
|
||||||
; Decorators
|
; Decorators
|
||||||
((decorator
|
((decorator
|
||||||
"@" @attribute)
|
"@" @attribute)
|
||||||
(#set! "priority" 101))
|
(#set! priority 101))
|
||||||
|
|
||||||
(decorator
|
(decorator
|
||||||
(identifier) @attribute)
|
(identifier) @attribute)
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
; Definitions
|
; Definitions
|
||||||
(argument
|
(argument
|
||||||
name: (identifier) @local.definition.parameter
|
name: (identifier) @local.definition.parameter
|
||||||
(#set! "definition.var.scope" "local"))
|
(#set! definition.var.scope "local"))
|
||||||
|
|
||||||
(variable_definition
|
(variable_definition
|
||||||
name: (variable
|
name: (variable
|
||||||
|
|
@ -20,10 +20,10 @@
|
||||||
name: (variable
|
name: (variable
|
||||||
(environment_var
|
(environment_var
|
||||||
(identifier) @local.definition.var))
|
(identifier) @local.definition.var))
|
||||||
(#set! "definition.var.scope" "global"))
|
(#set! definition.var.scope "global"))
|
||||||
|
|
||||||
(function_definition
|
(function_definition
|
||||||
name: (variable) @local.definition.var
|
name: (variable) @local.definition.var
|
||||||
(#set! "definition.var.scope" "parent"))
|
(#set! definition.var.scope "parent"))
|
||||||
|
|
||||||
(identifier) @local.reference
|
(identifier) @local.reference
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@
|
||||||
(bang_operator)
|
(bang_operator)
|
||||||
(cond_operator)
|
(cond_operator)
|
||||||
] @function
|
] @function
|
||||||
(#set! "priority" 105))
|
(#set! priority 105))
|
||||||
|
|
||||||
; Operators
|
; Operators
|
||||||
[
|
[
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,8 @@
|
||||||
(expr)
|
(expr)
|
||||||
(arguments)
|
(arguments)
|
||||||
] @indent.align
|
] @indent.align
|
||||||
(#set! "indent.open_delimiter" "{")
|
(#set! indent.open_delimiter "{")
|
||||||
(#set! "indent.close_delimiter" "}"))
|
(#set! indent.close_delimiter "}"))
|
||||||
|
|
||||||
[
|
[
|
||||||
"}"
|
"}"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
; Variables
|
; Variables
|
||||||
((identifier) @variable
|
((identifier) @variable
|
||||||
(#set! "priority" 95))
|
(#set! priority 95))
|
||||||
|
|
||||||
; Includes
|
; Includes
|
||||||
[
|
[
|
||||||
|
|
|
||||||
|
|
@ -14,22 +14,22 @@
|
||||||
; Definitions {{{
|
; Definitions {{{
|
||||||
(type_declaration
|
(type_declaration
|
||||||
name: (identifier) @local.definition.type
|
name: (identifier) @local.definition.type
|
||||||
(#set! "definition.var.scope" "parent"))
|
(#set! definition.var.scope "parent"))
|
||||||
|
|
||||||
(parameters
|
(parameters
|
||||||
name: (identifier) @local.definition.parameter)
|
name: (identifier) @local.definition.parameter)
|
||||||
|
|
||||||
(function_declaration
|
(function_declaration
|
||||||
name: (identifier) @local.definition.function
|
name: (identifier) @local.definition.function
|
||||||
(#set! "definition.var.scope" "parent"))
|
(#set! definition.var.scope "parent"))
|
||||||
|
|
||||||
(primitive_declaration
|
(primitive_declaration
|
||||||
name: (identifier) @local.definition.function
|
name: (identifier) @local.definition.function
|
||||||
(#set! "definition.var.scope" "parent"))
|
(#set! definition.var.scope "parent"))
|
||||||
|
|
||||||
(variable_declaration
|
(variable_declaration
|
||||||
name: (identifier) @local.definition.var
|
name: (identifier) @local.definition.var
|
||||||
(#set! "definition.var.scope" "parent"))
|
(#set! definition.var.scope "parent"))
|
||||||
|
|
||||||
; }}}
|
; }}}
|
||||||
; References {{{
|
; References {{{
|
||||||
|
|
|
||||||
|
|
@ -30,14 +30,14 @@
|
||||||
|
|
||||||
(function_definition
|
(function_definition
|
||||||
name: (identifier) @local.definition.function
|
name: (identifier) @local.definition.function
|
||||||
(#set! "definition.function.scope" "parent"))
|
(#set! definition.function.scope "parent"))
|
||||||
|
|
||||||
(lambda
|
(lambda
|
||||||
(identifier) @local.definition.parameter)
|
(identifier) @local.definition.parameter)
|
||||||
|
|
||||||
(module_definition
|
(module_definition
|
||||||
name: (_) @local.definition.import
|
name: (_) @local.definition.import
|
||||||
(#set! "definition.import.scope" "parent"))
|
(#set! definition.import.scope "parent"))
|
||||||
|
|
||||||
(module_definition
|
(module_definition
|
||||||
parameter: (identifier) @local.definition.parameter)
|
parameter: (identifier) @local.definition.parameter)
|
||||||
|
|
@ -48,7 +48,7 @@
|
||||||
|
|
||||||
(operator_definition
|
(operator_definition
|
||||||
name: (_) @local.definition.macro
|
name: (_) @local.definition.macro
|
||||||
(#set! "definition.macro.scope" "parent"))
|
(#set! definition.macro.scope "parent"))
|
||||||
|
|
||||||
(operator_definition
|
(operator_definition
|
||||||
parameter: (identifier) @local.definition.parameter)
|
parameter: (identifier) @local.definition.parameter)
|
||||||
|
|
@ -97,7 +97,7 @@
|
||||||
|
|
||||||
(theorem
|
(theorem
|
||||||
name: (identifier) @local.definition.constant
|
name: (identifier) @local.definition.constant
|
||||||
(#set! "definition.constant.scope" "parent"))
|
(#set! definition.constant.scope "parent"))
|
||||||
|
|
||||||
; PlusCal scopes and definitions
|
; PlusCal scopes and definitions
|
||||||
[
|
[
|
||||||
|
|
|
||||||
|
|
@ -10,12 +10,12 @@
|
||||||
((fmt_sub
|
((fmt_sub
|
||||||
.
|
.
|
||||||
_ @character.special)
|
_ @character.special)
|
||||||
(#set! "priority" 101))
|
(#set! priority 101))
|
||||||
|
|
||||||
((var_sub
|
((var_sub
|
||||||
.
|
.
|
||||||
_ @variable.builtin)
|
_ @variable.builtin)
|
||||||
(#set! "priority" 101))
|
(#set! priority 101))
|
||||||
|
|
||||||
[
|
[
|
||||||
(system_const)
|
(system_const)
|
||||||
|
|
@ -26,24 +26,24 @@
|
||||||
] @attribute
|
] @attribute
|
||||||
|
|
||||||
((attribute) @attribute
|
((attribute) @attribute
|
||||||
(#set! "priority" 101))
|
(#set! priority 101))
|
||||||
|
|
||||||
((env_var) @constant
|
((env_var) @constant
|
||||||
(#set! "priority" 101))
|
(#set! priority 101))
|
||||||
|
|
||||||
((pattern) @string.special
|
((pattern) @string.special
|
||||||
(#set! "priority" 101))
|
(#set! priority 101))
|
||||||
|
|
||||||
([
|
([
|
||||||
"\\\""
|
"\\\""
|
||||||
(c_escape)
|
(c_escape)
|
||||||
] @string.escape
|
] @string.escape
|
||||||
(#set! "priority" 101))
|
(#set! priority 101))
|
||||||
|
|
||||||
(octal) @number
|
(octal) @number
|
||||||
|
|
||||||
((number) @number
|
((number) @number
|
||||||
(#set! "priority" 101))
|
(#set! priority 101))
|
||||||
|
|
||||||
[
|
[
|
||||||
(match_op)
|
(match_op)
|
||||||
|
|
@ -51,13 +51,13 @@
|
||||||
] @operator
|
] @operator
|
||||||
|
|
||||||
("+" @punctuation.special
|
("+" @punctuation.special
|
||||||
(#set! "priority" 101))
|
(#set! priority 101))
|
||||||
|
|
||||||
([
|
([
|
||||||
"{"
|
"{"
|
||||||
"}"
|
"}"
|
||||||
] @punctuation.bracket
|
] @punctuation.bracket
|
||||||
(#set! "priority" 101))
|
(#set! priority 101))
|
||||||
|
|
||||||
[
|
[
|
||||||
","
|
","
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
text: (_) @markup.raw)
|
text: (_) @markup.raw)
|
||||||
|
|
||||||
((codeblock) @markup.raw.block
|
((codeblock) @markup.raw.block
|
||||||
(#set! "priority" 90))
|
(#set! priority 90))
|
||||||
|
|
||||||
(codeblock
|
(codeblock
|
||||||
">" @markup.raw
|
">" @markup.raw
|
||||||
|
|
@ -60,7 +60,7 @@
|
||||||
(keycode) @string.special
|
(keycode) @string.special
|
||||||
|
|
||||||
((url) @string.special.url
|
((url) @string.special.url
|
||||||
(#set! @string.special.url "url" @string.special.url))
|
(#set! @string.special.url url @string.special.url))
|
||||||
|
|
||||||
(modeline) @keyword.directive
|
(modeline) @keyword.directive
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
(CDStart) @module
|
(CDStart) @module
|
||||||
(CData) @markup.raw
|
(CData) @markup.raw
|
||||||
"]]>" @module)
|
"]]>" @module)
|
||||||
(#set! "priority" 105))
|
(#set! priority 105))
|
||||||
|
|
||||||
; Delimiters & punctuation
|
; Delimiters & punctuation
|
||||||
[
|
[
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
(single_quote_scalar) @string
|
(single_quote_scalar) @string
|
||||||
|
|
||||||
((block_scalar) @string
|
((block_scalar) @string
|
||||||
(#set! "priority" 99))
|
(#set! priority 99))
|
||||||
|
|
||||||
(string_scalar) @string
|
(string_scalar) @string
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue