Skip to content
New issue

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

lsp_python_diagnostic may use invalid lsprotocol.types.Position.character #272

Closed
seeM opened this issue Jun 19, 2023 · 0 comments · Fixed by #293
Closed

lsp_python_diagnostic may use invalid lsprotocol.types.Position.character #272

seeM opened this issue Jun 19, 2023 · 0 comments · Fixed by #293

Comments

@seeM
Copy link

seeM commented Jun 19, 2023

Due to a bug in CPython (python/cpython#105911), the lsp_python_diagnostic function may encounter a value of err.offset = 0 (instead of the 1-indexed value guaranteed in the Python docs). If so, it will try to create an lsprotocol.types.Position with character=-1 causing a validation error.

I believe the caret would be at the correct position if we do something like err.offset = max(err.offset, 0) but I haven't tested that thoroughly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant