perf(util): split lazyvim.util in smaller separate modules

This commit is contained in:
Folke Lemaitre
2023-10-10 19:29:24 +02:00
parent 5f5acb5b88
commit c8c929c9fd
20 changed files with 442 additions and 283 deletions

View File

@ -66,7 +66,7 @@ end
---@param method string
function M.has(buffer, method)
method = method:find("/") and method or "textDocument/" .. method
local clients = require("lazyvim.util").get_clients({ bufnr = buffer })
local clients = require("lazyvim.util").lsp.get_clients({ bufnr = buffer })
for _, client in ipairs(clients) do
if client.supports_method(method) then
return true
@ -83,7 +83,7 @@ function M.resolve(buffer)
end
local spec = M.get()
local opts = require("lazyvim.util").opts("nvim-lspconfig")
local clients = require("lazyvim.util").get_clients({ bufnr = buffer })
local clients = require("lazyvim.util").lsp.get_clients({ bufnr = buffer })
for _, client in ipairs(clients) do
local maps = opts.servers[client.name] and opts.servers[client.name].keys or {}
vim.list_extend(spec, maps)