emacs-lsp / lsp-ui

UI integrations for lsp-mode
https://emacs-lsp.github.io/lsp-ui
GNU General Public License v3.0
1.03k stars 141 forks source link

Add HTML space rendering to lsp-ui-doc #754

Open gbrlgn opened 12 months ago

gbrlgn commented 12 months ago

Some LSPs might end up rendering some spaces as HTML, such as what is happening in the YAML Language Server, since a commit introduced this kind of weird spacing that parses &emsp for spaces, whose are rendered literally by lsp-ui-doc as depicted below:

yamlls

This happens in all instances of lsp-ui-doc, be it the hover box or the minibuffer, as these characters are coming directly from the language server responses. Ideally, they shouldn't even get rendered, as this kind of spacing would look awkward, but the fact that these characters are getting rendered as plaintext confuses and annoys me.

Some users in the Neovim community have come up with some workarounds but I don't really know if they're needed in this situation, however, I think they might also be taken as a clue for whatever is happening here.