diff options
Diffstat (limited to 'crates/ra_analysis/src/imp.rs')
-rw-r--r-- | crates/ra_analysis/src/imp.rs | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs index 1e9129c4f..e2871451c 100644 --- a/crates/ra_analysis/src/imp.rs +++ b/crates/ra_analysis/src/imp.rs | |||
@@ -8,8 +8,7 @@ use hir::{ | |||
8 | use ra_db::{FilesDatabase, SourceRoot, SourceRootId, SyntaxDatabase}; | 8 | use ra_db::{FilesDatabase, SourceRoot, SourceRootId, SyntaxDatabase}; |
9 | use ra_editor::{self, find_node_at_offset, assists, LocalEdit, Severity}; | 9 | use ra_editor::{self, find_node_at_offset, assists, LocalEdit, Severity}; |
10 | use ra_syntax::{ | 10 | use ra_syntax::{ |
11 | algo::find_covering_node, | 11 | ast::{self, ArgListOwner, Expr, NameOwner}, |
12 | ast::{self, ArgListOwner, Expr, FnDef, NameOwner}, | ||
13 | AstNode, SourceFileNode, | 12 | AstNode, SourceFileNode, |
14 | SyntaxKind::*, | 13 | SyntaxKind::*, |
15 | SyntaxNodeRef, TextRange, TextUnit, | 14 | SyntaxNodeRef, TextRange, TextUnit, |
@@ -398,19 +397,6 @@ impl db::RootDatabase { | |||
398 | Ok(None) | 397 | Ok(None) |
399 | } | 398 | } |
400 | 399 | ||
401 | pub(crate) fn type_of(&self, frange: FileRange) -> Cancelable<Option<String>> { | ||
402 | let file = self.source_file(frange.file_id); | ||
403 | let syntax = file.syntax(); | ||
404 | let node = find_covering_node(syntax, frange.range); | ||
405 | let parent_fn = ctry!(node.ancestors().find_map(FnDef::cast)); | ||
406 | let function = ctry!(source_binder::function_from_source( | ||
407 | self, | ||
408 | frange.file_id, | ||
409 | parent_fn | ||
410 | )?); | ||
411 | let infer = function.infer(self)?; | ||
412 | Ok(infer.type_of_node(node).map(|t| t.to_string())) | ||
413 | } | ||
414 | pub(crate) fn rename( | 400 | pub(crate) fn rename( |
415 | &self, | 401 | &self, |
416 | position: FilePosition, | 402 | position: FilePosition, |