Compare commits

..

2 Commits

Author SHA1 Message Date
Mathias Rothenhaeusler a660f0c788 cleanup lspsaga 2025-11-22 12:55:21 +01:00
Mathias Rothenhaeusler f75def6081 cleanup lspsaga setup 2025-11-22 12:11:52 +01:00
4 changed files with 25 additions and 39 deletions

View File

@ -354,7 +354,6 @@ require('custom.catppuccin')
require('custom.lua-line')
require('custom.telescope')
require('custom.lspconfig')
require('custom.lspsaga')
require('custom.nvim-cmp')
require('custom.toggleterm')
require('custom.autopairs')

View File

@ -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],
},

View File

@ -1,24 +0,0 @@
-- import lspsaga safely
-- local saga_status, saga = pcall(require, "lspsaga")
-- if not saga_status then
-- return
-- end
require("lazy").setup({
"glepnir/lspsaga.nvim",
event = "BufRead",
config = function()
require("lspsaga").setup({})
end,
dependencies = { { "nvim-tree/nvim-web-devicons" } },
-- keybinds for navigation in lspsaga window
move_in_saga = { prev = "<C-k>", next = "<C-j>" },
-- use enter to open file with finder
finder_action_keys = {
open = "<CR>",
},
-- use enter to open file with definition preview
definition_action_keys = {
edit = "<CR>",
},
})

View File

@ -27,15 +27,23 @@ return {
{ "startup-nvim/startup.nvim", dependencies = "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" },
{
"glepnir/lspsaga.nvim",
event = "BufRead",
'nvimdev/lspsaga.nvim',
config = function()
require("lspsaga").setup({})
require('lspsaga').setup({})
end,
dependencies = {
{ "nvim-tree/nvim-web-devicons" },
--Please make sure you install markdown and markdown_inline parser
{ "nvim-treesitter/nvim-treesitter" },
'nvim-treesitter/nvim-treesitter', -- optional
'nvim-tree/nvim-web-devicons', -- optional
},
move_in_saga = { prev = "<C-k>", next = "<C-j>" },
-- use enter to open file with finder
finder_action_keys = {
open = "<CR>",
},
-- use enter to open file with definition preview
definition_action_keys = {
edit = "<CR>",
},
},