Skip to content
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

Merged
merged 1 commit into from Dec 9, 2016
Merged

Combine error tooltip with quick info #562

merged 1 commit into from Dec 9, 2016

Conversation

zhengbli
Copy link
Contributor

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:
image
otherwise both will be shown:
image

@roblav96
Copy link

@zhengbli I like this one :D

@lindelleric
Copy link

+1 :D

@@ -92,7 +92,7 @@ def escape_html(raw_string):

Note: only use for short strings
"""
return raw_string.replace('&', '&amp;').replace('<', '&lt;').replace('>', "&gt;")
return raw_string.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;').replace('\n', '<br>').replace(' ', '&nbsp;')
Copy link
Member

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>?

Copy link
Contributor Author

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']:
Copy link
Member

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.

@DanielRosenwasser
Copy link
Member

Looks good apart from what I can see (apart from nits).

@zhengbli zhengbli merged commit ac15373 into master Dec 9, 2016
@zhengbli zhengbli deleted the hoverErrorTip branch December 9, 2016 03:56
@serhiipalash
Copy link

@zhengbli is it possible to combine TypeScript tooltip with SublimeLinter TSlint tooltip?

In VS Code they are combined in one tooltip.

screen shot 2018-03-18 at 2 18 05 pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants