aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/completion
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-05-04 19:07:09 +0100
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-05-04 19:07:09 +0100
commit9c49f6c36e1e097f938946811d1e2f5eb70edca9 (patch)
tree544bfd290a08475b1d5250bcc5e0717779b53758 /crates/ra_ide_api/src/completion
parentb6ffb1d2a3bcc94e41c95c7a086117e11ce487e5 (diff)
parenta4eb1a546c7623f65823c5e249cd3c6d8c90fd8c (diff)
Merge #1216
1216: Basic Chalk integration r=matklad a=flodiebold This replaces the ad-hoc `implements` check by Chalk. It doesn't yet any new functionality (e.g. where clauses aren't passed to Chalk yet). The tests that exist actually work, but it needs some refactoring, currently crashes when running analysis on the RA repo, and depends on rust-lang/chalk#216 which isn't merged yet :smile: The main work here is converting stuff back and forth and providing Chalk with the information it needs, and the canonicalization logic. Since canonicalization depends a lot on the inference table, I don't think we can currently reuse the logic from Chalk, so we need to implement it ourselves; it's not actually that complicated anyway ;) I realized that we need a `Ty::Bound` variant separate from `Ty::Param` -- these are two different things, and I think type parameters inside a function actually need to be represented in Chalk as `Placeholder` types. ~~Currently this crashes in the 'real' world because we don't yet do canonicalization when filtering method candidates. Proper canonicalization needs the inference table (to collapse different inference variables that have already been unified), but we need to be able to call the method candidate selection from the completion code... So I'm currently thinking how to best handle that :smile:~~ Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src/completion')
-rw-r--r--crates/ra_ide_api/src/completion/complete_dot.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_dot.rs b/crates/ra_ide_api/src/completion/complete_dot.rs
index e34ddf24a..2e8084699 100644
--- a/crates/ra_ide_api/src/completion/complete_dot.rs
+++ b/crates/ra_ide_api/src/completion/complete_dot.rs
@@ -24,7 +24,7 @@ fn complete_fields(acc: &mut Completions, ctx: &CompletionContext, receiver: Ty)
24 } 24 }
25 } 25 }
26 // FIXME unions 26 // FIXME unions
27 TypeCtor::Tuple => { 27 TypeCtor::Tuple { .. } => {
28 for (i, ty) in a_ty.parameters.iter().enumerate() { 28 for (i, ty) in a_ty.parameters.iter().enumerate() {
29 acc.add_pos_field(ctx, i, ty); 29 acc.add_pos_field(ctx, i, ty);
30 } 30 }