Created attachment 162102 [details] Working and non working tooltip SUMMARY When using kate with rust LSP, I sometime get miss displayed tooltips when hovering on variables or types, It looks like html is leaking as plain text (see screenshot). It seem to mainly occur when the corresponding rust code doesn't not compile. STEPS TO REPRODUCE 1. Write non compiling rust code 2. Turn on rust LSP OBSERVED RESULT Error tooltip shows HTML markers EXPECTED RESULT Error tooltip should display correctly SOFTWARE/OS VERSIONS Linux/KDE Plasma: Kde neon KDE Plasma Version: 5.27.7 KDE Frameworks Version: 5.110.0 Qt Version: 5.15.10 ADDITIONAL INFORMATION
Would help if you provide example rust code
Sorry, here a simple example ``` async fn main() -> Result<(), dyn std::error::Error> { std::thread::sleep(std::time::Duration::from_secs(2)) } ``` I get ``` [rustc] (E0308) mismatched types expected enum Result<(), (dyn std::error::Error + 'static)> found unit type () [main.rs:1] expected Result<(), (dyn std::error::Error + 'static)> because of return type [main.rs:2] try adding an expression at the end of the block: ; Ok(()) ``` I tried removing the async keyword, and the tooltip displays correctly then. ``` [rust-analyzer] (E0308) expected Result<(), dyn Error>, found () ```
I have tried multiple times but I can't see a broken tooltip. I only see the following tooltip and a different one which shows the description of symbol under cursor along with the error below ``` [rust-analyzer] (E0308) expected Result<(), dyn Error>, found () ``` --- My rust analyzer version is: ``` rust-analyzer --version rust-analyzer 1.71.0 (8ede3aa 2023-07-12) ```
Sorry this is the tooltip I see: ``` [rust-analyzer] (type-mismatch) expected Result<(), dyn Error>, found () ```
Created attachment 162124 [details] rustin
Created attachment 162125 [details] rustout
Maybe something to do with locales? ``` $ rust-analyzer --version && kate --version && env | grep 'LC_*' rust-analyzer 1.74.0-nightly (65ea825 2023-09-18) QSocketNotifier: Can only be used with threads started with QThread kate 23.08.1 LC_ADDRESS=fr_FR.UTF-8 LC_NAME=fr_FR.UTF-8 LC_MONETARY=fr_FR.UTF-8 LC_PAPER=fr_FR.UTF-8 LC_IDENTIFICATION=en_US.UTF-8 LC_RESPONSE=POSIX LC_TELEPHONE=fr_FR.UTF-8 LC_MESSAGES=POSIX LC_MEASUREMENT=fr_FR.UTF-8 LC_CTYPE=en_US.UTF-8 LC_TIME=fr_FR.UTF-8 LC_COLLATE=en_US.UTF-8 LC_NUMERIC=fr_FR.UTF-8 ``` I changed LSP to be script that does the following ``` tee /tmp/lsp/rustin | rustup run nightly rust-analyzer "$@" | tee /tmp/lsp/rustout ``` loaded the file containing the example code and displayed the tooltip (which displayed incorrectly). rustin and rustout are provided in attachments
Reproduced after upgrading rust-analyzer
Git commit b20feef77ca830684ce8570e59e63830791c28a5 by Waqar Ahmed. Committed on 10/10/2023 at 08:51. Pushed by waqar into branch 'master'. Use plainText for diagnostic tooltip M +2 -2 apps/lib/diagnostics/diagnosticview.cpp https://invent.kde.org/utilities/kate/-/commit/b20feef77ca830684ce8570e59e63830791c28a5