feat: change to postgres-lsp for sql, open diagnostics bind

This commit is contained in:
2026-06-22 16:46:28 +02:00
parent 3acab795aa
commit 68e0d2531d
4 changed files with 16 additions and 21 deletions
+13 -2
View File
@@ -19,12 +19,23 @@ M.on_attach = function(client, bufnr)
opts.desc = "Go to previous diagnostic"
keymap.set("n", "[d", function()
vim.diagnostic.jump({ count = -1 })
vim.diagnostic.jump({
count = -1,
on_jump = function()
vim.diagnostic.open_float()
end,
})
end, opts)
keymap.set("n", "<leader>?", vim.diagnostic.open_float, opts)
opts.desc = "Go to next diagnostic"
keymap.set("n", "]d", function()
vim.diagnostic.jump({ count = 1 })
vim.diagnostic.jump({
count = 1,
on_jump = function()
vim.diagnostic.open_float()
end,
})
end, opts)
opts.desc = "Show documentation for what is under cursor"
+2 -2
View File
@@ -6,7 +6,7 @@ local lsp = vim.lsp
local capabilities = require("lsp-options").capabilities
local on_attach = require("lsp-options").on_attach
lsp.config("sqlls", {
lsp.config("postgres_lsp", {
capabilities = capabilities,
on_attach = on_attach,
})
@@ -14,4 +14,4 @@ lsp.config("sqlls", {
-- ── Enable configs ───────────────────────────────────────────────
local enable = vim.lsp.enable
enable("sqlls")
enable("postgres_lsp")
-16
View File
@@ -1,16 +0,0 @@
return {
---------- for lsp diagnostic lines ----------
"https://git.sr.ht/~whynothugo/lsp_lines.nvim",
event = "LspAttach",
config = function()
require("lsp_lines").setup()
vim.diagnostic.config({ virtual_lines = false })
local lsplines = false
vim.keymap.set("n", "<Leader>L", function()
lsplines = not lsplines
vim.diagnostic.config({ virtual_text = not lsplines })
vim.diagnostic.config({ virtual_lines = lsplines })
end, { desc = "Toggle lsp_lines" })
end,
}
+1 -1
View File
@@ -40,10 +40,10 @@ return {
"jsonls",
"marksman",
"lua_ls",
"postgres_lsp",
"pyright",
"rust_analyzer",
"ruby_lsp",
"sqlls",
"verible",
"vtsls",
"vue_ls",