fix(lspconfig): remove all usage of lspconfig

This commit is contained in:
Folke Lemaitre
2025-09-18 13:06:46 +02:00
parent a467ce074f
commit 36b41911ab
2 changed files with 16 additions and 7 deletions

View File

@@ -91,7 +91,9 @@ return {
table.insert(cmd, string.format("--jvm-arg=-javaagent:%s", lombok_jar))
end
return {
root_dir = require("lspconfig.util").root_pattern(vim.lsp.config.jdtls.root_markers),
root_dir = function(path)
return vim.fs.root(path, vim.lsp.config.jdtls.root_markers)
end,
-- How to find the project name for a given root dir.
project_name = function(root_dir)

View File

@@ -26,12 +26,19 @@ return {
"reason",
"dune",
},
root_dir = function(bufnr, on_dir)
local util = require("lspconfig.util")
local fname = vim.api.nvim_buf_get_name(bufnr)
--stylua: ignore
on_dir(util.root_pattern("*.opam", "esy.json", "package.json", ".git", "dune-project", "dune-workspace", "*.ml")( fname))
end,
root_markers = {
function(name)
return name:match(".*%.opam$")
end,
"esy.json",
"package.json",
".git",
"dune-project",
"dune-workspace",
function(name)
return name:match(".*%.ml$")
end,
},
},
},
},