diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-07-12 17:42:06 +0100 |
---|---|---|
committer | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-07-12 17:42:06 +0100 |
commit | 8bb81d7418dbc4c295d31d261441b67dba4c0f76 (patch) | |
tree | af552549d828905294f4f3c109cdc339c12020ad /crates/ra_ide_api/src/completion | |
parent | 2e466bb365813620de15afd5e04736a92fffdca9 (diff) | |
parent | deab4caa7b1ba81c1b7e6561bc270bbde6467f13 (diff) |
Merge #1524
1524: make Parse fields private r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src/completion')
-rw-r--r-- | crates/ra_ide_api/src/completion/completion_context.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_ide_api/src/completion/completion_context.rs b/crates/ra_ide_api/src/completion/completion_context.rs index 55fdba50d..f6584cdd6 100644 --- a/crates/ra_ide_api/src/completion/completion_context.rs +++ b/crates/ra_ide_api/src/completion/completion_context.rs | |||
@@ -48,7 +48,7 @@ impl<'a> CompletionContext<'a> { | |||
48 | ) -> Option<CompletionContext<'a>> { | 48 | ) -> Option<CompletionContext<'a>> { |
49 | let module = source_binder::module_from_position(db, position); | 49 | let module = source_binder::module_from_position(db, position); |
50 | let token = | 50 | let token = |
51 | find_token_at_offset(original_parse.tree.syntax(), position.offset).left_biased()?; | 51 | find_token_at_offset(original_parse.tree().syntax(), position.offset).left_biased()?; |
52 | let analyzer = | 52 | let analyzer = |
53 | hir::SourceAnalyzer::new(db, position.file_id, token.parent(), Some(position.offset)); | 53 | hir::SourceAnalyzer::new(db, position.file_id, token.parent(), Some(position.offset)); |
54 | let mut ctx = CompletionContext { | 54 | let mut ctx = CompletionContext { |
@@ -89,7 +89,7 @@ impl<'a> CompletionContext<'a> { | |||
89 | // actual completion. | 89 | // actual completion. |
90 | let file = { | 90 | let file = { |
91 | let edit = AtomTextEdit::insert(offset, "intellijRulezz".to_string()); | 91 | let edit = AtomTextEdit::insert(offset, "intellijRulezz".to_string()); |
92 | original_parse.reparse(&edit).tree | 92 | original_parse.reparse(&edit).tree().to_owned() |
93 | }; | 93 | }; |
94 | 94 | ||
95 | // First, let's try to complete a reference to some declaration. | 95 | // First, let's try to complete a reference to some declaration. |
@@ -100,7 +100,7 @@ impl<'a> CompletionContext<'a> { | |||
100 | self.is_param = true; | 100 | self.is_param = true; |
101 | return; | 101 | return; |
102 | } | 102 | } |
103 | self.classify_name_ref(&original_parse.tree, name_ref); | 103 | self.classify_name_ref(original_parse.tree(), name_ref); |
104 | } | 104 | } |
105 | 105 | ||
106 | // Otherwise, see if this is a declaration. We can use heuristics to | 106 | // Otherwise, see if this is a declaration. We can use heuristics to |