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

Apply lsp commands #1130

Merged
merged 3 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion docs/development/lsp-tracker.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@
- [x] `textEditText`
- [x] `additionalTextEdits` <- known issue where applying the main text edit will cause this to be wrong if the additional text edit comes after since the indices will be offset
- [ ] `commitCharacters`
- [ ] `command`
- [x] `command`
- [x] `data` <- Don't think there's anything special to do here
8 changes: 8 additions & 0 deletions lua/blink/cmp/sources/lsp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,12 @@ function lsp:get_signature_help(context, callback)
end)
end

--- Execute ---

function lsp:execute(_, item)
local client = vim.lsp.get_client_by_id(item.client_id)
if client and item.command then client.request('workspace/executeCommand', item.command) end
return function() end
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't figure out what this returned function was supposed to do. The other example I saw returned an empty function so I return an empty one here as well. Let me know if something else should be happening instead.

end

return lsp
Loading