diff --git a/pyls/plugins/flake8_lint.py b/pyls/plugins/flake8_lint.py index 09ba0002..8ac70a84 100644 --- a/pyls/plugins/flake8_lint.py +++ b/pyls/plugins/flake8_lint.py @@ -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) } diff --git a/test/plugins/test_flake8_lint.py b/test/plugins/test_flake8_lint.py index 407e3365..9be54d27 100644 --- a/test/plugins/test_flake8_lint.py +++ b/test/plugins/test_flake8_lint.py @@ -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: