fixes
This commit is contained in:
parent
c1a592a787
commit
aca77b317d
3 changed files with 8 additions and 7 deletions
|
@ -1,5 +1,6 @@
|
||||||
local conf = { handlers = {} }
|
local conf = { handlers = {} }
|
||||||
|
|
||||||
|
-- https://github.com/bmewburn/intelephense-docs/blob/master/installation.md#configuration-options
|
||||||
conf.handlers["intelephense"] = {
|
conf.handlers["intelephense"] = {
|
||||||
init_options = {
|
init_options = {
|
||||||
storagePath = os.getenv("XDG_CACHE_HOME") .. "/intelephense",
|
storagePath = os.getenv("XDG_CACHE_HOME") .. "/intelephense",
|
||||||
|
|
|
@ -565,16 +565,14 @@ function M.has_value(table, value)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.get_gwd(path)
|
function M.get_gwd(path)
|
||||||
local find = { ".git" }
|
return require("lspconfig.util").find_git_ancestor(path or vim.fn.getcwd())
|
||||||
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
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.set_cwd()
|
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
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
@ -23,6 +23,8 @@ end
|
||||||
|
|
||||||
M.dependencies = { "mason.nvim", "neoconf.nvim", "neodev.nvim" }
|
M.dependencies = { "mason.nvim", "neoconf.nvim", "neodev.nvim" }
|
||||||
|
|
||||||
|
M.event = { "BufReadPost", "BufNewFile", "BufNew" }
|
||||||
|
|
||||||
M.cmd = { "LspInstall", "LspUninstall" }
|
M.cmd = { "LspInstall", "LspUninstall" }
|
||||||
|
|
||||||
M.config = function()
|
M.config = function()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue