diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-09-24 13:23:28 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-09-24 13:23:28 +0100 |
commit | 9d3483a74dba6b0a338230fd003d91a0447c5398 (patch) | |
tree | 4439388ec3467138500985160ace14db433f784b /crates/ide_db/src/symbol_index.rs | |
parent | 4ddb8124b01a04adcc7d42444f7ca8d377bb60ae (diff) | |
parent | 5cd2c67c25e8f85625620f24d894973fcab41c8c (diff) |
Merge #5846
5846: Add references to fn args during completion r=matklad a=adamrk
When completing a function call, if there is an argument taken as a ref or mut ref which matches the name and type of a variable in scope, we will insert a `&` or `&mut` when filling in the function arguments. This addresses https://github.com/rust-analyzer/rust-analyzer/issues/5449.
E.g.
```rust
fn foo(x: &i32) {}
fn main() {
let x = 5;
foo # completing foo here generates `foo(&x)` now instead of `foo(x)`
}
```
Co-authored-by: adamrk <[email protected]>
Diffstat (limited to 'crates/ide_db/src/symbol_index.rs')
0 files changed, 0 insertions, 0 deletions