Skip to content

Conversation

@DanielGavin
Copy link
Owner

@DanielGavin DanielGavin commented Dec 14, 2025

Adds requested feature from: 1207

@BradLewis
Copy link
Collaborator

How do you trigger this code action?

@DanielGavin
Copy link
Owner Author

Vim:
:lua vim.lsp.buf.code_action { context = { only = { 'source.organizeImports' }, diagnostics = {} }, apply = true }
Vscode:
image

@BradLewis
Copy link
Collaborator

Thanks. I don't seem to be able to get it to work in either neovim or vscode:
image

@DanielGavin
Copy link
Owner Author

It only shows up if there are unused imports.

@BradLewis
Copy link
Collaborator

Ah okay I see that works now. On the go side, Organize Imports will also add any missing imports.

@DanielGavin
Copy link
Owner Author

Yeah seems like a good idea. It is a bit more work, but i'll try and see what I can do.

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.

3 participants