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

Nice error message if the `VirtualView` throws #1379

Open
kaste opened this Issue May 4, 2018 · 0 comments

Comments

1 participant
@kaste
Contributor

kaste commented May 4, 2018

If the linter reports errors referring lines not in the view, we get a traceback here

Linter crashed.

Traceback (most recent call last):
  File "C:\Users\marce\AppData\Roaming\Sublime Text 3\Packages\SublimeLinter\lint\backend.py", line 87, in execute_lint_task
    errors = linter.lint(code, view_has_changed, settings) or []
  File "C:\Users\marce\AppData\Roaming\Sublime Text 3\Packages\SublimeLinter\lint\linter.py", line 726, in lint
    return self.parse_output(output, virtual_view)
  File "C:\Users\marce\AppData\Roaming\Sublime Text 3\Packages\SublimeLinter\lint\linter.py", line 747, in parse_output
    return self.parse_output_via_regex(output, virtual_view)
  File "C:\Users\marce\AppData\Roaming\Sublime Text 3\Packages\SublimeLinter\lint\linter.py", line 767, in parse_output_via_regex
    error = self.process_match(m, virtual_view)
  File "C:\Users\marce\AppData\Roaming\Sublime Text 3\Packages\SublimeLinter\lint\linter.py", line 848, in process_match
    start, end = vv.full_line(m.line)
  File "C:\Users\marce\AppData\Roaming\Sublime Text 3\Packages\SublimeLinter\lint\linter.py", line 83, in full_line
    start = self._newlines[line]
IndexError: list index out of range

Usually, this means the linter reports errors from other files as well. (Or, the regex is broken.)

We should show a nicer error message here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment