mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
fix typo
This commit is contained in:
parent
cf2ba2791d
commit
20013de2ab
3 changed files with 6 additions and 6 deletions
|
@ -45,9 +45,9 @@ fn add_missing_impl_members_inner(
|
||||||
let trait_def = {
|
let trait_def = {
|
||||||
let file_id = ctx.frange.file_id;
|
let file_id = ctx.frange.file_id;
|
||||||
let position = FilePosition { file_id, offset: impl_node.syntax().range().start() };
|
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<_> = {
|
let missing_fns: Vec<_> = {
|
||||||
|
|
|
@ -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 calling_node = FnCallNode::with_node(syntax, position.offset)?;
|
||||||
let name_ref = calling_node.name_ref()?;
|
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 {
|
let function = match calling_node {
|
||||||
FnCallNode::CallExpr(expr) => {
|
FnCallNode::CallExpr(expr) => {
|
||||||
//FIXME: apply subst
|
//FIXME: apply subst
|
||||||
let (callable_def, _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 {
|
match callable_def {
|
||||||
hir::CallableDef::Function(it) => it,
|
hir::CallableDef::Function(it) => it,
|
||||||
//FIXME: handle other callables
|
//FIXME: handle other callables
|
||||||
_ => return None,
|
_ => 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);
|
let mut call_info = CallInfo::new(db, function);
|
||||||
|
|
|
@ -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
|
/// FIXME: Use this as a benchmark
|
||||||
#[test]
|
#[test]
|
||||||
fn self_hosting_parsing() {
|
fn self_hosting_parsing() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue