Fix issues causing Remove Unused Imports to not show up in VS Code#2720
Fix issues causing Remove Unused Imports to not show up in VS Code#2720ahoppen wants to merge 1 commit into
Remove Unused Imports to not show up in VS Code#2720Conversation
We had two issues here: 1. VS Code does not show code actions with kind `sourceOrganizeImports` in the lightbulb menu. Change it to `empty` so that it does show up. 2. We didn’t declare the command in `SwiftLanguageService`, so VS Code didn’t know to invoke SourceKit-LSP to perform the `remove.unused.imports.command`
|
@swift-ci Please test |
|
How about providing |
|
I haven’t been able to figure out when VS Code shows |
|
I looked into this and tested locally:
So to support this, we need to advertise |
|
Oh, interesting. Thanks for investigating this, Rintaro. I just thought about this a bit more and I think that
So, I would continue with the implementation as it is in this PR. What do you think? |
THE standard implementation does remove unused imports, fwiw. But it's true it's mainly for sorting them.
But That said, I'm totally fine with going with
Why |
We had two issues here:
sourceOrganizeImportsin the lightbulb menu. Change it toemptyso that it does show up.SwiftLanguageService, so VS Code didn’t know to invoke SourceKit-LSP to perform theremove.unused.imports.command