aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/completion/complete_dot.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-01-24 22:56:13 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-01-24 22:56:13 +0000
commitc42db0bbd750fae19a91f0a0354240ea6c3bafce (patch)
treebeb7030248280fd8c67eb2b2c9cc4b19c6074c17 /crates/ra_ide_api/src/completion/complete_dot.rs
parentb308375b82a33687f93468d75c7cc628b83a1351 (diff)
parent31d3a56b1865c33ef54e5d76e606965c87676695 (diff)
Merge #623
623: WIP: module id is not def id r=matklad a=matklad This achieves two things: * makes module_tree & item_map per crate, not per source_root * begins the refactoring to remove universal `DefId` in favor of having separate ids for each kind of `Def`. Currently, only modules get a differnt ID though. Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src/completion/complete_dot.rs')
-rw-r--r--crates/ra_ide_api/src/completion/complete_dot.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_dot.rs b/crates/ra_ide_api/src/completion/complete_dot.rs
index 07007d03f..6a9358d33 100644
--- a/crates/ra_ide_api/src/completion/complete_dot.rs
+++ b/crates/ra_ide_api/src/completion/complete_dot.rs
@@ -1,4 +1,4 @@
1use hir::{Ty, Def}; 1use hir::{Ty, AdtDef};
2 2
3use crate::completion::{CompletionContext, Completions, CompletionItem, CompletionItemKind}; 3use crate::completion::{CompletionContext, Completions, CompletionItem, CompletionItemKind};
4use crate::completion::completion_item::CompletionKind; 4use crate::completion::completion_item::CompletionKind;
@@ -28,8 +28,8 @@ fn complete_fields(acc: &mut Completions, ctx: &CompletionContext, receiver: Ty)
28 Ty::Adt { 28 Ty::Adt {
29 def_id, ref substs, .. 29 def_id, ref substs, ..
30 } => { 30 } => {
31 match def_id.resolve(ctx.db) { 31 match def_id {
32 Def::Struct(s) => { 32 AdtDef::Struct(s) => {
33 for field in s.fields(ctx.db) { 33 for field in s.fields(ctx.db) {
34 CompletionItem::new( 34 CompletionItem::new(
35 CompletionKind::Reference, 35 CompletionKind::Reference,
@@ -41,8 +41,9 @@ fn complete_fields(acc: &mut Completions, ctx: &CompletionContext, receiver: Ty)
41 .add_to(acc); 41 .add_to(acc);
42 } 42 }
43 } 43 }
44
44 // TODO unions 45 // TODO unions
45 _ => {} 46 AdtDef::Enum(_) => (),
46 } 47 }
47 } 48 }
48 Ty::Tuple(fields) => { 49 Ty::Tuple(fields) => {