From 8648a566d3bf0ccab2caaabf2e5db747432be8c4 Mon Sep 17 00:00:00 2001 From: Tovi Jaeschke-Rogers Date: Thu, 19 Jun 2025 09:23:25 +0930 Subject: [PATCH] fix: lspconfig starting multiple intelephense servers --- .config/X11/Xresources | 1 - .config/nvim/lua/plugins/gitlab.lua | 14 ++++++++ .config/nvim/lua/plugins/lspconfig.lua | 44 +++++++------------------- .config/nvim/lua/plugins/typr.lua | 6 ++++ .local/bin/dwm-autostart | 2 -- .xinitrc | 2 ++ 6 files changed, 33 insertions(+), 36 deletions(-) create mode 100644 .config/nvim/lua/plugins/gitlab.lua create mode 100644 .config/nvim/lua/plugins/typr.lua diff --git a/.config/X11/Xresources b/.config/X11/Xresources index ee6905a..f66d64c 100644 --- a/.config/X11/Xresources +++ b/.config/X11/Xresources @@ -1,4 +1,3 @@ -Xft.dpi: 96 Xft.autohint: 0 Xft.lcdfilter: lcddefault Xft.hintstyle: hintslight diff --git a/.config/nvim/lua/plugins/gitlab.lua b/.config/nvim/lua/plugins/gitlab.lua new file mode 100644 index 0000000..c815be3 --- /dev/null +++ b/.config/nvim/lua/plugins/gitlab.lua @@ -0,0 +1,14 @@ +return { + "harrisoncramer/gitlab.nvim", + dependencies = { + "MunifTanjim/nui.nvim", + "nvim-lua/plenary.nvim", + "sindrets/diffview.nvim", + "stevearc/dressing.nvim", -- Recommended but not required. Better UI for pickers. + "nvim-tree/nvim-web-devicons", -- Recommended but not required. Icons in discussion tree. + }, + build = function() require("gitlab.server").build(true) end, -- Builds the Go binary + config = function() + require("gitlab").setup() + end, +} diff --git a/.config/nvim/lua/plugins/lspconfig.lua b/.config/nvim/lua/plugins/lspconfig.lua index e25761f..ccadbcd 100644 --- a/.config/nvim/lua/plugins/lspconfig.lua +++ b/.config/nvim/lua/plugins/lspconfig.lua @@ -49,22 +49,22 @@ return { opts.desc = "Go to previous diagnostic" keymap.set("n", "[d", function() - vim.diagnostic.jump({ count=-1, float=true }) + vim.diagnostic.jump({ count = -1, float = true }) end, opts) opts.desc = "Go to next diagnostic" keymap.set("n", "]d", function() - vim.diagnostic.jump({ count=1, float=true }) + vim.diagnostic.jump({ count = 1, float = true }) end, opts) opts.desc = "Go to previous diagnostic (error only)" keymap.set("n", "[e", function() - vim.diagnostic.jump({ count=-1, float=true, severity = vim.diagnostic.severity.ERROR }) + vim.diagnostic.jump({ count = -1, float = true, severity = vim.diagnostic.severity.ERROR }) end, opts) opts.desc = "Go to next diagnostic (error only)" keymap.set("n", "]e", function() - vim.diagnostic.jump({ count=1, float=true, severity = vim.diagnostic.severity.ERROR }) + vim.diagnostic.jump({ count = 1, float = true, severity = vim.diagnostic.severity.ERROR }) end, opts) opts.desc = "Show documentation for what is under cursor" @@ -102,7 +102,7 @@ return { local global_ts = base_path .. "/typescript/lib" local found_ts = "" local function check_dir(path) - found_ts = table.concat({path, "typescript", "lib"}, "/") + found_ts = table.concat({ path, "typescript", "lib" }, "/") if vim.loop.fs_stat(found_ts) then return path end @@ -165,13 +165,10 @@ return { intelephense = { root_dir = function(pattern) - ---@diagnostic disable-next-line: undefined-field - local cwd = vim.loop.cwd() - local root = util.root_pattern("composer.json")(pattern) - - -- prefer cwd if root is a descendant - return util.path.is_descendant(cwd, root) and cwd or root + local root = util.root_pattern("composer.json", "composer.lock")(pattern) + return root or vim.fn.getcwd() end, + single_file_support = false, init_options = { licenceKey = vim.fn.expand("$HOME/.local/share/nvim/intelephense-licence.txt"), }, @@ -247,30 +244,11 @@ return { require("mason").setup() - local ensure_installed = vim.tbl_keys(servers or {}) - vim.list_extend(ensure_installed, { - "stylua", - "prettier", - "prettierd", - "eslint", - "eslint_d", - "jsonlint", - "markdownlint", - "phpcbf", - "phpcs", - "golangci-lint", - "hadolint", - "gofumpt", - "goimports", - }) - - require("mason-tool-installer").setup({ - ensure_installed = ensure_installed, - run_on_start = false, + require("mason-lspconfig").setup({ + ensure_installed = {}, + automatic_enable = false, }) - require("mason-lspconfig").setup() - for server_name, server in pairs(servers) do server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {}) lspconfig[server_name].setup(server) diff --git a/.config/nvim/lua/plugins/typr.lua b/.config/nvim/lua/plugins/typr.lua new file mode 100644 index 0000000..0b07cd7 --- /dev/null +++ b/.config/nvim/lua/plugins/typr.lua @@ -0,0 +1,6 @@ +return { + "nvzone/typr", + dependencies = "nvzone/volt", + opts = {}, + cmd = { "Typr", "TyprStats" }, +} diff --git a/.local/bin/dwm-autostart b/.local/bin/dwm-autostart index 25b860f..1ac12b7 100755 --- a/.local/bin/dwm-autostart +++ b/.local/bin/dwm-autostart @@ -10,5 +10,3 @@ hsetroot -solid "#1A1A22" nohup dwmblocks & picom -b --config ~/.config/picom/picom.conf - -~/.screenlayout/office.sh diff --git a/.xinitrc b/.xinitrc index b6040ae..1013e5c 100644 --- a/.xinitrc +++ b/.xinitrc @@ -34,5 +34,7 @@ fi [[ -f ~/.config/X11/Xresources ]] && xrdb -merge -I$HOME ~/.config/X11/Xresources +~/.screenlayout/office.sh + ~/.local/bin/dwm-autostart & exec dwm