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
Support inline error tooltip at cursor position #546
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,10 @@ def run(self, text): | |
if region.contains(pt): | ||
error_text = text | ||
break | ||
|
||
if len(error_text) > 0: | ||
self.view.set_status("typescript_error", error_text) | ||
else: | ||
self.view.erase_status("typescript_error") | ||
if PHANTOM_SUPPORT: | ||
template = '<body><style>div.error {{ background-color: brown; padding: 5px; color: white }}</style><div class="error">{0}</div></body>' | ||
display_text = template.format(error_text) | ||
self.view.add_phantom("typescript_error", self.view.sel()[0], display_text, sublime.LAYOUT_BLOCK) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting I don't see There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah it still exists in the latest version. I learnt it from the example at: |
||
self.view.set_status("typescript_error", error_text) |
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.
If
show_errors_inline
is set tofalse
, do phantoms still appear? As this is anif/else
, that would mean no error info. Is there a downside to always updating the status bar anyway?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.
Yes,
show_errors_inline
only affects sublime's own error tips, it doesn't toggle all phantom tooltips. Though I agree we can always update the status bar anyway.