Commit graph

9 commits

Author SHA1 Message Date
Steven Arcangeli
75de06f8ed lint: autoformat all tree-sitter query files 2024-06-01 20:50:39 -07:00
Steven Arcangeli
23a739c0ac refactor: rename @type capture to @symbol 2023-10-31 16:51:08 -07:00
Steven Arcangeli
340d0197d7 fix(cpp): add support for declared functions (#314) 2023-10-15 17:58:21 -07:00
monaqa
87cede7ed1
rm language_kind_map; write "kind" in query file 2022-11-29 21:59:39 +09:00
Steven Arcangeli
f1e0f0ea3b fix: C++ struct variables appear as symbols (#153) 2022-09-25 05:06:11 -07:00
Steven Arcangeli
91350456c1 feat: add symbol ranges for treesitter and markdown (#52)
This adds support for the end_lnum and end_col fields to the treesitter
and markdown backends. Now all backends store both the start and the end
of a symbol. At the moment this is only being used for detecting exact
position matching, so the lualine component and highlighting when
`highlight_closest = false`.

This change also made the C, C++, and Julia treesitter backends a bit
more correct and robust.
2022-02-03 18:03:26 -08:00
Steven Arcangeli
e8366e30b4 fix(ts)(c/cpp): detect functions that return pointers (fix #25)
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.
2021-11-30 11:12:39 -08:00
Steven Arcangeli
025ef251ff fix(ts)(cpp): Add detection for member functions (fix #18) 2021-11-23 10:28:44 -08:00
Steven Arcangeli
2948e991a4 feat: treesitter support for cpp 2021-11-20 17:17:57 -08:00