Update style for diagnostic annotations#2839
Conversation
plugin/core/views.py
Outdated
| message = text2html(diagnostic.get('message') or '') | ||
| source = diagnostic.get('source') | ||
| line = f"[{text2html(source)}] {message}" if source else message | ||
| line = f'{message} <span class="color-muted">[{text2html(source)}]</span>' if source else message |
There was a problem hiding this comment.
Lets remove square brackets since the color itself makes it stand out enough and also it will match better the appearance of diagnostics in the popup.
While writing this, I also though to maybe try to match appearance in the popup even more by making background colored. I'll try it out locally.
EDIT: Second suggestion doesn't work because ST adds some margins that can't be removed when there are multiple annotations on the same line. Also it changes text color of non-hovered items that makes text look bad.
There was a problem hiding this comment.
I thought about simply using the same style as in the popup. So for example pyright(E001) or pyright(reportSomethingHere). If a link for the linter rule is provided, it should even be possible to make that clickable. Maybe we should try that. It would take a bit more space, but if the message is too long, that information would be cut off first anyway.
There was a problem hiding this comment.
I've tested that, but I think it looks to busy with the link and it takes a bit too much space. So I'll just remove the brackets instead.
✅ Deploy Preview for sublime-lsp ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This is probably a controversal change, because I seem to be the only one who prefers the proportional font for diagnostic messages. But besides aesthetics, I think here this has a real advantage, because these annotation messages are sometimes cut off if they are too long and don't fit into the view.
I also applied the muted color to the
[source]and moved that to the end of the message, because it is less important than the message itself.Before:
After:
It also looks more consistent if there are code actions shown as annotations too (these screenshots also show how much space is saved):
Before:
After: