New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Combine error tooltip with quick info #562
Conversation
@zhengbli I like this one :D |
+1 :D |
@@ -92,7 +92,7 @@ def escape_html(raw_string): | |||
|
|||
Note: only use for short strings | |||
""" | |||
return raw_string.replace('&', '&').replace('<', '<').replace('>', ">") | |||
return raw_string.replace('&', '&').replace('<', '<').replace('>', '>').replace('\n', '<br>').replace(' ', ' ') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be <br />
, not <br>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<br />
actually doesn't work, only <br>
is working. This seems to be undocumented though
if region.contains(pt): | ||
error_text = text | ||
break | ||
for (region, text) in client_info.errors['semanticDiag']: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One problem I notice with this approach is that it only handles one error at a time. Also, it requires a full iteration of all the diagnostics. But we could fix this another time.
Looks good apart from what I can see (apart from nits). |
@zhengbli is it possible to combine TypeScript tooltip with SublimeLinter TSlint tooltip? In VS Code they are combined in one tooltip. |
We learned from user feedback that the initial implementation of the inline error tooltip is annoying and gets in the way of typing. This PR changes the implementation to show the error tip during mouse hovering, which is the same behavior with VSCode and VS.
Now the quick info hover tooltip is combined with the error tooltip, so if there is no error in the position, only quick info should be shown:
otherwise both will be shown: