aboutsummaryrefslogtreecommitdiff
path: root/scripts/gen_lsp.lua
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2023-08-09 11:06:13 +0200
committerGitHub <noreply@github.com>2023-08-09 11:06:13 +0200
commitc43c745a14dced87a23227d7be4f1c33d4455193 (patch)
tree0cd5cf1cbbfa20be7fffbad696ba5ee97181847e /scripts/gen_lsp.lua
parent8afdc1f3867a620c8235b3d3964b019b94657190 (diff)
downloadrneovim-c43c745a14dced87a23227d7be4f1c33d4455193.tar.gz
rneovim-c43c745a14dced87a23227d7be4f1c33d4455193.tar.bz2
rneovim-c43c745a14dced87a23227d7be4f1c33d4455193.zip
fix(lua): improve annotations for stricter luals diagnostics (#24609)
Problem: luals returns stricter diagnostics with bundled luarc.json Solution: Improve some function and type annotations: * use recognized uv.* types * disable diagnostic for global `vim` in shared.lua * docs: don't start comment lines with taglink (otherwise LuaLS will interpret it as a type) * add type alias for lpeg pattern * fix return annotation for `vim.secure.trust` * rename local Range object in vim.version (shadows `Range` in vim.treesitter) * fix some "missing fields" warnings * add missing required fields for test functions in eval.lua * rename lsp meta files for consistency
Diffstat (limited to 'scripts/gen_lsp.lua')
-rw-r--r--scripts/gen_lsp.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/gen_lsp.lua b/scripts/gen_lsp.lua
index a1bcce4135..66369a8446 100644
--- a/scripts/gen_lsp.lua
+++ b/scripts/gen_lsp.lua
@@ -1,9 +1,9 @@
--[[
Generates lua-ls annotations for lsp
USAGE:
-nvim -l scripts/gen_lsp.lua gen # this will overwrite runtime/lua/vim/lsp/types/protocol.lua
+nvim -l scripts/gen_lsp.lua gen # this will overwrite runtime/lua/vim/lsp/_meta/protocol.lua
nvim -l scripts/gen_lsp.lua gen --version 3.18 --build/new_lsp_types.lua
-nvim -l scripts/gen_lsp.lua gen --version 3.18 --out runtime/lua/vim/lsp/types/protocol.lua
+nvim -l scripts/gen_lsp.lua gen --version 3.18 --out runtime/lua/vim/lsp/_meta/protocol.lua
nvim -l scripts/gen_lsp.lua gen --version 3.18 --methods
--]]
@@ -110,7 +110,7 @@ function M.gen(opt)
'--[[',
'This file is autogenerated from scripts/gen_lsp.lua',
'Regenerate:',
- [=[nvim -l scripts/gen_lsp.lua gen --version 3.18 --runtime/lua/vim/lsp/types/protocol.lua]=],
+ [=[nvim -l scripts/gen_lsp.lua gen --version 3.18 --runtime/lua/vim/lsp/_meta/protocol.lua]=],
'--]]',
'',
'---@alias lsp.null nil',
@@ -264,7 +264,7 @@ function M.gen(opt)
end
local opt = {
- output_file = 'runtime/lua/vim/lsp/types/protocol.lua',
+ output_file = 'runtime/lua/vim/lsp/_meta/protocol.lua',
version = nil,
methods = nil,
}