I'm using tslint-language-service, and it works fine except for rules like semicolon or trailing-comma. The diagnostics produced by these rules correctly end up in Sublime, but they don't get rendered because they appear inside an empty region at the end of the line and Sublime refuses to render them:
I've added a quick workaround, like this:
diff --git typescript/listeners/idle.py typescript/listeners/idle.py
index f48df56..30e6a8f 100644
--- typescript/listeners/idle.py
+++ typescript/listeners/idle.py
@@ -146,6 +146,9 @@ class IdleListener:
# character instead so user can still see the highlight.
if start == view.size() and start == end:
region = last_visible_character_region(view)
+ elif start == view.line(start).end() and start == end:
+ end = view.text_point(start_line + 1, 0)
+ region = sublime.Region(start, end)
else:
region = sublime.Region(start, end)
which seems to at least put a small red squiggle at the end of the line:
but hovering over it to get the message doesn't work. It also seems that the issue is more general, in that any region that only contains whitespace does not show up, e.g. when I add some trailing spaces:
so while this is a conservative change that solves this specific issue with semicolon and trailing-comma, I'm not sure this is the right solution in the general case. SublimeLinter adds a gutter mark for empty regions, so maybe that's a viable solution?
I'm using
tslint-language-service
, and it works fine except for rules likesemicolon
ortrailing-comma
. The diagnostics produced by these rules correctly end up in Sublime, but they don't get rendered because they appear inside an empty region at the end of the line and Sublime refuses to render them:I've added a quick workaround, like this:
which seems to at least put a small red squiggle at the end of the line:
but hovering over it to get the message doesn't work. It also seems that the issue is more general, in that any region that only contains whitespace does not show up, e.g. when I add some trailing spaces:
so while this is a conservative change that solves this specific issue with
semicolon
andtrailing-comma
, I'm not sure this is the right solution in the general case. SublimeLinter adds a gutter mark for empty regions, so maybe that's a viable solution?For reference, this behaves properly in VSCode: