Browse Source

fix: lspconfig starting multiple intelephense servers

master
Tovi Jaeschke-Rogers 2 weeks ago
parent
commit
8648a566d3
6 changed files with 33 additions and 36 deletions
  1. +0
    -1
      .config/X11/Xresources
  2. +14
    -0
      .config/nvim/lua/plugins/gitlab.lua
  3. +11
    -33
      .config/nvim/lua/plugins/lspconfig.lua
  4. +6
    -0
      .config/nvim/lua/plugins/typr.lua
  5. +0
    -2
      .local/bin/dwm-autostart
  6. +2
    -0
      .xinitrc

+ 0
- 1
.config/X11/Xresources View File

@ -1,4 +1,3 @@
Xft.dpi: 96
Xft.autohint: 0 Xft.autohint: 0
Xft.lcdfilter: lcddefault Xft.lcdfilter: lcddefault
Xft.hintstyle: hintslight Xft.hintstyle: hintslight


+ 14
- 0
.config/nvim/lua/plugins/gitlab.lua View File

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

+ 11
- 33
.config/nvim/lua/plugins/lspconfig.lua View File

@ -49,22 +49,22 @@ return {
opts.desc = "Go to previous diagnostic" opts.desc = "Go to previous diagnostic"
keymap.set("n", "[d", function() keymap.set("n", "[d", function()
vim.diagnostic.jump({ count=-1, float=true })
vim.diagnostic.jump({ count = -1, float = true })
end, opts) end, opts)
opts.desc = "Go to next diagnostic" opts.desc = "Go to next diagnostic"
keymap.set("n", "]d", function() keymap.set("n", "]d", function()
vim.diagnostic.jump({ count=1, float=true })
vim.diagnostic.jump({ count = 1, float = true })
end, opts) end, opts)
opts.desc = "Go to previous diagnostic (error only)" opts.desc = "Go to previous diagnostic (error only)"
keymap.set("n", "[e", function() 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) end, opts)
opts.desc = "Go to next diagnostic (error only)" opts.desc = "Go to next diagnostic (error only)"
keymap.set("n", "]e", function() 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) end, opts)
opts.desc = "Show documentation for what is under cursor" opts.desc = "Show documentation for what is under cursor"
@ -102,7 +102,7 @@ return {
local global_ts = base_path .. "/typescript/lib" local global_ts = base_path .. "/typescript/lib"
local found_ts = "" local found_ts = ""
local function check_dir(path) 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 if vim.loop.fs_stat(found_ts) then
return path return path
end end
@ -165,13 +165,10 @@ return {
intelephense = { intelephense = {
root_dir = function(pattern) 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, end,
single_file_support = false,
init_options = { init_options = {
licenceKey = vim.fn.expand("$HOME/.local/share/nvim/intelephense-licence.txt"), licenceKey = vim.fn.expand("$HOME/.local/share/nvim/intelephense-licence.txt"),
}, },
@ -247,30 +244,11 @@ return {
require("mason").setup() 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 for server_name, server in pairs(servers) do
server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {}) server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {})
lspconfig[server_name].setup(server) lspconfig[server_name].setup(server)


+ 6
- 0
.config/nvim/lua/plugins/typr.lua View File

@ -0,0 +1,6 @@
return {
"nvzone/typr",
dependencies = "nvzone/volt",
opts = {},
cmd = { "Typr", "TyprStats" },
}

+ 0
- 2
.local/bin/dwm-autostart View File

@ -10,5 +10,3 @@ hsetroot -solid "#1A1A22"
nohup dwmblocks & nohup dwmblocks &
picom -b --config ~/.config/picom/picom.conf picom -b --config ~/.config/picom/picom.conf
~/.screenlayout/office.sh

+ 2
- 0
.xinitrc View File

@ -34,5 +34,7 @@ fi
[[ -f ~/.config/X11/Xresources ]] && xrdb -merge -I$HOME ~/.config/X11/Xresources [[ -f ~/.config/X11/Xresources ]] && xrdb -merge -I$HOME ~/.config/X11/Xresources
~/.screenlayout/office.sh
~/.local/bin/dwm-autostart & ~/.local/bin/dwm-autostart &
exec dwm exec dwm

Loading…
Cancel
Save