Bug 458554 - LSP plugin quickfix action has no effect anymore
Summary: LSP plugin quickfix action has no effect anymore
Status: VERIFIED FIXED
Alias: None
Product: kate
Classification: Applications
Component: application (show other bugs)
Version: Git
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-31 14:27 UTC by Markus Pister
Modified: 2022-09-05 12:34 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Experimental patch that solves the reported issue (589 bytes, patch)
2022-09-02 08:20 UTC, Markus Pister
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Pister 2022-08-31 14:27:03 UTC
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
Comment 1 Markus Pister 2022-09-02 05:49:57 UTC
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;
}
Comment 2 Markus Pister 2022-09-02 08:20:18 UTC
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.
Comment 3 Christoph Cullmann 2022-09-03 18:48:55 UTC
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
Comment 4 Christoph Cullmann 2022-09-04 14:28:04 UTC
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
Comment 5 Markus Pister 2022-09-05 12:34:31 UTC
Thanks for integrating the patch.

Checked again with a compile of current master (565b1004). Works as expected.