-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
fix(lsp): find_completion_range
off-by-one
#11266
fix(lsp): find_completion_range
off-by-one
#11266
Conversation
f85186f
to
21eb32e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead I think we should cap end
to text.len_chars()
in find_completion_range
in the if replace_mode
block. @pascalkuthe might have more context for this change though
This is not a python bug but a bugnwith our code. I knew of this for a whole but I thought I (or something else) already fried it. This is however not the right fix for the issue. This was a logic bug introduced by me into this block: Line 285 in 21eb32e
Both the |
21eb32e
to
72553b2
Compare
find_completion_range
off-by-one
Fixes an off-by-one error that caused index out of bounds for some LSP responses, or the eating of newlines for others.
Fixes: #10689