mirror of
https://github.com/neovim/neovim.git
synced 2026-04-24 08:15:41 +00:00
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
This commit is contained in:
22
runtime/lua/vim/lsp/_meta.lua
Normal file
22
runtime/lua/vim/lsp/_meta.lua
Normal file
@@ -0,0 +1,22 @@
|
||||
---@meta
|
||||
error('Cannot require a meta file')
|
||||
|
||||
---@alias lsp-handler fun(err: lsp.ResponseError|nil, result: any, context: lsp.HandlerContext, config: table|nil): any?
|
||||
|
||||
---@class lsp.HandlerContext
|
||||
---@field method string
|
||||
---@field client_id integer
|
||||
---@field bufnr? integer
|
||||
---@field params? any
|
||||
|
||||
---@class lsp.ResponseError
|
||||
---@field code integer
|
||||
---@field message string
|
||||
---@field data string|number|boolean|table[]|table|nil
|
||||
|
||||
--- @class lsp.DocumentFilter
|
||||
--- @field language? string
|
||||
--- @field scheme? string
|
||||
--- @field pattern? string
|
||||
|
||||
--- @alias lsp.RegisterOptions any | lsp.StaticRegistrationOptions | lsp.TextDocumentRegistrationOptions
|
||||
Reference in New Issue
Block a user