Created attachment 172867 [details] screenshot of the issue SUMMARY When I'm using the LSP plugin, the popup starts to appear and get sized right before all of the text response for the language server has come in. This means that the LSP plugin frequently makes the box slightly to small to avoid scrolling (especially horizontal scrolling), which is extremely annoying. The incorrect box size also seems to cause soft wrapping of language server results that already *hard* wrapped - making them very difficult to read. Another side effect of this is that if you hover over something, move the cursor off, then move back a second later, you might get a box with a *completely* different size, which is pretty jarring. STEPS TO REPRODUCE 1. Hover over some common types like Strings with the rust-analyzer plugin enabled. OBSERVED RESULT See summary and attached screenshot. EXPECTED RESULT The box should pick a size that is reasonable. Hard wrapped text should never be shown. If the text is soft wrapped, then you never need to show a horizontal scrollbar in a small popup box, which is a really good thing. SOFTWARE/OS VERSIONS Operating System: Arch Linux KDE Plasma Version: 6.1.4 KDE Frameworks Version: 6.5.0 Qt Version: 6.7.2 Kernel Version: 6.10.5-arch1-1 (64-bit) Graphics Platform: Wayland
Git commit 9683da08798b327b8d41d80123a6773e9246821c by Waqar Ahmed. Committed on 23/08/2024 at 08:05. Pushed by waqar into branch 'master'. Dont insert line breaks in tooltip M +0 -1 apps/lib/texthint/tooltip.cpp https://invent.kde.org/utilities/kate/-/commit/9683da08798b327b8d41d80123a6773e9246821c
(In reply to Waqar Ahmed from comment #1) > Git commit 9683da08798b327b8d41d80123a6773e9246821c by Waqar Ahmed. > Committed on 23/08/2024 at 08:05. > Pushed by waqar into branch 'master'. This fixes most of the issue for me, thanks! I'm still seeing problems in a few cases where a code block in the documentation causes scrolling in a case where a slightly larger box would solve the problem. E.g. hovering a `std::string::String` in Rust. The documentation has the following line - in a *code* block, which is significant: // unsafe because we are responsible for making sure the components are that's 72 characters wide, I think that's a reasonable amount of text to try to show in one line in a popup box. The popup box seems to be limited to about 40% of the text area width plus some (very small) minimum size, which seems just too small in a lot of cases. In my opinion, soft wrapping text that extends too far would be preferable to adding a horizontal scroll bar. Horizontal scrollbars make text nearly impossible to read because you have to scroll back and forth on every affected line. (They also behave badly with a lot of touchpads because you don't have that much control over whether you drag left or right as you scroll up and down.)
Created attachment 172879 [details] screenshot of issue with large window size Here's a screenshot to show what I mean. I have a huge window, and the LSP box is refusing to use it, instead inserting a scrollbar to get 10 or so more pixels. As an aside, it would be a nice feature addition to allow changing the size of the text in the popup box. I'd like to set it to 1px or 2px smaller than the text in my editor, which would also allow the box to have a bit more room.
Lets stick to 1 issue per bug report. Soft wrapping is nice, I agree, but it also makes some thing not easy e.g., for softwrapping to work there needs to be some width. And it makes calculating the final size of the tooltip a bit difficult. Its not impossible though, just no one has put in the effort yet.
Git commit af5d2c83457fe4e788fc7d465f387fe90e707b76 by Waqar Ahmed. Committed on 23/08/2024 at 18:21. Pushed by waqar into branch 'release/24.08'. Dont insert line breaks in tooltip (cherry picked from commit 9683da08798b327b8d41d80123a6773e9246821c) M +0 -1 apps/lib/texthint/tooltip.cpp https://invent.kde.org/utilities/kate/-/commit/af5d2c83457fe4e788fc7d465f387fe90e707b76