https://bugs.kde.org/show_bug.cgi?id=445085

            Bug ID: 445085
           Summary: LSP client addon: wrong text inserted when executing a
                    code completion
           Product: kate
           Version: Git
          Platform: Compiled Sources
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: kwrite-bugs-n...@kde.org
          Reporter: oldh...@gmail.com
  Target Milestone: ---

Created attachment 143284
  --> https://bugs.kde.org/attachment.cgi?id=143284&action=edit
wrong text inserted

SUMMARY
I am using Kate with LSP client addon to edit a Rust source file. When
executing a code completion, it inserted unexpected additional text `(as
XXXXXX)` into the editor. See the steps below for detail.

STEPS TO REPRODUCE
1. Open a Rust source file with LSP client addon enabled and running.
2. Type the following code into the editor.
```
fn main() {
    let mut s = String::new();    

}
```
3. Type `s.clone` on the empty line and wait for the completion to appear. The
first one is `clone (as Clone) [fn(&self) -> Self]` as the screenshot show,
which is correct.
4. Press ENTER to confirm that choice.

OBSERVED RESULT
See the screenshot.

The text ` (as Clone)()` get inserted. This is wrong behaviour because the `(as
Clone)` is a hint, not actual code. It doesn't compile with that inserted.

EXPECTED RESULT
It should just be `s.clone()`, without the `(as Clone)` in it.

SOFTWARE/OS VERSIONS
Arch Linux
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.23.2
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.2

Compiled kate LSP Client addon from git master branch commit
843b6103fbc7889cf292376b5319bead9d2e0e2d
rust-analyzer 2021-11-01

ADDITIONAL INFORMATION

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to