From 4b909528516032b002a4a32f3e06f0eb6185ea6b Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Fri, 11 Oct 2024 15:07:36 -0700 Subject: fix(treesitter): mark supertype nodes as named **Problem:** Tree-sitter 0.24.0 introduced a new symbol type to denote supertype nodes (`TSSymbolTypeSupertype`). Now, `language.inspect()` (and the query `omnifunc`) return supertype symbols, but with double quotes around them. **Solution:** Mark a symbol as "named" based on it *not* being an anonymous node, rather than checking that it is a regular node (which a supertype also is not). --- src/nvim/lua/treesitter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/lua') diff --git a/src/nvim/lua/treesitter.c b/src/nvim/lua/treesitter.c index 3ceb21b61a..1ebf835eb5 100644 --- a/src/nvim/lua/treesitter.c +++ b/src/nvim/lua/treesitter.c @@ -272,7 +272,7 @@ int tslua_inspect_lang(lua_State *L) continue; } const char *name = ts_language_symbol_name(lang, (TSSymbol)i); - bool named = t == TSSymbolTypeRegular; + bool named = t != TSSymbolTypeAnonymous; lua_pushboolean(L, named); // [retval, symbols, is_named] if (!named) { char buf[256]; -- cgit