Skip to content

Commit

Permalink
Fix flake8 line indexing (#674)
Browse files Browse the repository at this point in the history
  • Loading branch information
youben11 authored and ccordoba12 committed Oct 14, 2019
1 parent fecffb2 commit 8db7654
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pyls/plugins/flake8_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ def parse_report(document, report):
'code': code,
'range': {
'start': {
'line': line,
'line': line - 1,
'character': character
},
'end': {
'line': line,
'line': line - 1,
# no way to determine the column
'character': len(physical_line)
}
Expand Down
4 changes: 2 additions & 2 deletions test/plugins/test_flake8_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def test_flake8_lint(config):

assert unused_var['source'] == 'flake8'
assert unused_var['code'] == 'F841'
assert unused_var['range']['start'] == {'line': 6, 'character': 1}
assert unused_var['range']['end'] == {'line': 6, 'character': 11}
assert unused_var['range']['start'] == {'line': 5, 'character': 1}
assert unused_var['range']['end'] == {'line': 5, 'character': 11}
assert unused_var['severity'] == lsp.DiagnosticSeverity.Warning

finally:
Expand Down

0 comments on commit 8db7654

Please sign in to comment.