Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(lspsaga): align options with official doc and update config #898

Merged
merged 1 commit into from
Jul 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
160 changes: 95 additions & 65 deletions lua/modules/configs/completion/lspsaga.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,38 +26,31 @@ return function()
set_sidebar_icons()

require("lspsaga").setup({
scroll_preview = {
scroll_down = "<C-j>",
scroll_up = "<C-k>",
-- 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 = "<CR>",
jump_to = "e",
edit = "e",
vsplit = "v",
split = "s",
tabe = "t",
tabnew = "n",
quit = "q",
shuttle = "[]",
toggle_or_req = "u",
close = "<Esc>",
},
},
definition = {
keys = {
edit = "<C-c>o",
vsplit = "<C-c>v",
split = "<C-c>s",
tabe = "<C-c>t",
close = "<C-c>q",
quit = "q",
},
},
-- https://dev.neovim.pro/lspsaga/codeaction/
code_action = {
num_shortcut = true,
show_server_name = true,
Expand All @@ -67,95 +60,127 @@ return function()
exec = "<CR>",
},
},
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 = "<C-c>o",
vsplit = "<C-c>v",
split = "<C-c>s",
tabe = "<C-c>t",
quit = "q",
close = "<C-c>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",
toggle_or_jump = "<CR>",
quit_in_show = { "q", "<Esc>" },
},
},
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 = "<C-c>",
select = "x",
exec = "<CR>",
shuttle = "[]",
toggle_or_open = "<CR>",
vsplit = "v",
split = "s",
tabe = "t",
tabnew = "n",
quit = "q",
close = "<Esc>",
},
},
-- 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 = "<CR>",
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 = "<Esc>",
quit = "<C-c>",
exec = "<CR>",
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
Expand Down Expand Up @@ -198,5 +223,10 @@ return function()
Value = { icons.kind.Value, "LspKindValue" },
},
},
-- https://dev.neovim.pro/lspsaga/misc/#scrolling-keymaps
scroll_preview = {
scroll_down = "<C-j>",
scroll_up = "<C-k>",
},
})
end