diff options
Diffstat (limited to 'crates/ra_analysis/src/completion.rs')
-rw-r--r-- | crates/ra_analysis/src/completion.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_analysis/src/completion.rs b/crates/ra_analysis/src/completion.rs index 7c3476e5c..689d4c92f 100644 --- a/crates/ra_analysis/src/completion.rs +++ b/crates/ra_analysis/src/completion.rs | |||
@@ -2,7 +2,7 @@ use ra_editor::find_node_at_offset; | |||
2 | use ra_syntax::{ | 2 | use ra_syntax::{ |
3 | algo::visit::{visitor, visitor_ctx, Visitor, VisitorCtx}, | 3 | algo::visit::{visitor, visitor_ctx, Visitor, VisitorCtx}, |
4 | ast::{self, AstChildren, LoopBodyOwner, ModuleItemOwner}, | 4 | ast::{self, AstChildren, LoopBodyOwner, ModuleItemOwner}, |
5 | AstNode, AtomEdit, File, | 5 | AstNode, AtomEdit, SourceFileNode, |
6 | SyntaxKind::*, | 6 | SyntaxKind::*, |
7 | SyntaxNodeRef, TextUnit, | 7 | SyntaxNodeRef, TextUnit, |
8 | }; | 8 | }; |
@@ -63,7 +63,7 @@ pub(crate) fn resolve_based_completion( | |||
63 | pub(crate) fn find_target_module( | 63 | pub(crate) fn find_target_module( |
64 | module_tree: &ModuleTree, | 64 | module_tree: &ModuleTree, |
65 | module_id: ModuleId, | 65 | module_id: ModuleId, |
66 | file: &File, | 66 | file: &SourceFileNode, |
67 | offset: TextUnit, | 67 | offset: TextUnit, |
68 | ) -> Option<ModuleId> { | 68 | ) -> Option<ModuleId> { |
69 | let name_ref: ast::NameRef = find_node_at_offset(file.syntax(), offset)?; | 69 | let name_ref: ast::NameRef = find_node_at_offset(file.syntax(), offset)?; |
@@ -142,7 +142,7 @@ pub(crate) fn scope_completion( | |||
142 | } | 142 | } |
143 | 143 | ||
144 | fn complete_module_items( | 144 | fn complete_module_items( |
145 | file: &File, | 145 | file: &SourceFileNode, |
146 | items: AstChildren<ast::ModuleItem>, | 146 | items: AstChildren<ast::ModuleItem>, |
147 | this_item: Option<ast::NameRef>, | 147 | this_item: Option<ast::NameRef>, |
148 | acc: &mut Vec<CompletionItem>, | 148 | acc: &mut Vec<CompletionItem>, |
@@ -164,7 +164,7 @@ fn complete_module_items( | |||
164 | ); | 164 | ); |
165 | } | 165 | } |
166 | 166 | ||
167 | fn complete_name_ref(file: &File, name_ref: ast::NameRef, acc: &mut Vec<CompletionItem>) { | 167 | fn complete_name_ref(file: &SourceFileNode, name_ref: ast::NameRef, acc: &mut Vec<CompletionItem>) { |
168 | if !is_node::<ast::Path>(name_ref.syntax()) { | 168 | if !is_node::<ast::Path>(name_ref.syntax()) { |
169 | return; | 169 | return; |
170 | } | 170 | } |
@@ -239,7 +239,7 @@ fn is_node<'a, N: AstNode<'a>>(node: SyntaxNodeRef<'a>) -> bool { | |||
239 | } | 239 | } |
240 | 240 | ||
241 | fn complete_expr_keywords( | 241 | fn complete_expr_keywords( |
242 | file: &File, | 242 | file: &SourceFileNode, |
243 | fn_def: ast::FnDef, | 243 | fn_def: ast::FnDef, |
244 | name_ref: ast::NameRef, | 244 | name_ref: ast::NameRef, |
245 | acc: &mut Vec<CompletionItem>, | 245 | acc: &mut Vec<CompletionItem>, |