Include outline items for c/c++ functions returning pointers-to-pointers, references

Co-authored-by: Julia Risley <julia@zed.dev>
This commit is contained in:
Max Brunsfeld 2022-12-05 13:55:55 -08:00
parent f23f294b86
commit 855f17c378
2 changed files with 100 additions and 12 deletions

View File

@ -14,17 +14,57 @@
declarator: (_) @name) @item
(declaration
type: (_) @context
declarator: (function_declarator
declarator: (_) @name
parameters: (parameter_list
"(" @context
")" @context))) @item
(type_qualifier)? @context
type: (_)? @context
declarator: [
(function_declarator
declarator: (_) @name
parameters: (parameter_list
"(" @context
")" @context))
(pointer_declarator
"*" @context
declarator: (function_declarator
declarator: (_) @name
parameters: (parameter_list
"(" @context
")" @context)))
(pointer_declarator
"*" @context
declarator: (pointer_declarator
"*" @context
declarator: (function_declarator
declarator: (_) @name
parameters: (parameter_list
"(" @context
")" @context))))
]
) @item
(function_definition
type: (_) @context
declarator: (function_declarator
declarator: (_) @name
parameters: (parameter_list
"(" @context
")" @context))) @item
(type_qualifier)? @context
type: (_)? @context
declarator: [
(function_declarator
declarator: (_) @name
parameters: (parameter_list
"(" @context
")" @context))
(pointer_declarator
"*" @context
declarator: (function_declarator
declarator: (_) @name
parameters: (parameter_list
"(" @context
")" @context)))
(pointer_declarator
"*" @context
declarator: (pointer_declarator
"*" @context
declarator: (function_declarator
declarator: (_) @name
parameters: (parameter_list
"(" @context
")" @context))))
]
) @item

View File

@ -51,6 +51,22 @@
parameters: (parameter_list
"(" @context
")" @context)))
(pointer_declarator
"*" @context
declarator: (pointer_declarator
"*" @context
declarator: (function_declarator
declarator: (_) @name
parameters: (parameter_list
"(" @context
")" @context))))
(reference_declarator
["&" "&&"] @context
(function_declarator
declarator: (_) @name
parameters: (parameter_list
"(" @context
")" @context)))
]
(type_qualifier)? @context) @item
@ -74,6 +90,22 @@
parameters: (parameter_list
"(" @context
")" @context)))
(pointer_declarator
"*" @context
declarator: (pointer_declarator
"*" @context
declarator: (function_declarator
declarator: (_) @name
parameters: (parameter_list
"(" @context
")" @context))))
(reference_declarator
["&" "&&"] @context
(function_declarator
declarator: (_) @name
parameters: (parameter_list
"(" @context
")" @context)))
]
(type_qualifier)? @context) @item
@ -97,5 +129,21 @@
parameters: (parameter_list
"(" @context
")" @context)))
(pointer_declarator
"*" @context
declarator: (pointer_declarator
"*" @context
declarator: (function_declarator
declarator: (_) @name
parameters: (parameter_list
"(" @context
")" @context))))
(reference_declarator
["&" "&&"] @context
(function_declarator
declarator: (_) @name
parameters: (parameter_list
"(" @context
")" @context)))
]
(type_qualifier)? @context) @item