mirror of
https://github.com/neovim/neovim.git
synced 2026-02-04 11:04:30 +00:00
fix: resolve all remaining LuaLS diagnostics
This commit is contained in:
committed by
Lewis Russell
parent
83479b95ab
commit
6aa42e8f92
@@ -149,7 +149,7 @@ end
|
||||
|
||||
--- Returns the node's range or an unpacked range table
|
||||
---
|
||||
---@param node_or_range (TSNode | table) Node or table of positions
|
||||
---@param node_or_range TSNode|Range4 Node or table of positions
|
||||
---
|
||||
---@return integer start_row
|
||||
---@return integer start_col
|
||||
@@ -157,7 +157,8 @@ end
|
||||
---@return integer end_col
|
||||
function M.get_node_range(node_or_range)
|
||||
if type(node_or_range) == 'table' then
|
||||
return unpack(node_or_range)
|
||||
--- @cast node_or_range -TSNode LuaLS bug
|
||||
return M._range.unpack4(node_or_range)
|
||||
else
|
||||
return node_or_range:range(false)
|
||||
end
|
||||
@@ -238,7 +239,9 @@ function M.node_contains(node, range)
|
||||
-- allow a table so nodes can be mocked
|
||||
vim.validate('node', node, { 'userdata', 'table' })
|
||||
vim.validate('range', range, M._range.validate, 'integer list with 4 or 6 elements')
|
||||
return M._range.contains({ node:range() }, range)
|
||||
--- @diagnostic disable-next-line: missing-fields LuaLS bug
|
||||
local nrange = { node:range() } --- @type Range4
|
||||
return M._range.contains(nrange, range)
|
||||
end
|
||||
|
||||
--- Returns a list of highlight captures at the given position
|
||||
|
||||
Reference in New Issue
Block a user