-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
OLS autocomplete with completion-replace = true
removes next char
#11933
Comments
This issue might have been fixed in #11266. If you are able to build from source to try on or after that commit that would be helpful to confirm so. |
Indeed, the issue seems to be fixed on current master. Any clue when the next release will be? |
Hmm, actually, maybe the panic was fixed, but I think there could still be an issue here. Using Can you confirm that the character removal was also fixed, not just the panic? |
I think it depends on what you are completing. std::|Something
On the other hand: std::|() In this case Another possible bug I'm seeing now while testing again: std::|Something When inserting a completion at std::syn|c // I expect this to be std::sync| Just tried this again with latest master and rust-analyzer. |
Doing some testing of Lines 292 to 313 in b53dafe
and Lines 276 to 291 in b53dafe
and found that the values of the calculated function(the second one) don't always match the other where the value is supposed to be passed in. Checking if its replace mode and always calculating seemed to always produced the desired outcome(at least I haven't found any yet outliers yet): fn completion_range(
text: RopeSlice,
edit_offset: Option<(i128, i128)>,
replace_mode: bool,
cursor: usize,
) -> Option<(usize, usize)> {
let res = if replace_mode {
find_completion_range(text, replace_mode, cursor)
} else {
match edit_offset {
Some((start_offset, end_offset)) => {
let start_offset = cursor as i128 + start_offset;
if start_offset < 0 {
return None;
}
let end_offset = cursor as i128 + end_offset;
if end_offset > text.len_chars() as i128 {
return None;
}
(start_offset as usize, end_offset as usize)
}
None => find_completion_range(text, replace_mode, cursor),
}
};
Some(res)
} Im not entirely sure but it seems like the passed in values are from the lsp itself? Kind of hard to follow exactly where the So i'm not sure if this is a helix thing or a rust analyzer thing, or both. Have you noticed this behavior with odin's lsp as well? I build I think we can either open this issue again, or even make a new one, so that we can get other people looking for root of this issue? |
Here are some gif's of the behavior I am experiencing: Getting this often too:
and this
|
It looks just like the original issue I had. My guess is it might be related to the version of rust-analyzer you are using, but maybe it is worth opening a new issue to get the attention of someone more knowledgeable. |
That is to say you no longer experience this in OLS? If so, this might be a |
Yes, when using the master branch of Helix I no longer experience this with OLS. |
Summary
When using ols (the Odin Language Server) with Helix, every time an autocomplete option is selected and inserted the next character is removed. If there is no next character Helix crashes. This only seems to happen when
completion-replace = true
.I have seen the crash with other LSPs, but not the removal.
Reproduction Steps
With ols installed and available to Helix, open an
.odin
file and try to insert an autocomplete suggestion.Helix log
The full log file is very large, I will only post the messages around the time the screencast was recorded. I tried activating
RUST_BACKTRACE
, but that didn't help much apparently.~/.cache/helix/helix.log
Platform
Linux
Terminal Emulator
alacritty 0.14.0 (22a44757) + zellij 0.40.1
Installation Method
pacman
Helix Version
helix 24.7
The text was updated successfully, but these errors were encountered: