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:
Lewis Russell
2024-02-07 17:22:03 +00:00
committed by Lewis Russell
parent cca8a78ea2
commit 59cf827f99
6 changed files with 709 additions and 507 deletions

View File

@@ -48,7 +48,7 @@ local function execute_lens(lens, bufnr, client_id)
local client = vim.lsp.get_client_by_id(client_id)
assert(client, 'Client is required to execute lens, client_id=' .. client_id)
client._exec_cmd(lens.command, { bufnr = bufnr }, function(...)
client:_exec_cmd(lens.command, { bufnr = bufnr }, function(...)
vim.lsp.handlers[ms.workspace_executeCommand](...)
M.refresh()
end)