diff options
author | Aleksey Kladov <[email protected]> | 2019-04-22 13:56:28 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-04-22 13:56:28 +0100 |
commit | e01052d1f0b8bf70a418a10538528923c5f400d5 (patch) | |
tree | 18ed1c151e7782b791214df4c4a2966c617ae1c6 /crates/ra_ide_api/src/completion/completion_context.rs | |
parent | 200032852be0c66b978c875a8edf0eca1f08b901 (diff) |
move auto-imoprter into IDE
auto-import is purely an IDE concern, so it should be done outside of
HIR
Diffstat (limited to 'crates/ra_ide_api/src/completion/completion_context.rs')
-rw-r--r-- | crates/ra_ide_api/src/completion/completion_context.rs | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/crates/ra_ide_api/src/completion/completion_context.rs b/crates/ra_ide_api/src/completion/completion_context.rs index ca8f7900d..0d630fdf6 100644 --- a/crates/ra_ide_api/src/completion/completion_context.rs +++ b/crates/ra_ide_api/src/completion/completion_context.rs | |||
@@ -86,18 +86,6 @@ impl<'a> CompletionContext<'a> { | |||
86 | } | 86 | } |
87 | 87 | ||
88 | fn fill(&mut self, original_file: &'a SourceFile, offset: TextUnit) { | 88 | fn fill(&mut self, original_file: &'a SourceFile, offset: TextUnit) { |
89 | // We heed the original NameRef before the "intellijRulezz" hack | ||
90 | if let Some(name_ref) = find_node_at_offset::<ast::NameRef>(original_file.syntax(), offset) | ||
91 | { | ||
92 | if let Some(path) = name_ref.syntax().ancestors().find_map(ast::Path::cast) { | ||
93 | if let Some(path) = hir::Path::from_ast(path) { | ||
94 | if let Some(ident) = path.as_ident() { | ||
95 | self.path_ident = Some(ident.clone()); | ||
96 | } | ||
97 | } | ||
98 | } | ||
99 | } | ||
100 | |||
101 | // Insert a fake ident to get a valid parse tree. We will use this file | 89 | // Insert a fake ident to get a valid parse tree. We will use this file |
102 | // to determine context, though the original_file will be used for | 90 | // to determine context, though the original_file will be used for |
103 | // actual completion. | 91 | // actual completion. |