Switch to emmylua for type-checking
Some checks failed
NeoVim tests / code-quality (push) Failing after 1m6s

This commit is contained in:
2025-10-11 15:12:18 -06:00
parent 9fcc803805
commit fd7b53ab05
14 changed files with 85 additions and 47 deletions

View File

@@ -62,7 +62,7 @@ end
function Buffer:lines(start, stop) return Range.from_lines(self.bufnr, start, stop) end
--- @param motion string
--- @param opts? { contains_cursor?: boolean; pos?: u.Pos }
--- @param opts? { contains_cursor?: boolean, pos?: u.Pos }
function Buffer:motion(motion, opts)
opts = vim.tbl_extend('force', opts or {}, { bufnr = self.bufnr })
return Range.from_motion(motion, opts)

View File

@@ -5,7 +5,6 @@ local __U__OpKeymapOpFunc_rhs = nil
--- This is the global utility function used for operatorfunc
--- in opkeymap
--- @type nil|fun(range: u.Range): fun():any|nil
--- @param ty 'line'|'char'|'block'
-- selene: allow(unused_variable)
function _G.__U__OpKeymapOpFunc(ty)

View File

@@ -112,7 +112,7 @@ function Range.from_lines(bufnr, start_line, stop_line)
end
--- @param motion string
--- @param opts? { bufnr?: number; contains_cursor?: boolean; pos?: u.Pos, user_defined?: boolean }
--- @param opts? { bufnr?: number, contains_cursor?: boolean, pos?: u.Pos, user_defined?: boolean }
--- @return u.Range|nil
function Range.from_motion(motion, opts)
-- Options handling:
@@ -513,7 +513,7 @@ function Range:text() return vim.fn.join(self:lines(), '\n') end
--- @param l number
-- luacheck: ignore
--- @return { line: string; idx0: { start: number; stop: number; }; lnum: number; range: fun():u.Range; text: fun():string }|nil
--- @return { line: string, idx0: { start: number, stop: number }, lnum: number, range: (fun():u.Range), text: fun():string }|nil
function Range:line(l)
if l < 0 then l = self:line_count() + l + 1 end
if l > self:line_count() then return end