Due to a bug in CPython (https://github.com/python/cpython/issues/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.
Due to a bug in CPython (https://github.com/python/cpython/issues/105911), the
lsp_python_diagnostic
function may encounter a value oferr.offset = 0
(instead of the 1-indexed value guaranteed in the Python docs). If so, it will try to create anlsprotocol.types.Position
withcharacter=-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.