fix(lsp): remove root_pattern
This commit is contained in:
@@ -9,11 +9,6 @@ return {
|
|||||||
dependencies = {
|
dependencies = {
|
||||||
"npm",
|
"npm",
|
||||||
},
|
},
|
||||||
root_pattern = {
|
|
||||||
"composer.json",
|
|
||||||
"composer.lock",
|
|
||||||
"vendor",
|
|
||||||
},
|
|
||||||
mason = { "intelephense", dependencies = { {"phpcs", "pretty-php" } } },
|
mason = { "intelephense", dependencies = { {"phpcs", "pretty-php" } } },
|
||||||
linters = {
|
linters = {
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ M.__index = M
|
|||||||
---@field enable? boolean
|
---@field enable? boolean
|
||||||
---@field dependencies? string[]
|
---@field dependencies? string[]
|
||||||
---@field mason? string|MasonPackageConfig
|
---@field mason? string|MasonPackageConfig
|
||||||
---@field root_patterns? string[]
|
|
||||||
---@field keymaps? Keymap[]
|
---@field keymaps? Keymap[]
|
||||||
---@field linters? LinterConfig[]
|
---@field linters? LinterConfig[]
|
||||||
---@field lspconfig? lspconfig.Config
|
---@field lspconfig? lspconfig.Config
|
||||||
@@ -46,13 +45,6 @@ function M.validate(name, config)
|
|||||||
"list of strings or nil",
|
"list of strings or nil",
|
||||||
},
|
},
|
||||||
mason = { config.mason, { "string", "table" }, true },
|
mason = { config.mason, { "string", "table" }, true },
|
||||||
root_patterns = {
|
|
||||||
config.root_patterns,
|
|
||||||
function(f)
|
|
||||||
return utils.is_list_or_nil(f, "string")
|
|
||||||
end,
|
|
||||||
"list of strings or nil",
|
|
||||||
},
|
|
||||||
keymaps = {
|
keymaps = {
|
||||||
config.keymaps,
|
config.keymaps,
|
||||||
function(f)
|
function(f)
|
||||||
@@ -140,15 +132,7 @@ end
|
|||||||
function M:configure_client()
|
function M:configure_client()
|
||||||
local lspconfig = require("lspconfig")
|
local lspconfig = require("lspconfig")
|
||||||
|
|
||||||
if self.config.root_patterns then
|
|
||||||
self.config.lspconfig.root_dir =
|
|
||||||
lspconfig.util.root_pattern(unpack(self.config.root_patterns))
|
|
||||||
else
|
|
||||||
self.config.lspconfig.root_dir = lspconfig.util.find_git_ancestor
|
|
||||||
end
|
|
||||||
|
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
|
|
||||||
local cmp_nvim_lsp = utils.try_require("cmp_nvim_lsp")
|
local cmp_nvim_lsp = utils.try_require("cmp_nvim_lsp")
|
||||||
if cmp_nvim_lsp then
|
if cmp_nvim_lsp then
|
||||||
capabilities =
|
capabilities =
|
||||||
|
|||||||
Reference in New Issue
Block a user