feat(plugin): replace Lspsaga with native LSP & Snacks integration
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.
This commit is contained in:
4 files changed
+14
-61
No files matched your search
@@ -2,7 +2,6 @@ add({
|
||||
'mason-org/mason.nvim', -- lsp installer manager
|
||||
'mason-org/mason-lspconfig.nvim', -- lsp installer
|
||||
'neovim/nvim-lspconfig', -- lsp config
|
||||
'nvimdev/Lspsaga.nvim', -- lsp ui
|
||||
'rachartier/tiny-inline-diagnostic.nvim', -- inline diagnostic
|
||||
'rachartier/tiny-code-action.nvim', -- code action
|
||||
})
|
||||
@@ -28,23 +27,6 @@ require('mason-lspconfig').setup({
|
||||
-- improve neovim lsp experience
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
callback = function()
|
||||
require('lspsaga').setup({
|
||||
ui = {
|
||||
theme = 'round',
|
||||
border = 'rounded',
|
||||
devicon = true,
|
||||
title = true,
|
||||
winblend = 1,
|
||||
expand = ' ',
|
||||
collapse = ' ',
|
||||
preview = '',
|
||||
code_action = ' ',
|
||||
diagnostic = ' ',
|
||||
incoming = ' ',
|
||||
outgoing = ' ',
|
||||
hover = ' ',
|
||||
},
|
||||
})
|
||||
|
||||
--inline diagnostic
|
||||
require('tiny-inline-diagnostic').setup({
|
||||
|
||||
@@ -11,9 +11,7 @@ add({
|
||||
'numToStr/Navigator.nvim', -- navigator
|
||||
'm4xshen/hardtime.nvim', -- workflow
|
||||
'mg979/vim-visual-multi', -- multiple cursors
|
||||
'pmizio/typescript-tools.nvim', -- typescript tools
|
||||
{ src = 'iamcco/markdown-preview.nvim', build = 'cd app && npm install' },
|
||||
'nvim-lua/plenary.nvim', -- dependency for typescript-tools
|
||||
-- 'nvim-flutter/flutter-tools.nvim', -- flutter tools
|
||||
})
|
||||
|
||||
@@ -69,27 +67,3 @@ vim.keymap.set('i', '<A-x>', function()
|
||||
return vim.fn['codeium#Clear']()
|
||||
end, { expr = true, silent = true })
|
||||
|
||||
-- typescript tools
|
||||
require('typescript-tools').setup({
|
||||
filetypes = { 'javascript', 'javascriptreact', 'typescript', 'typescriptreact' },
|
||||
settings = {
|
||||
separate_diagnostic_server = true,
|
||||
publish_diagnostic_on = 'insert_leave',
|
||||
expose_as_code_action = {
|
||||
'fix_all',
|
||||
'add_missing_imports',
|
||||
'remove_unused',
|
||||
'remove_unused_imports',
|
||||
'organize_imports',
|
||||
},
|
||||
tsserver_plugins = {},
|
||||
complete_function_calls = false,
|
||||
include_completions_with_insert_text = true,
|
||||
code_lens = 'off',
|
||||
disable_member_code_lens = true,
|
||||
jsx_close_tag = {
|
||||
enable = false,
|
||||
filetypes = { 'javascriptreact', 'typescriptreact' },
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -25,8 +25,6 @@ require("mini.files").setup({
|
||||
})
|
||||
|
||||
require("mini.misc").setup({
|
||||
-- restore cursor position on file reopen
|
||||
require("mini.misc").setup_restore_cursor(),
|
||||
-- automated change of current directory
|
||||
require("mini.misc").setup_auto_root(),
|
||||
})
|
||||
|
||||
+14
-15
@@ -129,21 +129,20 @@ local normal_mappings = {
|
||||
{ "<leader>it", ":put =strftime('## %r')<cr>", desc = "Time" },
|
||||
|
||||
{ "<leader>l", group = " LSP" },
|
||||
{ "<leader>la", ":Lspsaga code_action<cr>", desc = "Code Action" },
|
||||
{ "<leader>ld", ":Lspsaga goto_definition<cr>", desc = "Goto Definition" },
|
||||
{ "<leader>lf", ":Lspsaga finder<cr>", desc = "Finder" },
|
||||
{ "<leader>lh", ":Lspsaga hover_doc<cr>", desc = "Hover" },
|
||||
{ "<leader>la", ":lua vim.lsp.buf.code_action()<cr>", desc = "Code Action" },
|
||||
{ "<leader>ld", ":lua Snacks.picker.lsp_definitions()<cr>", desc = "Goto Definition" },
|
||||
{ "<leader>lf", ":lua Snacks.picker.lsp_references()<cr>", desc = "Finder (References)" },
|
||||
{ "<leader>lh", ":lua vim.lsp.buf.hover()<cr>", desc = "Hover" },
|
||||
{ "<leader>lI", ":LspInfo<cr>", desc = "LSP Info" },
|
||||
{ "<leader>lj", ":Lspsaga diagnostic_jump_next<cr>", desc = "Next Diagnostic" },
|
||||
{ "<leader>lk", ":Lspsaga diagnostic_jump_prev<cr>", desc = "Prev Diagnostic" },
|
||||
{ "<leader>lo", ":Lspsaga outline<cr>", desc = "Outline" },
|
||||
{ "<leader>lp", ":Lspsaga peek_definition<cr>", desc = "Peek Definition" },
|
||||
{ "<leader>lj", ":lua vim.diagnostic.goto_next()<cr>", desc = "Next Diagnostic" },
|
||||
{ "<leader>lk", ":lua vim.diagnostic.goto_prev()<cr>", desc = "Prev Diagnostic" },
|
||||
{ "<leader>lo", ":lua Snacks.picker.lsp_symbols()<cr>", desc = "Outline (Symbols)" },
|
||||
{ "<leader>lp", ":lua Snacks.picker.lsp_definitions()<cr>", desc = "Peek Definition" },
|
||||
{ "<leader>lq", ":LspStop<cr>", desc = "Stop LSP" },
|
||||
{ "<leader>lQ", ":LspRestart<cr>", desc = "Restart LSP" },
|
||||
{ "<leader>lr", ":Lspsaga rename<cr>", desc = "Rename" },
|
||||
{ "<leader>lR", ":Lspsaga project_replace<cr>", desc = "Replace" },
|
||||
{ "<leader>lt", ":Lspsaga goto_type_definition<cr>", desc = "Goto Type Definition" },
|
||||
{ "<leader>lT", ":Lspsaga peek_type_definition<cr>", desc = "Peek Type Definition" },
|
||||
{ "<leader>lr", ":lua vim.lsp.buf.rename()<cr>", desc = "Rename" },
|
||||
{ "<leader>lt", ":lua Snacks.picker.lsp_type_definitions()<cr>", desc = "Goto Type Definition" },
|
||||
{ "<leader>lT", ":lua Snacks.picker.lsp_type_definitions()<cr>", desc = "Peek Type Definition" },
|
||||
|
||||
{ "<leader>o", group = " Options" },
|
||||
{ "<leader>oi", "vim.show_pos", desc = "Inspect Position" },
|
||||
@@ -244,7 +243,7 @@ local visual_mappings = {
|
||||
{ "<leader>gu", ":'<,'>Gitsigns undo_stage_hunk<cr>", desc = "Undo Stage Hunk" },
|
||||
|
||||
{ "<leader>l", group = " LSP" },
|
||||
{ "<leader>la", ":<C-U>Lspsaga range_code_action<cr>", desc = "Code Action" },
|
||||
{ "<leader>la", ":lua vim.lsp.buf.code_action()<cr>", desc = "Code Action" },
|
||||
|
||||
-- { "<leader>o", group = " Options" },
|
||||
|
||||
@@ -270,7 +269,7 @@ local no_leader_mappings = {
|
||||
{ "<Tab>", ":bnext<cr>", desc = "Next Buffer" },
|
||||
{ "<S-Tab>", ":bprevious<cr>", desc = "Previous Buffer" },
|
||||
|
||||
{ "K", ":Lspsaga hover_doc<cr>", desc = "LSP Hover" },
|
||||
{ "K", ":lua vim.lsp.buf.hover()<cr>", desc = "LSP Hover" },
|
||||
{ "Q", ":qall!<cr>", desc = "Force Quit!" },
|
||||
{ "U", ":redo<cr>", desc = "Redo" },
|
||||
|
||||
@@ -282,7 +281,7 @@ local no_leader_mappings = {
|
||||
{ "]g", ":Gitsigns next_hunk<cr>", desc = "Git Hunk" },
|
||||
{ "]o", group = "Textobjects" },
|
||||
|
||||
{ "gd", ":Lspsaga goto_definition<cr>", desc = "Goto Definition" },
|
||||
{ "gd", ":lua Snacks.picker.lsp_definitions()<cr>", desc = "Goto Definition" },
|
||||
}
|
||||
|
||||
wk.add(normal_mappings)
|
||||
|
||||
Reference in new issue
Block a user