aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorRiley Bruins <ribru17@hotmail.com>2024-10-11 15:07:36 -0700
committerChristian Clason <c.clason@uni-graz.at>2024-10-12 09:59:44 +0200
commit4b909528516032b002a4a32f3e06f0eb6185ea6b (patch)
tree103703d0316d478b7ea69f1491079f22706bbfc7 /test/functional
parent45f8f957c05ca18ea86b8b6bb6c0a903c9140b7b (diff)
downloadrneovim-4b909528516032b002a4a32f3e06f0eb6185ea6b.tar.gz
rneovim-4b909528516032b002a4a32f3e06f0eb6185ea6b.tar.bz2
rneovim-4b909528516032b002a4a32f3e06f0eb6185ea6b.zip
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).
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/treesitter/language_spec.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/functional/treesitter/language_spec.lua b/test/functional/treesitter/language_spec.lua
index 633a2dc725..120a15d7f9 100644
--- a/test/functional/treesitter/language_spec.lua
+++ b/test/functional/treesitter/language_spec.lua
@@ -73,7 +73,7 @@ describe('treesitter language API', function()
eq(true, fset['directive'])
eq(true, fset['initializer'])
- local has_named, has_anonymous
+ local has_named, has_anonymous, has_supertype
for symbol, named in pairs(symbols) do
eq('string', type(symbol))
eq('boolean', type(named))
@@ -81,11 +81,13 @@ describe('treesitter language API', function()
has_named = true
elseif symbol == '"|="' and named == false then
has_anonymous = true
+ elseif symbol == 'statement' and named == true then
+ has_supertype = true
end
end
eq(
- { has_named = true, has_anonymous = true },
- { has_named = has_named, has_anonymous = has_anonymous }
+ { has_named = true, has_anonymous = true, has_supertype = true },
+ { has_named = has_named, has_anonymous = has_anonymous, has_supertype = has_supertype }
)
end)