diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-06-11 18:24:28 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-06-11 18:24:28 +0100 |
commit | 98020ef2f30cae2c1333389f43d9014f6b03981f (patch) | |
tree | 11dcb1b9c9a7fb12be8868925be62f0aec8d80d2 /crates/ra_hir/src/expr/scope.rs | |
parent | 80aa9d5f9f55341d2a51176e385d8aa6d2d2cec8 (diff) | |
parent | acafbd66f80f79a1b9f9ce181eb3bc22d0ebbf72 (diff) |
Merge #1394
1394: Fix hover for pat that shadows items r=matklad a=sinkuu
```rust
fn x() {}
fn y() {
let x = 0i32;
x; // hover on `x` is expected to be `i32`, but the actual result was `fn x()`
}
```
This was because: if [`res.is_empty()`](https://github.com/sinkuu/rust-analyzer/blob/656a0fa9f99298123d7dcee8c65a8a5ed7043bc4/crates/ra_ide_api/src/hover.rs#L205), it fallbacks to "index based approach" and adds `fn x()` to `res`, which makes [`res.extend(type_of)` below](https://github.com/sinkuu/rust-analyzer/blob/656a0fa9f99298123d7dcee8c65a8a5ed7043bc4/crates/ra_ide_api/src/hover.rs#L260-L266) not happen.
Co-authored-by: Shotaro Yamada <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/expr/scope.rs')
0 files changed, 0 insertions, 0 deletions