mirror of
https://github.com/neovim/neovim.git
synced 2025-11-14 22:39:08 +00:00
refactor(lsp): move client code to a regular Lua class
Problem: The LSP client code is implemented as a complicated closure-class (class defined in a single function). Solution: Move LSP client code to a more conventional Lua class and move to a separate file.
This commit is contained in:
committed by
Lewis Russell
parent
cca8a78ea2
commit
59cf827f99
@@ -6,6 +6,7 @@ local glob = vim.glob
|
||||
local M = {}
|
||||
|
||||
--- @param client_id number
|
||||
--- @return lsp.DynamicCapabilities
|
||||
function M.new(client_id)
|
||||
return setmetatable({
|
||||
capabilities = {},
|
||||
@@ -37,7 +38,7 @@ function M:register(registrations)
|
||||
end
|
||||
|
||||
--- @param unregisterations lsp.Unregistration[]
|
||||
--- @private
|
||||
--- @package
|
||||
function M:unregister(unregisterations)
|
||||
for _, unreg in ipairs(unregisterations) do
|
||||
local method = unreg.method
|
||||
@@ -77,7 +78,7 @@ end
|
||||
|
||||
--- @param method string
|
||||
--- @param opts? {bufnr: integer?}
|
||||
--- @private
|
||||
--- @package
|
||||
function M:supports(method, opts)
|
||||
return self:get(method, opts) ~= nil
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user