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
No known key found for this signature in database
GPG key ID: 9B52594D560070AB
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)) table.insert(cmd, string.format("--jvm-arg=-javaagent:%s", lombok_jar))
end end
return { 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. -- How to find the project name for a given root dir.
project_name = function(root_dir) project_name = function(root_dir)

View file

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