diff --git a/lua/modules/configs/completion/lspsaga.lua b/lua/modules/configs/completion/lspsaga.lua index 3b760f054..5cb0c64a2 100644 --- a/lua/modules/configs/completion/lspsaga.lua +++ b/lua/modules/configs/completion/lspsaga.lua @@ -26,38 +26,31 @@ return function() set_sidebar_icons() require("lspsaga").setup({ - scroll_preview = { - scroll_down = "", - scroll_up = "", + -- Breadcrumbs: https://dev.neovim.pro/lspsaga/breadcrumbs/ + symbol_in_winbar = { + enable = true, + separator = " " .. icons.ui.Separator, + hide_keyword = false, + show_file = false, + folder_level = 1, + color_mode = true, + delay = 100, }, - request_timeout = 3000, - finder = { - silent = true, - default = "def+ref+imp", + -- https://dev.neovim.pro/lspsaga/callhierarchy/ + callhierarchy = { layout = "float", - filter = {}, keys = { - shuttle = "[]", - toggle_or_open = "", - jump_to = "e", + edit = "e", vsplit = "v", split = "s", tabe = "t", - tabnew = "n", quit = "q", + shuttle = "[]", + toggle_or_req = "u", close = "", }, }, - definition = { - keys = { - edit = "o", - vsplit = "v", - split = "s", - tabe = "t", - close = "q", - quit = "q", - }, - }, + -- https://dev.neovim.pro/lspsaga/codeaction/ code_action = { num_shortcut = true, show_server_name = true, @@ -67,22 +60,33 @@ return function() exec = "", }, }, - lightbulb = { - enable = false, - sign = true, - sign_priority = 20, - virtual_text = false, + -- https://dev.neovim.pro/lspsaga/definition/ + definition = { + width = 0.6, + height = 0.5, + keys = { + edit = "o", + vsplit = "v", + split = "s", + tabe = "t", + quit = "q", + close = "q", + }, }, + -- https://dev.neovim.pro/lspsaga/diagnostic/ diagnostic = { + show_code_action = true, + jump_num_shortcut = true, max_width = 0.5, max_height = 0.6, text_hl_follow = true, - show_code_action = true, border_follow = true, - diagnostic_only_current = false, - extend_relatedInformation = false, - jump_num_shortcut = true, + extend_relatedInformation = true, show_layout = "float", + show_normal_height = 10, + max_show_width = 0.9, + max_show_height = 0.6, + diagnostic_only_current = false, keys = { exec_action = "r", quit = "q", @@ -90,72 +94,93 @@ return function() quit_in_show = { "q", "" }, }, }, - rename = { - in_select = false, - auto_save = false, + -- https://dev.neovim.pro/lspsaga/finder/ + finder = { + max_height = 0.5, + left_width = 0.3, + right_width = 0.3, + default = "def+ref+imp", + methods = {}, + layout = "float", + filter = {}, + silent = false, keys = { - quit = "", - select = "x", - exec = "", + shuttle = "[]", + toggle_or_open = "", + vsplit = "v", + split = "s", + tabe = "t", + tabnew = "n", + quit = "q", + close = "", }, }, + -- https://dev.neovim.pro/lspsaga/hover/ hover = { max_width = 0.3, max_height = 0.7, open_link = "gl", - open_browser = "silent !" .. require("core.settings").external_browser, + open_cmd = "silent !" .. require("core.settings").external_browser, + }, + -- https://dev.neovim.pro/lspsaga/implement/ + implement = { + enable = true, + sign = true, + virtual_text = false, + priority = 100, + }, + -- https://dev.neovim.pro/lspsaga/lightbulb/ + lightbulb = { + enable = false, + sign = true, + virtual_text = false, + debounce = 10, + sign_priority = 20, }, + -- https://dev.neovim.pro/lspsaga/outline/ outline = { win_position = "right", win_width = 30, auto_preview = false, + detail = false, auto_close = true, close_after_jump = true, - detail = false, layout = "normal", + max_height = 0.5, + left_width = 0.3, keys = { toggle_or_jump = "", - jump = "o", quit = "q", + jump = "o", }, }, - symbol_in_winbar = { - enable = true, - separator = " " .. icons.ui.Separator, - hide_keyword = false, - show_file = false, - color_mode = true, - }, - implement = { - enable = true, - sign = true, - virtual_text = false, - }, - callhierarchy = { - layout = "float", + -- https://dev.neovim.pro/lspsaga/rename/ + rename = { + in_select = false, + auto_save = false, + project_max_width = 0.5, + project_max_height = 0.5, keys = { - edit = "e", - vsplit = "v", - split = "s", - tabe = "t", - quit = "q", - shuttle = "[]", - toggle_or_req = "u", - close = "", + quit = "", + exec = "", + select = "x", }, }, + -- https://dev.neovim.pro/lspsaga/misc/#beacon beacon = { enable = true, frequency = 12, }, + -- https://dev.neovim.pro/lspsaga/misc/#generic-ui-options ui = { - title = true, - devicon = true, border = "single", -- Can be single, double, rounded, solid, shadow. - actionfix = icons.ui.Spell, + devicon = true, + title = true, expand = icons.ui.ArrowClosed, collapse = icons.ui.ArrowOpen, code_action = icons.ui.CodeAction, + actionfix = icons.ui.Spell, + lines = { "┗", "┣", "┃", "━", "┏" }, imp_sign = icons.kind.Implementation, kind = { -- Kind @@ -198,5 +223,10 @@ return function() Value = { icons.kind.Value, "LspKindValue" }, }, }, + -- https://dev.neovim.pro/lspsaga/misc/#scrolling-keymaps + scroll_preview = { + scroll_down = "", + scroll_up = "", + }, }) end