mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
remove Cancelable from funciton body
This commit is contained in:
parent
7c977a7dcd
commit
040a622c52
9 changed files with 16 additions and 21 deletions
|
@ -10,7 +10,7 @@ pub(super) fn complete_dot(acc: &mut Completions, ctx: &CompletionContext) -> Ca
|
|||
_ => return Ok(()),
|
||||
};
|
||||
let infer_result = function.infer(ctx.db)?;
|
||||
let syntax_mapping = function.body_syntax_mapping(ctx.db)?;
|
||||
let syntax_mapping = function.body_syntax_mapping(ctx.db);
|
||||
let expr = match syntax_mapping.node_expr(receiver) {
|
||||
Some(expr) => expr,
|
||||
None => return Ok(()),
|
||||
|
|
|
@ -64,7 +64,7 @@ pub(crate) fn reference_definition(
|
|||
.and_then(ast::MethodCallExpr::cast)
|
||||
{
|
||||
let infer_result = function.infer(db)?;
|
||||
let syntax_mapping = function.body_syntax_mapping(db)?;
|
||||
let syntax_mapping = function.body_syntax_mapping(db);
|
||||
let expr = ast::Expr::cast(method_call.syntax()).unwrap();
|
||||
if let Some(def_id) = syntax_mapping
|
||||
.node_expr(expr)
|
||||
|
|
|
@ -74,7 +74,7 @@ pub(crate) fn type_of(db: &RootDatabase, frange: FileRange) -> Cancelable<Option
|
|||
parent_fn
|
||||
));
|
||||
let infer = function.infer(db)?;
|
||||
let syntax_mapping = function.body_syntax_mapping(db)?;
|
||||
let syntax_mapping = function.body_syntax_mapping(db);
|
||||
if let Some(expr) = ast::Expr::cast(node).and_then(|e| syntax_mapping.node_expr(e)) {
|
||||
Ok(Some(infer[expr].to_string()))
|
||||
} else if let Some(pat) = ast::Pat::cast(node).and_then(|p| syntax_mapping.node_pat(p)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue