build: replace LuaLS with EmmyLua

Problem: LuaLS struggles with the generics used in Nvim's runtime,
requiring broad diagnostic suppressions. Indexing is also slow.

Solution: Use EmmyLua for type checks in the build and CI. It offers
more sophisticated type checking, substantially better support for
generics, and much better flow analysis.

Correct the affected annotations. Use `@internal`, supported directly by
EmmyLua, instead of `@nodoc` for shared internal declarations, and
support it in the help parser.

AI-assisted
This commit is contained in:
Lewis Russell
2026-09-07 11:43:51 +01:00
committed by Lewis Russell
parent cd52c77cd5
commit 65ef6fdaee
48 changed files with 231 additions and 159 deletions

View File

@@ -48,10 +48,8 @@ local buf_capabilities = {}
local M = {}
M.__index = M
---@generic T : vim.lsp.Capability
---@param self T
---@param bufnr integer
---@return T
---@return self
function M:new(bufnr)
-- `self` in the `new()` function refers to the concrete type (i.e., the metatable).
-- `Class` may be a subtype of `Capability`, as it supports inheritance.