aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/lua/treesitter.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/nvim/lua/treesitter.c b/src/nvim/lua/treesitter.c
index de17aabca2..c1816a8860 100644
--- a/src/nvim/lua/treesitter.c
+++ b/src/nvim/lua/treesitter.c
@@ -56,6 +56,7 @@ typedef struct {
# include "lua/treesitter.c.generated.h"
#endif
+// TSParser
static struct luaL_Reg parser_meta[] = {
{ "__gc", parser_gc },
{ "__tostring", parser_tostring },
@@ -70,6 +71,7 @@ static struct luaL_Reg parser_meta[] = {
{ NULL, NULL }
};
+// TSTree
static struct luaL_Reg tree_meta[] = {
{ "__gc", tree_gc },
{ "__tostring", tree_tostring },
@@ -80,6 +82,7 @@ static struct luaL_Reg tree_meta[] = {
{ NULL, NULL }
};
+// TSNode
static struct luaL_Reg node_meta[] = {
{ "__tostring", node_tostring },
{ "__eq", node_eq },
@@ -119,6 +122,7 @@ static struct luaL_Reg node_meta[] = {
{ NULL, NULL }
};
+// TSQuery
static struct luaL_Reg query_meta[] = {
{ "__gc", query_gc },
{ "__tostring", query_tostring },
@@ -1649,8 +1653,10 @@ static int query_inspect(lua_State *L)
return 0;
}
- uint32_t n_pat = ts_query_pattern_count(query);
+ // TSQueryInfo
lua_createtable(L, 0, 2); // [retval]
+
+ uint32_t n_pat = ts_query_pattern_count(query);
lua_createtable(L, (int)n_pat, 1); // [retval, patterns]
for (size_t i = 0; i < n_pat; i++) {
uint32_t len;