nvim-treesitter/runtime/queries/odin/locals.scm

64 lines
1 KiB
Scheme
Raw Normal View History

2023-05-11 03:56:12 -04:00
; Scopes
[
(block)
(declaration)
(statement)
] @local.scope
2023-05-11 03:56:12 -04:00
; References
(identifier) @local.reference
2023-05-11 03:56:12 -04:00
; Definitions
2024-01-06 15:05:50 +09:00
(package_declaration
(identifier) @local.definition.namespace)
2023-05-11 03:56:12 -04:00
2024-01-06 15:05:50 +09:00
(import_declaration
alias: (identifier) @local.definition.namespace)
2023-05-11 03:56:12 -04:00
2024-01-06 15:05:50 +09:00
(procedure_declaration
(identifier) @local.definition.function)
2023-05-11 03:56:12 -04:00
2024-01-06 15:05:50 +09:00
(struct_declaration
(identifier) @local.definition.type
"::")
2023-05-11 03:56:12 -04:00
2024-01-06 15:05:50 +09:00
(enum_declaration
(identifier) @local.definition.enum
"::")
2023-05-11 03:56:12 -04:00
2024-01-06 15:05:50 +09:00
(union_declaration
(identifier) @local.definition.type
"::")
2023-05-11 03:56:12 -04:00
(bit_field_declaration
(identifier) @local.definition.type
"::")
2024-01-06 15:05:50 +09:00
(variable_declaration
(identifier) @local.definition.var
":=")
2023-05-11 03:56:12 -04:00
2024-01-06 15:05:50 +09:00
(const_declaration
(identifier) @local.definition.constant
"::")
2023-05-11 03:56:12 -04:00
2024-01-06 15:05:50 +09:00
(const_type_declaration
(identifier) @local.definition.type
":")
2023-05-11 03:56:12 -04:00
2024-01-06 15:05:50 +09:00
(parameter
(identifier) @local.definition.parameter
":"?)
2023-05-11 03:56:12 -04:00
2024-01-06 15:05:50 +09:00
(default_parameter
(identifier) @local.definition.parameter
":=")
2023-05-11 03:56:12 -04:00
2024-01-06 15:05:50 +09:00
(field
(identifier) @local.definition.field
":")
2023-05-11 03:56:12 -04:00
2024-01-06 15:05:50 +09:00
(label_statement
(identifier) @local.definition
":")