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

            Bug ID: 504762
           Summary: Kate with rust-analyzer messes up code badly on save
    Classification: Applications
           Product: kate
      Version First 25.04.1
       Reported In:
          Platform: Arch Linux
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: application
          Assignee: kwrite-bugs-n...@kde.org
          Reporter: kimim...@posteo.net
  Target Milestone: ---

Created attachment 181726
  --> https://bugs.kde.org/attachment.cgi?id=181726&action=edit
A video demonstrating the bug with improperly formatting code

SUMMARY
Kate's LSP client with rust-analyzer regularly messes up code when saving.

STEPS TO REPRODUCE
1. Download the source code at
https://codeberg.org/kimimaru/UinputVirtualDevices or clone with Git
2. Open the project in Kate with rust-analyzer installed as an LSP client
3. Open virtual_joystick.rs file and save it without making any changes. You
may need to save more than once to trigger it.

OBSERVED RESULT
The code will be formatted in a way that often makes a big mess, constantly
switching between two different variants for imports at the top for example.
And also towards the bottom of the file, where it'll will leave big gaps for
some reason.
The most common formatting problem is that it adds an extra comma at the start
of the line after arguments, and sometimes it even duplicates arguments. I find
myself having to counterproductivively manually clean up all of the formatting
changes the LSP client should be helping me with.

EXPECTED RESULT
The code is formatted properly and doesn't cause compiler errors and require
manual cleanup.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: EndeavourOS (Linux kernel 6.14.7-arch2-1 64-bit)
KDE Plasma Version: 6.3.5
KDE Frameworks Version: 6.14.0
Qt Version: 6.9.0
Graphics Platform: Wayland

ADDITIONAL INFORMATION
The problem occurs even with all settings turned off in LSP Client > Client
Settings.

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

Reply via email to