feat: change to postgres-lsp for sql, open diagnostics bind
This commit is contained in:
@@ -19,12 +19,23 @@ M.on_attach = function(client, bufnr)
|
|||||||
|
|
||||||
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 })
|
vim.diagnostic.jump({
|
||||||
|
count = -1,
|
||||||
|
on_jump = function()
|
||||||
|
vim.diagnostic.open_float()
|
||||||
|
end,
|
||||||
|
})
|
||||||
end, opts)
|
end, opts)
|
||||||
|
keymap.set("n", "<leader>?", vim.diagnostic.open_float, 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 })
|
vim.diagnostic.jump({
|
||||||
|
count = 1,
|
||||||
|
on_jump = function()
|
||||||
|
vim.diagnostic.open_float()
|
||||||
|
end,
|
||||||
|
})
|
||||||
end, opts)
|
end, opts)
|
||||||
|
|
||||||
opts.desc = "Show documentation for what is under cursor"
|
opts.desc = "Show documentation for what is under cursor"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ local lsp = vim.lsp
|
|||||||
local capabilities = require("lsp-options").capabilities
|
local capabilities = require("lsp-options").capabilities
|
||||||
local on_attach = require("lsp-options").on_attach
|
local on_attach = require("lsp-options").on_attach
|
||||||
|
|
||||||
lsp.config("sqlls", {
|
lsp.config("postgres_lsp", {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
})
|
})
|
||||||
@@ -14,4 +14,4 @@ lsp.config("sqlls", {
|
|||||||
|
|
||||||
-- ── Enable configs ───────────────────────────────────────────────
|
-- ── Enable configs ───────────────────────────────────────────────
|
||||||
local enable = vim.lsp.enable
|
local enable = vim.lsp.enable
|
||||||
enable("sqlls")
|
enable("postgres_lsp")
|
||||||
|
|||||||
@@ -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,
|
|
||||||
}
|
|
||||||
@@ -40,10 +40,10 @@ return {
|
|||||||
"jsonls",
|
"jsonls",
|
||||||
"marksman",
|
"marksman",
|
||||||
"lua_ls",
|
"lua_ls",
|
||||||
|
"postgres_lsp",
|
||||||
"pyright",
|
"pyright",
|
||||||
"rust_analyzer",
|
"rust_analyzer",
|
||||||
"ruby_lsp",
|
"ruby_lsp",
|
||||||
"sqlls",
|
|
||||||
"verible",
|
"verible",
|
||||||
"vtsls",
|
"vtsls",
|
||||||
"vue_ls",
|
"vue_ls",
|
||||||
|
|||||||
Reference in New Issue
Block a user