diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-12-27 10:08:34 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-12-27 10:08:34 +0000 |
commit | 1d6dcef5c584d0dffdf5386eec993e41daad0210 (patch) | |
tree | 1e67675b7031115b1811863d0f186ad1f98b1fce /crates/ra_analysis/src/completion/complete_path.rs | |
parent | 700165cf17290561dea511565278b9869ed61625 (diff) | |
parent | bc745a139674f289386f3081458793f756cab5b9 (diff) |
Merge #332
332: Struct types r=matklad a=flodiebold
Infer types for struct fields, and add basic field completions. There's also some code for enums, but I focused on getting structs working.
There's still ways to go before this becomes useful: There's no autoderef (or even reference types) and no inference for `self`, for example.
Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ra_analysis/src/completion/complete_path.rs')
-rw-r--r-- | crates/ra_analysis/src/completion/complete_path.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_analysis/src/completion/complete_path.rs b/crates/ra_analysis/src/completion/complete_path.rs index ad4d68a33..aaa2c7cee 100644 --- a/crates/ra_analysis/src/completion/complete_path.rs +++ b/crates/ra_analysis/src/completion/complete_path.rs | |||
@@ -8,7 +8,7 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) -> C | |||
8 | (Some(path), Some(module)) => (path.clone(), module), | 8 | (Some(path), Some(module)) => (path.clone(), module), |
9 | _ => return Ok(()), | 9 | _ => return Ok(()), |
10 | }; | 10 | }; |
11 | let def_id = match module.resolve_path(ctx.db, path)? { | 11 | let def_id = match module.resolve_path(ctx.db, &path)?.take_types() { |
12 | Some(it) => it, | 12 | Some(it) => it, |
13 | None => return Ok(()), | 13 | None => return Ok(()), |
14 | }; | 14 | }; |