mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-22 17:03:39 +02:00
feat: use LazyVim everywhere instead of require("lazyvim.util")
This commit is contained in:
parent
3a87c08cda
commit
7a5dbeae75
41 changed files with 188 additions and 229 deletions
|
@ -1,5 +1,3 @@
|
|||
local Util = require("lazyvim.util")
|
||||
|
||||
---@class lazyvim.util.lsp
|
||||
local M = {}
|
||||
|
||||
|
@ -87,10 +85,10 @@ function M.formatter(opts)
|
|||
primary = true,
|
||||
priority = 1,
|
||||
format = function(buf)
|
||||
M.format(Util.merge({}, filter, { bufnr = buf }))
|
||||
M.format(LazyVim.merge({}, filter, { bufnr = buf }))
|
||||
end,
|
||||
sources = function(buf)
|
||||
local clients = M.get_clients(Util.merge({}, filter, { bufnr = buf }))
|
||||
local clients = M.get_clients(LazyVim.merge({}, filter, { bufnr = buf }))
|
||||
---@param client lsp.Client
|
||||
local ret = vim.tbl_filter(function(client)
|
||||
return client.supports_method("textDocument/formatting")
|
||||
|
@ -102,7 +100,7 @@ function M.formatter(opts)
|
|||
end, ret)
|
||||
end,
|
||||
}
|
||||
return Util.merge(ret, opts) --[[@as LazyFormatter]]
|
||||
return LazyVim.merge(ret, opts) --[[@as LazyFormatter]]
|
||||
end
|
||||
|
||||
---@alias lsp.Client.format {timeout_ms?: number, format_options?: table} | lsp.Client.filter
|
||||
|
@ -113,8 +111,8 @@ function M.format(opts)
|
|||
"force",
|
||||
{},
|
||||
opts or {},
|
||||
require("lazyvim.util").opts("nvim-lspconfig").format or {},
|
||||
require("lazyvim.util").opts("conform.nvim").format or {}
|
||||
LazyVim.opts("nvim-lspconfig").format or {},
|
||||
LazyVim.opts("conform.nvim").format or {}
|
||||
)
|
||||
local ok, conform = pcall(require, "conform")
|
||||
-- use conform for formatting with LSP when available,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue