Why: Clean up the heavy Lspsaga UI and adopt built‑in LSP plus Snacks for better performance and maintainability. - New Features - Use native `vim.lsp.buf` functions for code actions, diagnostics, rename, etc. - Integrate Snacks picker for definitions, references, symbols, and type definitions. - Enhancements - Update keybindings to use Snacks and native APIs instead of Lspsaga. - Drop `nvimdev/Lspsaga.nvim`, `typescript-tools.nvim`, and unused `plenary.nvim`. - Preserve mini.misc auto‑root and other minor improvements. - Bug Fixes - Resolve broken Lspsaga UI configuration and related mappings. - Remove stale `<leader>la` mapping that referenced Lspsaga.
57 lines
1.5 KiB
Lua
57 lines
1.5 KiB
Lua
add({
|
|
'mason-org/mason.nvim', -- lsp installer manager
|
|
'mason-org/mason-lspconfig.nvim', -- lsp installer
|
|
'neovim/nvim-lspconfig', -- lsp config
|
|
'rachartier/tiny-inline-diagnostic.nvim', -- inline diagnostic
|
|
'rachartier/tiny-code-action.nvim', -- code action
|
|
})
|
|
|
|
-- lsp installer
|
|
require('mason').setup({
|
|
ui = {
|
|
icons = {
|
|
package_installed = '✓',
|
|
package_pending = '➜',
|
|
package_uninstalled = '✗',
|
|
},
|
|
border = 'rounded',
|
|
backdrop = 100,
|
|
},
|
|
})
|
|
|
|
require('mason-lspconfig').setup({
|
|
ensure_installed = require('extensions').lsp_server,
|
|
automatic_installation = false, -- Don't auto-install or auto-configure
|
|
})
|
|
|
|
-- improve neovim lsp experience
|
|
vim.api.nvim_create_autocmd('LspAttach', {
|
|
callback = function()
|
|
|
|
--inline diagnostic
|
|
require('tiny-inline-diagnostic').setup({
|
|
options = {
|
|
show_source = true,
|
|
multiple_diag_under_cursor = true,
|
|
},
|
|
})
|
|
|
|
--code action
|
|
require('tiny-code-action').setup({
|
|
picker = {
|
|
'buffer',
|
|
opts = {
|
|
auto_preview = true,
|
|
hotkeys = true,
|
|
hotkeys_mode = 'sequential',
|
|
},
|
|
},
|
|
})
|
|
end,
|
|
})
|
|
|
|
vim.diagnostic.config({ virtual_text = false }) -- Disable default virtual text
|
|
vim.keymap.set('n', '<leader>.', function()
|
|
require('tiny-code-action').code_action()
|
|
end, { desc = 'Code action' })
|