Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable annoying Sublime Text 3 inline error message (Typescript)

Recently (perhaps after an update?) Sublime Text 3 began showing these highly annoying, obtrusive error message popups whenever the text cusor is over a syntax error.

The worst thing about these popups is that, as you can see from the picture below, they do not hover over the text; rather, they cause all of the text below them to jump down a row in order to make room for the message:

screenshot

Maybe somebody somewhere likes this behavior, but it has been driving me crazy and I can't figure out how to disable it. I don't need the popup at all; the message in the status bar is enough for me.

I tried setting "show_errors_inline" to false in the user settings to no avail. Help would be appreciated. Thanks!

like image 506
JayArby Avatar asked Nov 15 '16 19:11

JayArby


1 Answers

As I discovered thanks to Keith Hall and this GitHub page, it turns out this is a "feature" of Microsoft's Typescript plugin.

To disable it, edit the following file (this is on Windows; obviously the path will be somewhat different on another system):

C:\Users\YourUserNameHere\AppData\Roaming\Sublime Text 3\Packages\TypeScript\typescript\commands\error_info.py

Comment out lines 26-29 of that file as shown below:

...
if len(error_text) > 0:
  #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)
self.view.set_status("typescript_error", error_text)

Then restart the editor.

like image 93
JayArby Avatar answered Sep 19 '22 21:09

JayArby