This commit is contained in:
Aleksey Kladov 2019-04-11 17:15:20 +03:00
parent cf2ba2791d
commit 20013de2ab
3 changed files with 6 additions and 6 deletions

View file

@ -45,9 +45,9 @@ fn add_missing_impl_members_inner(
let trait_def = {
let file_id = ctx.frange.file_id;
let position = FilePosition { file_id, offset: impl_node.syntax().range().start() };
let analyser = hir::SourceAnalyzer::new(ctx.db, position.file_id, impl_node.syntax());
let analyzer = hir::SourceAnalyzer::new(ctx.db, position.file_id, impl_node.syntax());
resolve_target_trait_def(ctx.db, &analyser, impl_node)?
resolve_target_trait_def(ctx.db, &analyzer, impl_node)?
};
let missing_fns: Vec<_> = {

View file

@ -17,19 +17,19 @@ pub(crate) fn call_info(db: &RootDatabase, position: FilePosition) -> Option<Cal
let calling_node = FnCallNode::with_node(syntax, position.offset)?;
let name_ref = calling_node.name_ref()?;
let analyser = hir::SourceAnalyzer::new(db, position.file_id, name_ref.syntax());
let analyzer = hir::SourceAnalyzer::new(db, position.file_id, name_ref.syntax());
let function = match calling_node {
FnCallNode::CallExpr(expr) => {
//FIXME: apply subst
let (callable_def, _subst) =
analyser.type_of(db, expr.expr()?.into())?.as_callable()?;
analyzer.type_of(db, expr.expr()?.into())?.as_callable()?;
match callable_def {
hir::CallableDef::Function(it) => it,
//FIXME: handle other callables
_ => return None,
}
}
FnCallNode::MethodCallExpr(expr) => analyser.resolve_method_call(expr)?,
FnCallNode::MethodCallExpr(expr) => analyzer.resolve_method_call(expr)?,
};
let mut call_info = CallInfo::new(db, function);

View file

@ -60,7 +60,7 @@ fn reparse_fuzz_tests() {
}
}
/// Test that Rust-analyzer can parse and validate the rust-analyser
/// Test that Rust-analyzer can parse and validate the rust-analyzer
/// FIXME: Use this as a benchmark
#[test]
fn self_hosting_parsing() {