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).
This commit is contained in:
Riley Bruins
2024-10-11 15:07:36 -07:00
committed by Christian Clason
parent 45f8f957c0
commit 4b90952851
2 changed files with 6 additions and 4 deletions

View File

@@ -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];