This would provide us a way to apply unused-includes fixts at once via
the right-click "Source Action" menu or "Organize imports" command
in VSCode.
Details
- Reviewers
kadircet
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang-tools-extra/clangd/ClangdLSPServer.cpp | ||
---|---|---|
1035 | instead of doing this in here, what about introducing a new "tweak" that'll perform include-cleaner fixes?
WDYT? | |
1072–1074 | what does the UI look like when there are multiple code actions with "organize imports" kind? |
clang-tools-extra/clangd/ClangdLSPServer.cpp | ||
---|---|---|
1035 | I think it is a matter of how we view it (whether it is a fix for all diagnostics or a tweak). but +1, yeah, this looks like a good idea to me. | |
1072–1074 |
Similar to the normal code action, if you trigger it via the right context menu (SourceAction), a window with 3 alternatives will pop up, so that you can select one of them (verified on VSCode).
Good point. The VSocde codeActionsOnSave behavior is like what you said -- it applies each fix one by one (because we trigger preview window per fix, so 3 preview windows will be triggered in sequence). I don't see the best way to fix it (from the codeAction requests are identical from the one sent via the context menu), one option is to send only a fixAll codeAction rather than 3. |
instead of doing this in here, what about introducing a new "tweak" that'll perform include-cleaner fixes?
Pros are:
WDYT?