We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Using flake8 with flake8-annotations plugin results in an invalid character position -1 in this simple snippet:
def myfun(): # erg pass
The pylsp server returns the following response:
[jsonrpc] e[22:41:37.731] <-- textDocument/publishDiagnostics { "jsonrpc": "2.0", "method": "textDocument/publishDiagnostics", "params": { "uri": "file:////tmp/hu.py", "diagnostics": [ { "source": "flake8", "code": "ANN201", "range": { "start": { "line": 1, "character": -1 }, "end": { "line": 1, "character": 10 } }, "message": "ANN201 Missing return type annotation for public function", "severity": 2 } ], "version": 126 } }
As you can see, the ANN201 error starts at character -1. I assume this is invalid, because my client (eglot in Emacs) complains about it.
The issue seems connected to the comment line. An empty line also has the same issue. A docstring line does not.
The python-lsp-server config that I'm using at Emacs:
;; (...) '((:pylsp . (:plugins (:mccabe (:enabled :json-false) :pycodestyle (:enabled :json-false) :pyflakes (:enabled :json-false) :flake8 (:enabled t) ) :configurationSources ["flake8"])))
As said, flake8 and flake8-annotations are being used.
Using flake8 directly from CLI doesn't show anything weird, only ANN201 is reported.
> flake8 hu.py hu.py:2:0: ANN201 Missing return type annotation for public function
Versions:
python-lsp-jsonrpc 1.1.2 python-lsp-server 1.12.0 flake8 7.1.1 flake8-annotations 3.1.1
Honestly I don't know where the source of the problem is, if the LSP server or flake8-annotations or somewhere else.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Using flake8 with flake8-annotations plugin results in an invalid character position -1 in this simple snippet:
The pylsp server returns the following response:
As you can see, the ANN201 error starts at character -1. I assume this is invalid, because my client (eglot in Emacs) complains about it.
The issue seems connected to the comment line. An empty line also has the same issue. A docstring line does not.
The python-lsp-server config that I'm using at Emacs:
As said, flake8 and flake8-annotations are being used.
Using flake8 directly from CLI doesn't show anything weird, only ANN201 is reported.
Versions:
python-lsp-jsonrpc 1.1.2
python-lsp-server 1.12.0
flake8 7.1.1
flake8-annotations 3.1.1
Honestly I don't know where the source of the problem is, if the LSP server or flake8-annotations or somewhere else.
The text was updated successfully, but these errors were encountered: