SUMMARY Double-clicking an [quickfix] action item in the LSP Diagnostics view has no effect anymore. STEPS TO REPRODUCE 1. Consider the following sample C++ code with activated LSP plugin int main() { std::string someString { "foo" }; return 0; } 2. Open the LSP diagnostics view The view should show the following content: [clang] (undeclared_var_use) Use of undeclared identifier 'std' (fix available) -> [quickfix] Include <string> for symbol std::string 3. Double-click on the line entry [quickfix] OBSERVED RESULT Nothing happens. EXPECTED RESULT The quickfix should be executed, i.e. the appropriate include statement should be inserted. SOFTWARE/OS VERSIONS Linux/KDE Plasma: KDE Plasma Version: 5.24.6 KDE Frameworks Version: 5.96.0 Qt Version: 5.15.5 ADDITIONAL INFORMATION Kate has been compiled with HEAD == e1b4bc5c
To help in identifying the issue cause in the code, I bisected kate with the following result: bccf9a58ab1bb6f435eb942b46a2931dd9aedd0d is the first bad commit commit bccf9a58ab1bb6f435eb942b46a2931dd9aedd0d Author: Mark Nauwelaerts <mark.nauwelaerts@gmail.com> Date: Wed Feb 9 21:47:26 2022 +0100 lspclient: use multiple items for a diagnostic item with embedded newlines addons/lspclient/lspclientpluginview.cpp | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) Funnily, my proposed test code did not exhibit a quickfix action anymore, so I worked on the following test code (put into test.cpp): int sensor; int main() { senSor = 0; return 0; }
Created attachment 151777 [details] Experimental patch that solves the reported issue The attached patch solves the issue for me locally. However, I'm not sure whether the patch is correct in call cases. If the only code actions that can be triggered are such quickfix actions, it might be okay.
Git commit 0a8d9fc97ac9d299e5941097cf449b346c3e0ce9 by Christoph Cullmann. Committed on 03/09/2022 at 18:48. Pushed by cullmann into branch 'master'. fix code actions M +1 -1 addons/lspclient/lspclientpluginview.cpp https://invent.kde.org/utilities/kate/commit/0a8d9fc97ac9d299e5941097cf449b346c3e0ce9
Git commit d754541824c6ca402c7d912299caef5012be2140 by Christoph Cullmann. Committed on 04/09/2022 at 14:28. Pushed by cullmann into branch 'release/22.08'. fix code actions (cherry picked from commit 0a8d9fc97ac9d299e5941097cf449b346c3e0ce9) M +1 -1 addons/lspclient/lspclientpluginview.cpp https://invent.kde.org/utilities/kate/commit/d754541824c6ca402c7d912299caef5012be2140
Thanks for integrating the patch. Checked again with a compile of current master (565b1004). Works as expected.