You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, text2html is the correct thing to use here. But there are quite a few more places that need it. Everywhere we get disagnostic code, source or the relatedInformation[0]['message]
@rchl thanks for the confirmation! However, I am not sufficiently familiar with codebase to add that text2html in all required places, the PR will take some time=)
Describe the bug
If the
code
field of the diagnostic contains invalid html, the hover popup is brokenTo Reproduce
Steps to reproduce the behavior:
redundant <$>
hint (for example,inputForConfig config = (<> config) <$> standardIOConfig >>= inputForConfig
Expected behavior
Hover is properly formatted
Environment (please complete the following information):
Root cause
In the
format_diagnostics_for_html
method we append the contents ofdiagnostics["code"]
as-is, without escaping (https://github.com/sublimelsp/LSP/blob/main/plugin/core/views.py#L1006).As far as I understand, the specs of LSP say nothing about that field, it can be an arbitrary text. I suggest
the following diff:
I do not have a good idea on how it could impact other LSP servers, comments and suggestions are welcome.
I'll submit a PR sometime later this week.
Cheers!
The text was updated successfully, but these errors were encountered: