From 65ef6fdaeef86f8341293942c076b320acf03fd1 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Mon, 7 Sep 2026 11:43:51 +0100 Subject: 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 --- runtime/lua/vim/iter.lua | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'runtime/lua/vim/iter.lua') diff --git a/runtime/lua/vim/iter.lua b/runtime/lua/vim/iter.lua index b0e00d8dd4..136941e233 100644 --- a/runtime/lua/vim/iter.lua +++ b/runtime/lua/vim/iter.lua @@ -64,13 +64,11 @@ --- -- { "a", "b" } --- ``` --- LuaLS cannot model the variadic EmmyLua generics used by this module. ----@diagnostic disable: no-unknown, undefined-doc-name, luadoc-miss-symbol, missing-return, missing-return-value, param-type-mismatch, return-type-mismatch, redundant-return-value, undefined-field - +-- `never` represents an empty tail for single-value iterators. --- @nodoc --- @class vim.IterModule --- @operator call: vim.Iter ---- @overload fun(src: T[]): vim.IterArray +--- @overload fun(src: T[]): vim.IterArray --- @overload fun(src: table): vim.Iter --- @overload fun(src: table, ...): vim.Iter --- @overload fun(src: function, ...): vim.Iter @@ -468,7 +466,7 @@ end --- --- --- @since 12 ---- @overload fun(self: vim.Iter): T[] +--- @overload fun(self: vim.Iter): T[] --- @overload fun(self: vim.Iter): [V1, V2, V...][] --- @return any[] function Iter:totable() @@ -486,7 +484,7 @@ function Iter:totable() end --- @nodoc ---- @overload fun(self: vim.IterArray): T[] +--- @overload fun(self: vim.IterArray): T[] --- @overload fun(self: vim.IterArray): [V1, V2, V...][] --- @return any[] function IterArray:totable() @@ -1250,7 +1248,7 @@ end --- @generic R1, R... --- @param src table|fun(s: table, v: any): R1, R... Table or iterator to drain values from --- @return vim.Iter ---- @overload fun(src: T[]): vim.IterArray +--- @overload fun(src: T[]): vim.IterArray --- @overload fun(src: table): vim.Iter --- @private function Iter.new(src, ...) -- cgit