Skip to content

Commit

Permalink
Default syntax error offset to zero pyflakes (#332)
Browse files Browse the repository at this point in the history
* Default to zero

* Default to zero
  • Loading branch information
gatesn authored Apr 16, 2018
1 parent 00e0c10 commit 0ddfa44
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pyls/plugins/pyflakes_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ def unexpectedError(self, filename, msg): # pragma: no cover
pass

def syntaxError(self, _filename, msg, lineno, offset, text):
# We've seen that lineno and offset can sometimes be None
lineno = lineno or 1
offset = offset or 0

err_range = {
'start': {'line': lineno - 1, 'character': offset},
'end': {'line': lineno - 1, 'character': offset + len(text)},
Expand Down

0 comments on commit 0ddfa44

Please sign in to comment.