feat: use LazyVim everywhere instead of require("lazyvim.util")

This commit is contained in:
Folke Lemaitre 2024-03-22 09:15:09 +01:00
parent 3a87c08cda
commit 7a5dbeae75
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
41 changed files with 188 additions and 229 deletions

View file

@ -41,7 +41,7 @@ function M.get()
has = "codeAction",
}
}
if require("lazyvim.util").has("inc-rename.nvim") then
if LazyVim.has("inc-rename.nvim") then
M._keys[#M._keys + 1] = {
"<leader>cr",
function()
@ -61,7 +61,7 @@ end
---@param method string
function M.has(buffer, method)
method = method:find("/") and method or "textDocument/" .. method
local clients = require("lazyvim.util").lsp.get_clients({ bufnr = buffer })
local clients = LazyVim.lsp.get_clients({ bufnr = buffer })
for _, client in ipairs(clients) do
if client.supports_method(method) then
return true
@ -77,8 +77,8 @@ function M.resolve(buffer)
return {}
end
local spec = M.get()
local opts = require("lazyvim.util").opts("nvim-lspconfig")
local clients = require("lazyvim.util").lsp.get_clients({ bufnr = buffer })
local opts = LazyVim.opts("nvim-lspconfig")
local clients = LazyVim.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)