refactor(lsp): improve lsp configuration and UI settings
This commit is contained in:
1 file changed
+43
-34
+43
-34
@@ -1,32 +1,32 @@
|
|||||||
return {
|
return {
|
||||||
-- default lsp configs
|
-- default lsp configs
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
'neovim/nvim-lspconfig',
|
||||||
config = function() end,
|
config = function() end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- lsp installer
|
-- lsp installer
|
||||||
{
|
{
|
||||||
"williamboman/mason.nvim",
|
'williamboman/mason.nvim',
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"williamboman/mason-lspconfig.nvim",
|
'williamboman/mason-lspconfig.nvim',
|
||||||
},
|
},
|
||||||
cmd = "Mason",
|
cmd = 'Mason',
|
||||||
config = function()
|
config = function()
|
||||||
-- mason
|
-- mason
|
||||||
require("mason").setup({
|
require('mason').setup({
|
||||||
ui = {
|
ui = {
|
||||||
icons = {
|
icons = {
|
||||||
package_installed = "✓",
|
package_installed = '✓',
|
||||||
package_pending = "➜",
|
package_pending = '➜',
|
||||||
package_uninstalled = "✗",
|
package_uninstalled = '✗',
|
||||||
},
|
},
|
||||||
border = "rounded",
|
border = 'rounded',
|
||||||
backdrop = 100,
|
backdrop = 100,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
require("mason-lspconfig").setup({
|
require('mason-lspconfig').setup({
|
||||||
ensure_installed = require("config.extensions").lsp_server,
|
ensure_installed = require('config.extensions').lsp_server,
|
||||||
automatic_installation = false, -- Don't auto-install or auto-configure
|
automatic_installation = false, -- Don't auto-install or auto-configure
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
@@ -34,24 +34,24 @@ return {
|
|||||||
|
|
||||||
-- improve neovim lsp experience
|
-- improve neovim lsp experience
|
||||||
{
|
{
|
||||||
"nvimdev/lspsaga.nvim",
|
'nvimdev/lspsaga.nvim',
|
||||||
event = "LspAttach",
|
event = 'LspAttach',
|
||||||
config = function()
|
config = function()
|
||||||
require("lspsaga").setup({
|
require('lspsaga').setup({
|
||||||
ui = {
|
ui = {
|
||||||
theme = "round",
|
theme = 'round',
|
||||||
border = "rounded",
|
border = 'rounded',
|
||||||
devicon = true,
|
devicon = true,
|
||||||
title = true,
|
title = true,
|
||||||
winblend = 1,
|
winblend = 1,
|
||||||
expand = " ",
|
expand = ' ',
|
||||||
collapse = " ",
|
collapse = ' ',
|
||||||
preview = "",
|
preview = '',
|
||||||
code_action = " ",
|
code_action = ' ',
|
||||||
diagnostic = " ",
|
diagnostic = ' ',
|
||||||
incoming = " ",
|
incoming = ' ',
|
||||||
outgoing = " ",
|
outgoing = ' ',
|
||||||
hover = " ",
|
hover = ' ',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
@@ -59,42 +59,51 @@ return {
|
|||||||
|
|
||||||
-- inline diagnostic
|
-- inline diagnostic
|
||||||
{
|
{
|
||||||
"rachartier/tiny-inline-diagnostic.nvim",
|
'rachartier/tiny-inline-diagnostic.nvim',
|
||||||
event = "VeryLazy",
|
event = 'VeryLazy',
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
config = function()
|
config = function()
|
||||||
require("tiny-inline-diagnostic").setup()
|
require('tiny-inline-diagnostic').setup({
|
||||||
|
options = {
|
||||||
|
show_source = true,
|
||||||
|
multiple_diag_under_cursor = true,
|
||||||
|
-- break_line = {
|
||||||
|
-- enabled = true,
|
||||||
|
-- after = 60,
|
||||||
|
-- }
|
||||||
|
},
|
||||||
|
})
|
||||||
vim.diagnostic.config({ virtual_text = false }) -- Disable default virtual text
|
vim.diagnostic.config({ virtual_text = false }) -- Disable default virtual text
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- code action
|
-- code action
|
||||||
{
|
{
|
||||||
"rachartier/tiny-code-action.nvim",
|
'rachartier/tiny-code-action.nvim',
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{
|
{
|
||||||
"folke/snacks.nvim",
|
'folke/snacks.nvim',
|
||||||
opts = {
|
opts = {
|
||||||
terminal = {},
|
terminal = {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
event = "LspAttach",
|
event = 'LspAttach',
|
||||||
config = function()
|
config = function()
|
||||||
local codeaction = require("tiny-code-action")
|
local codeaction = require('tiny-code-action')
|
||||||
|
|
||||||
codeaction.setup({
|
codeaction.setup({
|
||||||
picker = {
|
picker = {
|
||||||
"buffer",
|
'buffer',
|
||||||
opts = {
|
opts = {
|
||||||
auto_preview = true,
|
auto_preview = true,
|
||||||
hotkeys = true,
|
hotkeys = true,
|
||||||
hotkeys_mode = "sequential",
|
hotkeys_mode = 'sequential',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>.", codeaction.code_action)
|
vim.keymap.set('n', '<leader>.', codeaction.code_action)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user