Skip to content

Text hint improvements

This is a work in progress. Feedback appreciated! I will post before-after screenshots if anyone is interested but otherwise you can build kate from source.

On master, the tooltips have started breaking recently. Hovering over a token with an LSP running and slightly moving the cursor over the same token appends the same content twice. In addition, the markdown roundtrip on each content addition to the tooltip broke the escaping and started adding more \\\\.

On a high level, I started tracking the mapping between KateTextHintProvider and their most recent hints. So, moving the mouse cursor from one token to another should correctly track provider hints. An empty hint should just remove it.

I added another panel called "Hint View" to provide the same functionality as hover but using keyboard based cursor movements. I use this feature a lot in haskell when I can just put in a hole _ and let the LSP tell me the type of the hole.

The tooltips now use a mixed set of fonts and not always monospace, to pack more visible content in a tooltip.

Additionally, markdown with mixed code content is a bad fit (in some cases) to be handled by KSyntaxHighlighting. So, I added a toggle to disable syntax highlighting in tooltips.

The commit messages are work-in-progress. Please look at the entire diff as a whole (for now).


Remaining TODO items

  • Tooltip sizing logic needs some work (we are rendering markdown and font metrics are no longer very useful)
  • Theme in the "Hint View" panel
  • Find out why "Show Hover Information" action does not work

Merge request reports

Loading