aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_analysis')
-rw-r--r--crates/ra_analysis/src/completion.rs6
-rw-r--r--crates/ra_analysis/src/descriptors/module/mod.rs2
2 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_analysis/src/completion.rs b/crates/ra_analysis/src/completion.rs
index 689d4c92f..ea15f239c 100644
--- a/crates/ra_analysis/src/completion.rs
+++ b/crates/ra_analysis/src/completion.rs
@@ -124,7 +124,7 @@ pub(crate) fn scope_completion(
124 .last() 124 .last()
125 .unwrap(); 125 .unwrap();
126 match top_node.parent().map(|it| it.kind()) { 126 match top_node.parent().map(|it| it.kind()) {
127 Some(ROOT) | Some(ITEM_LIST) => complete_mod_item_snippets(&mut res), 127 Some(SOURCE_FILE) | Some(ITEM_LIST) => complete_mod_item_snippets(&mut res),
128 _ => (), 128 _ => (),
129 } 129 }
130 } 130 }
@@ -171,7 +171,7 @@ fn complete_name_ref(file: &SourceFileNode, name_ref: ast::NameRef, acc: &mut Ve
171 let mut visited_fn = false; 171 let mut visited_fn = false;
172 for node in name_ref.syntax().ancestors() { 172 for node in name_ref.syntax().ancestors() {
173 if let Some(items) = visitor() 173 if let Some(items) = visitor()
174 .visit::<ast::Root, _>(|it| Some(it.items())) 174 .visit::<ast::SourceFile, _>(|it| Some(it.items()))
175 .visit::<ast::Module, _>(|it| Some(it.item_list()?.items())) 175 .visit::<ast::Module, _>(|it| Some(it.item_list()?.items()))
176 .accept(node) 176 .accept(node)
177 { 177 {
@@ -195,7 +195,7 @@ fn param_completions(ctx: SyntaxNodeRef, acc: &mut Vec<CompletionItem>) {
195 let mut params = FxHashMap::default(); 195 let mut params = FxHashMap::default();
196 for node in ctx.ancestors() { 196 for node in ctx.ancestors() {
197 let _ = visitor_ctx(&mut params) 197 let _ = visitor_ctx(&mut params)
198 .visit::<ast::Root, _>(process) 198 .visit::<ast::SourceFile, _>(process)
199 .visit::<ast::ItemList, _>(process) 199 .visit::<ast::ItemList, _>(process)
200 .accept(node); 200 .accept(node);
201 } 201 }
diff --git a/crates/ra_analysis/src/descriptors/module/mod.rs b/crates/ra_analysis/src/descriptors/module/mod.rs
index 03330240d..5301f44ab 100644
--- a/crates/ra_analysis/src/descriptors/module/mod.rs
+++ b/crates/ra_analysis/src/descriptors/module/mod.rs
@@ -52,7 +52,7 @@ pub(crate) enum ModuleSource {
52/// An owned syntax node for a module. Unlike `ModuleSource`, 52/// An owned syntax node for a module. Unlike `ModuleSource`,
53/// this holds onto the AST for the whole file. 53/// this holds onto the AST for the whole file.
54enum ModuleSourceNode { 54enum ModuleSourceNode {
55 Root(ast::RootNode), 55 Root(ast::SourceFileNode),
56 Inline(ast::ModuleNode), 56 Inline(ast::ModuleNode),
57} 57}
58 58