aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua
diff options
context:
space:
mode:
authorThomas Vigouroux <tomvig38@gmail.com>2020-06-29 23:02:30 +0200
committerThomas Vigouroux <tomvig38@gmail.com>2020-06-29 23:32:49 +0200
commit69816f5e134f0e965352367b5928835794da1698 (patch)
tree11a8a476b0d83907cd6d52e2f14aa953974e2096 /test/functional/lua
parent66af35fc85fb2e14fe8f91449289af06b9104dd4 (diff)
downloadrneovim-69816f5e134f0e965352367b5928835794da1698.tar.gz
rneovim-69816f5e134f0e965352367b5928835794da1698.tar.bz2
rneovim-69816f5e134f0e965352367b5928835794da1698.zip
treesitter: use single nodes in set_ranges
fixup! treesitter: fix lint
Diffstat (limited to 'test/functional/lua')
-rw-r--r--test/functional/lua/treesitter_spec.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/functional/lua/treesitter_spec.lua b/test/functional/lua/treesitter_spec.lua
index 16a7f365a8..ab0224a911 100644
--- a/test/functional/lua/treesitter_spec.lua
+++ b/test/functional/lua/treesitter_spec.lua
@@ -418,14 +418,14 @@ static int nlua_schedule(lua_State *const lstate)
-- The following sets the included ranges for the current parser
-- As stated here, this only includes the function (thus the whole buffer, without the last line)
- local res = exec_lua([[
+ local res2 = exec_lua([[
local root = parser:parse():root()
- parser:set_included_ranges({{root:child(0), root:child(0)}})
+ parser:set_included_ranges({root:child(0)})
parser.valid = false
return { parser:parse():root():range() }
]])
- eq({0, 0, 18, 1}, res)
+ eq({0, 0, 18, 1}, res2)
end)
it("allows to set complex ranges", function()
if not check_parser() then return end
@@ -439,7 +439,7 @@ static int nlua_schedule(lua_State *const lstate)
local nodes = {}
for _, node in query:iter_captures(parser:parse():root(), 0, 0, 19) do
- table.insert(nodes, { node, node })
+ table.insert(nodes, node)
end
parser:set_included_ranges(nodes)