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

Option to show name of the LSP in code actions #825

Merged
merged 6 commits into from
Feb 3, 2023
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ Default options:
```lua
code_action = {
num_shortcut = true,
show_server_name = false,
keys = {
-- string | table type
quit = "q",
Expand Down
4 changes: 4 additions & 0 deletions lua/lspsaga/codeaction.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ function act:action_callback()
if client_with_actions[2].title then
action_title = indent .. index .. ' ' .. client_with_actions[2].title
end
if config.code_action.show_server_name == true then
local name = vim.lsp.get_client_by_id(client_with_actions[1]).name
action_title = action_title .. ' ' .. name
end
table.insert(contents, action_title)
end

Expand Down
1 change: 1 addition & 0 deletions lua/lspsaga/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ local default_config = {
},
code_action = {
num_shortcut = true,
show_server_name = false,
keys = {
quit = 'q',
exec = '<CR>',
Expand Down