diff options
| author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-02-21 20:47:50 +0000 |
|---|---|---|
| committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-02-21 20:47:50 +0000 |
| commit | bb665a70627cbc2f4fb930fefb04899941b6afa6 (patch) | |
| tree | e63b8aa30ec149dbff97d5dbf45fed998fdaf744 /crates/ra_ide_api/src | |
| parent | 5100aeac429919d1758908efb2f9cbe0d02c7510 (diff) | |
| parent | db9a5a9ac047ed13aebd136edaabd4309f442e99 (diff) | |
| download | rust-bb665a70627cbc2f4fb930fefb04899941b6afa6.tar.gz rust-bb665a70627cbc2f4fb930fefb04899941b6afa6.zip | |
Merge #864
864: Fix handling of generics in tuple variants and refactor a bit r=matklad a=flodiebold (The problem was that we created separate substitutions for the return value, so we lost the connection between the type arguments in the constructor call and the type arguments of the result.) Also make them display a tiny bit nicer. Fixes #860. Co-authored-by: Florian Diebold <flodiebold@gmail.com> Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
Diffstat (limited to 'crates/ra_ide_api/src')
| -rw-r--r-- | crates/ra_ide_api/src/hover.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide_api/src/hover.rs index 0888ab6de6a..a41c4e546d8 100644 --- a/crates/ra_ide_api/src/hover.rs +++ b/crates/ra_ide_api/src/hover.rs @@ -164,6 +164,23 @@ mod tests { } #[test] + fn hover_some() { + let (analysis, position) = single_file_with_position( + " + enum Option<T> { Some(T) } + use Option::Some; + + fn main() { + So<|>me(12); + } + ", + ); + let hover = analysis.hover(position).unwrap().unwrap(); + // not the nicest way to show it currently + assert_eq!(hover.info, "Some<i32>(T) -> Option<T>"); + } + + #[test] fn hover_for_local_variable() { let (analysis, position) = single_file_with_position("fn func(foo: i32) { fo<|>o; }"); let hover = analysis.hover(position).unwrap().unwrap(); |
