mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-27 10:17:15 +00:00
feat: Desugar assist for let pat = expr?; -> let else
This commit is contained in:
parent
e72738de99
commit
751ca9ec0d
5 changed files with 336 additions and 171 deletions
|
|
@ -585,6 +585,18 @@ impl SyntaxFactory {
|
|||
ast
|
||||
}
|
||||
|
||||
pub fn expr_underscore(&self) -> ast::UnderscoreExpr {
|
||||
let ast::Expr::UnderscoreExpr(ast) = make::ext::expr_underscore().clone_for_update() else {
|
||||
unreachable!()
|
||||
};
|
||||
|
||||
if let Some(mut mapping) = self.mappings() {
|
||||
SyntaxMappingBuilder::new(ast.syntax().clone()).finish(&mut mapping);
|
||||
}
|
||||
|
||||
ast
|
||||
}
|
||||
|
||||
pub fn expr_if(
|
||||
&self,
|
||||
condition: ast::Expr,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue