2020-10-06 20:03:39 +02:00
|
|
|
; inherits: c
|
2024-02-19 00:00:07 +09:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Parameters
|
2020-08-15 09:24:24 -05:00
|
|
|
(variadic_parameter_declaration
|
2024-03-21 20:44:35 +09:00
|
|
|
declarator: (variadic_declarator
|
|
|
|
|
(identifier) @local.definition.parameter))
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2020-08-15 09:24:24 -05:00
|
|
|
(optional_parameter_declaration
|
2023-07-22 15:29:32 +02:00
|
|
|
declarator: (identifier) @local.definition.parameter)
|
2024-01-06 15:05:50 +09:00
|
|
|
|
|
|
|
|
; Class / struct definitions
|
2023-07-22 15:29:32 +02:00
|
|
|
(class_specifier) @local.scope
|
2020-05-23 21:23:05 +02:00
|
|
|
|
2020-07-04 19:06:53 +02:00
|
|
|
(reference_declarator
|
2023-07-22 15:29:32 +02:00
|
|
|
(identifier) @local.definition.var)
|
2020-05-23 21:23:05 +02:00
|
|
|
|
2020-07-20 08:07:14 +02:00
|
|
|
(variadic_declarator
|
2023-07-22 15:29:32 +02:00
|
|
|
(identifier) @local.definition.var)
|
2020-07-20 08:07:14 +02:00
|
|
|
|
2020-05-23 21:23:05 +02:00
|
|
|
(struct_specifier
|
2024-03-21 20:44:35 +09:00
|
|
|
name: (qualified_identifier
|
|
|
|
|
name: (type_identifier) @local.definition.type))
|
2020-05-23 21:23:05 +02:00
|
|
|
|
|
|
|
|
(class_specifier
|
2023-07-22 15:29:32 +02:00
|
|
|
name: (type_identifier) @local.definition.type)
|
2020-05-23 21:23:05 +02:00
|
|
|
|
2021-11-28 18:29:47 +01:00
|
|
|
(concept_definition
|
2023-07-22 15:29:32 +02:00
|
|
|
name: (identifier) @local.definition.type)
|
2021-11-28 18:29:47 +01:00
|
|
|
|
2020-05-23 21:23:05 +02:00
|
|
|
(class_specifier
|
2024-03-21 20:44:35 +09:00
|
|
|
name: (qualified_identifier
|
|
|
|
|
name: (type_identifier) @local.definition.type))
|
2020-05-23 21:23:05 +02:00
|
|
|
|
2020-07-11 01:47:05 +02:00
|
|
|
(alias_declaration
|
2023-07-22 15:29:32 +02:00
|
|
|
name: (type_identifier) @local.definition.type)
|
2020-07-11 01:47:05 +02:00
|
|
|
|
2020-07-18 19:25:06 +02:00
|
|
|
;template <typename T>
|
|
|
|
|
(type_parameter_declaration
|
2023-07-22 15:29:32 +02:00
|
|
|
(type_identifier) @local.definition.type)
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-07-22 15:29:32 +02:00
|
|
|
(template_declaration) @local.scope
|
2020-07-27 15:00:49 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Namespaces
|
2020-08-15 09:24:24 -05:00
|
|
|
(namespace_definition
|
2023-07-22 15:29:32 +02:00
|
|
|
name: (namespace_identifier) @local.definition.namespace
|
|
|
|
|
body: (_) @local.scope)
|
2023-03-26 13:32:22 -05:00
|
|
|
|
|
|
|
|
(namespace_definition
|
2023-07-22 15:29:32 +02:00
|
|
|
name: (nested_namespace_specifier) @local.definition.namespace
|
|
|
|
|
body: (_) @local.scope)
|
2020-07-11 00:10:17 +02:00
|
|
|
|
2023-07-22 15:29:32 +02:00
|
|
|
((namespace_identifier) @local.reference
|
2024-01-06 15:05:50 +09:00
|
|
|
(#set! reference.kind "namespace"))
|
2020-07-11 00:10:17 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Function definitions
|
2020-05-23 21:23:05 +02:00
|
|
|
(template_function
|
2023-07-22 15:29:32 +02:00
|
|
|
name: (identifier) @local.definition.function) @local.scope
|
2020-05-23 21:23:05 +02:00
|
|
|
|
|
|
|
|
(template_method
|
2023-07-22 15:29:32 +02:00
|
|
|
name: (field_identifier) @local.definition.method) @local.scope
|
2020-05-23 21:23:05 +02:00
|
|
|
|
2021-03-07 21:06:37 +01:00
|
|
|
(function_declarator
|
2024-03-21 20:44:35 +09:00
|
|
|
declarator: (qualified_identifier
|
|
|
|
|
name: (identifier) @local.definition.function)) @local.scope
|
2020-05-23 21:23:05 +02:00
|
|
|
|
|
|
|
|
(field_declaration
|
2024-03-21 20:44:35 +09:00
|
|
|
declarator: (function_declarator
|
|
|
|
|
(field_identifier) @local.definition.method))
|
2020-05-23 21:23:05 +02:00
|
|
|
|
2023-07-22 15:29:32 +02:00
|
|
|
(lambda_expression) @local.scope
|
2020-05-23 21:23:05 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Control structures
|
2020-05-23 21:23:05 +02:00
|
|
|
(try_statement
|
2023-07-22 15:29:32 +02:00
|
|
|
body: (_) @local.scope)
|
2020-05-23 21:23:05 +02:00
|
|
|
|
2023-07-22 15:29:32 +02:00
|
|
|
(catch_clause) @local.scope
|
2021-11-28 18:29:47 +01:00
|
|
|
|
2023-07-22 15:29:32 +02:00
|
|
|
(requires_expression) @local.scope
|