eclipse-cdt / cdt-lsp

Eclipse CDT™ LSP Extensions for CDT
Eclipse Public License 2.0
25 stars 11 forks source link

Symbol hover showing raw XML #365

Closed rc-jpbarbosa closed 3 weeks ago

rc-jpbarbosa commented 4 weeks ago

When hovering over a variable, type, or function I am seeing a XML (XHTML?) block being displayed instead of the expected symbol definition. This only seems to be an issue with the LSP editor -- the standard CDT editor displays the hover information fine.

This happens when hovering over symbols. Clang-tidy warning text seems to display fine.

I am on Linux (WSL), if that makes a difference.

Untitled

Versions

ghentschke commented 3 weeks ago

Hm, this seems to be an Linux issue. Which Eclipse and CDT Version are you running?

rc-jpbarbosa commented 3 weeks ago

I've added some version info to the issue body

ghentschke commented 3 weeks ago

I think this is a gtk bug. I see in Eclipse running under WSL 2 the following entries: (Eclipse:11172): Gtk-CRITICAL **: 10:15:14.289: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkScrollbar

ghentschke commented 3 weeks ago

I debugged it a little. I think the problem is the hover provider org.eclipse.lsp4e.operations.hover.LSPTextHover by the LSP4E plugin. Especially the method org.eclipse.lsp4e.operations.hover.LSPTextHover.getHoverControlCreator() has a problem in WSL2

ghentschke commented 3 weeks ago

I found the cause. You have to install webkit in your Linux distribution. sudo apt install libwebkit2gtk-4.0-dev Then it should work: image

rc-jpbarbosa commented 3 weeks ago

Confirmed installing webkit fixed the problem for me. Thank you!