1
0
Fork 0
This commit is contained in:
Luca Bilke 2024-03-09 04:17:43 +01:00
parent c1a592a787
commit aca77b317d
3 changed files with 8 additions and 7 deletions

View File

@ -1,5 +1,6 @@
local conf = { handlers = {} }
-- https://github.com/bmewburn/intelephense-docs/blob/master/installation.md#configuration-options
conf.handlers["intelephense"] = {
init_options = {
storagePath = os.getenv("XDG_CACHE_HOME") .. "/intelephense",

View File

@ -565,16 +565,14 @@ function M.has_value(table, value)
end
function M.get_gwd(path)
local find = { ".git" }
local opts = { stop = os.getenv("HOME"), upward = true, limit = 1, path = path }
local found = vim.fs.find(find, opts)
if found ~= nil then
return vim.fs.dirname(found[1])
end
return require("lspconfig.util").find_git_ancestor(path or vim.fn.getcwd())
end
function M.set_cwd()
vim.fn.chdir(M.get_gwd())
local dir = M.get_gwd()
if dir ~= nil then
vim.fn.chdir(dir)
end
end
return M

View File

@ -23,6 +23,8 @@ end
M.dependencies = { "mason.nvim", "neoconf.nvim", "neodev.nvim" }
M.event = { "BufReadPost", "BufNewFile", "BufNew" }
M.cmd = { "LspInstall", "LspUninstall" }
M.config = function()