-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
arguments autocompletion eats up stuff randomly #6248
Comments
I have some ideas here. I think this might actually be a RA problem and I might even know what the problem in RA is but for that to work I would need a reproduction case. Is that example public anywhere or could you provide the file? |
The code is copy-pasted from the book "Zero to production in rust", which with I'm playing around these days. https://github.com/eulerdisk/for_helix_debugging I tried even with the original code from the book repo, but I wasn't unable to reproduce :-( |
thanks! I can reproduce this, I think this might be a RA problem. The fact the helix complains about incorrect edits is a pretty strong indicator |
Either way, I think it would be better to do nothing than to do harm in these situations. |
Ok looking at the logs here RA just sends us bogus edits. The reason for this (which I expected) is that you are inside a proc macro which is more difficult to RA to handle. Removing the tracing attribute remove the bug. I think The same issue also occurs with older versions of helix (I tested the Removing the One very interesting thing I found is that VScode will not even these completions while the tracing attribute is there but as soon as its removed they showup. Either VScode provides something to RA that makes it not send these completions in that case or (more likely) VScode detects that these completions are malformed and doesn't show them. We also get a protocol error here so maybe the right fix is to somehow ignore completions on protocol error. Regardless that is really just about a better way to deal with a broken LSP. This is definitly a RA bug (altough it might be a known bug) |
I mean I agree but it's not easy to figure out if/when an edit is incorrect. VSCode seems to do it somehow but it might be something rust specific, I am not sure yet |
I think maybe it's a duplicate of #5693. |
It is fixed in the nightly RA, though I can reproduce it on stable. I don't know when nightly ra becomes stable but It was probably fixed in rust-lang/rust-analyzer#11014 (merged a year ago) Tested with |
stable RA is ancient and I would strongly advise against using it. Either use nightly ra or don't install it using rustup at all. That said I tried to reproduce this a few weeks ago and was still able to (I use nightly RA) |
Yeah I can still reproduce this |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Summary
Autocompletion eats up text randomly completing arguments.
See the asciinema.
The cursor is at line 84 when writing the test function. Autocompleting the second suggested arguments something strange happens, about 60 lines of code above disappear. You can see the cursor now is at line 26.
It happened even autocompleting the first argument but it's hard to reproduce.
Maybe it's a RA problem. You can see the "overlapping edits" error.
Reproduction Steps
https://asciinema.org/a/4ZlV4d3AkvQ3gDC4qGLDbq3eD
Helix log
No response
Platform
WSL
Terminal Emulator
Windows Terminal
Helix Version
helix 22.12 (d63e570)
The text was updated successfully, but these errors were encountered: