mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-27 19:28:59 +02:00
perf(util): closure for get_clients to prevent loading vim.lsp cascade early
This commit is contained in:
parent
3f67ac3c73
commit
1eac633c4f
1 changed files with 4 additions and 2 deletions
|
@ -3,6 +3,10 @@ local Util = require("lazy.core.util")
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
M.root_patterns = { ".git", "lua" }
|
M.root_patterns = { ".git", "lua" }
|
||||||
|
function M.get_clients(...)
|
||||||
|
local fn = vim.lsp.get_clients or vim.lsp.get_active_clients
|
||||||
|
return fn(...)
|
||||||
|
end
|
||||||
|
|
||||||
---@param on_attach fun(client, buffer)
|
---@param on_attach fun(client, buffer)
|
||||||
function M.on_attach(on_attach)
|
function M.on_attach(on_attach)
|
||||||
|
@ -49,8 +53,6 @@ function M.opts(name)
|
||||||
return Plugin.values(plugin, "opts", false)
|
return Plugin.values(plugin, "opts", false)
|
||||||
end
|
end
|
||||||
|
|
||||||
M.get_clients = vim.lsp.get_clients or vim.lsp.get_active_clients
|
|
||||||
|
|
||||||
-- returns the root directory based on:
|
-- returns the root directory based on:
|
||||||
-- * lsp workspace folders
|
-- * lsp workspace folders
|
||||||
-- * lsp root_dir
|
-- * lsp root_dir
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue