mirror of
https://github.com/stevearc/aerial.nvim
synced 2024-09-16 14:34:08 +02:00
e8366e30b4
Side note: this unfortunately moves the symbol location forward in the line to where the name starts, where before it was at the beginning of the return type. Every time you add a pointer to the return type (e.g. int* fn() or int** fn()) it creates a new treesitter wrapper node of "pointer_declaration". Unfortunately there does not seem to currently be a way to write a query for function_definition -> <any number for children> -> function_declaration. Because of that, we must either explicitly query for each level of pointer indirection, or just query directly for the function_declaration. I have opted for the latter because it is cleaner, but it has the side effect of changing the symbol location slightly.
19 lines
228 B
C
19 lines
228 B
C
#define FOO
|
|
#define BAR
|
|
void fn_1() FOO BAR {}
|
|
|
|
void *fn_2() FOO BAR { return 0; }
|
|
|
|
void fn_3() {}
|
|
|
|
void *fn_4() { return 0; }
|
|
|
|
void **fn_5() { return 0; }
|
|
|
|
typedef enum {
|
|
kVal,
|
|
} kEnum;
|
|
|
|
typedef struct {
|
|
int field;
|
|
} St_1;
|