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

Apply lsp commands #1130

merged 3 commits into from
Feb 4, 2025

Conversation

jhgarner
Copy link
Contributor

If the lsp returns commands to run on completion, we now execute them. This is helpful for the Haskell language server which uses commands to implement auto-importing.

If the lsp returns commands to run on completion, we now execute them.
This is helpful for the Haskell language server which uses commands to
implement auto-importing.
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.

@Saghen Saghen merged commit 2de57ce into Saghen:main Feb 4, 2025
3 checks passed
@Saghen
Copy link
Owner

Saghen commented Feb 4, 2025

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants