diff --git a/pylsp/plugins/flake8_lint.py b/pylsp/plugins/flake8_lint.py index 5c77e1d3..6be83b99 100644 --- a/pylsp/plugins/flake8_lint.py +++ b/pylsp/plugins/flake8_lint.py @@ -173,6 +173,9 @@ def parse_stdout(document, stdout): character = int(character) - 1 # show also the code in message msg = code + ' ' + msg + severity = lsp.DiagnosticSeverity.Warning + if code[0] == "E": + severity = lsp.DiagnosticSeverity.Error diagnostics.append( { 'source': 'flake8', @@ -189,7 +192,7 @@ def parse_stdout(document, stdout): } }, 'message': msg, - 'severity': lsp.DiagnosticSeverity.Warning, + 'severity': severity, } )