cleanup lspsaga
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
-- lsp.lua (replace your current file with this)
|
||||
-- import cmp-nvim-lsp plugin safely
|
||||
local cmp_nvim_lsp_status, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
|
||||
if not cmp_nvim_lsp_status then
|
||||
return
|
||||
end
|
||||
-- local cmp_nvim_lsp_status, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
|
||||
-- if not cmp_nvim_lsp_status then
|
||||
-- return
|
||||
-- end
|
||||
|
||||
local keymap = vim.keymap -- for conciseness
|
||||
|
||||
@@ -84,8 +84,7 @@ local on_attach = function(_, bufnr)
|
||||
end
|
||||
|
||||
-- capabilities
|
||||
local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
-- helper for registering server configs (lazy attach)
|
||||
local function setup_server(name, config)
|
||||
local cfg = vim.tbl_deep_extend("force", {
|
||||
@@ -129,9 +128,13 @@ root_dir = function(fname)
|
||||
or util.path.dirname(fname)
|
||||
end
|
||||
|
||||
local fallback_root_dir = function(fname)
|
||||
return util.root_pattern("composer.json", ".git")(fname) or util.path.dirname(fname)
|
||||
end
|
||||
|
||||
setup_server("phpactor", {
|
||||
filetypes = { "php" },
|
||||
root_dir = fallback_root_dir,
|
||||
-- root_dir = fallback_root_dir,
|
||||
init_options = {
|
||||
["language_server_phpstan.enabled"] = true,
|
||||
["language_server_psalm.enabled"] = false,
|
||||
@@ -150,7 +153,7 @@ vim.lsp.config("lua_ls", {
|
||||
|
||||
setup_server("intelephense", {
|
||||
filetypes = { "php" },
|
||||
root_dir = fallback_root_dir,
|
||||
-- root_dir = fallback_root_dir,
|
||||
init_options = {
|
||||
licenceKey = vim.fn.readfile(vim.fn.expand("$HOME/.config/intelephense/license.txt"))[1],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user