-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Rust-analyzer inserts & (ampersand) character on the wrong line when auto-completing variable reference #12717
Comments
if I change |
Ah we don't consider macros for these ye, these are all the problematic locations
rust-analyzer/crates/ide-completion/src/render/function.rs Lines 82 to 92 in 09abd76
rust-analyzer/crates/ide-completion/src/render/literal.rs Lines 124 to 126 in 09abd76
We'll need to use rust-analyzer/crates/hir/src/semantics.rs Lines 250 to 254 in 09abd76
|
I can also reproduce this by typing |
thats the same issue in a different part of the project, feel free to create a new issue regarding that |
I am working on this. |
@rustbot claim |
Find original as node before compute ref match part of #12717
Find original ast node before compute ref match ref #12717
When I auto-complete a function parameter that wants a reference, I get a
&
character randomly inserted on the wrong line in the same file.It appears to use the line-number relative to the file rather than relative to the current function.
See below for code and steps to reproduce the issue.
rust-analyzer version: (eg. output of "Rust Analyzer: Show RA Version" command)
rust-analyzer version: 0.0.0 (75b2232 2022-07-03)
rustc version: (eg. output of
rustc -V
)rustc 1.62.0 (a8314ef7d 2022-06-27)
Steps to reproduce:
query_result(...)
)show_value(request.que
(then press ENTER to auto-completequery_id
)Upon auto-completion, observe an
&
character has been inserted on line 6 of the file, making the function signature now look like this:The text was updated successfully, but these errors were encountered: