Skip to content

Commit f9e06e6

Browse files
committed
last use of parse api in ssr
1 parent 45bba40 commit f9e06e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/ide_ssr/src/replacing.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ fn token_is_method_call_receiver(token: &SyntaxToken) -> bool {
226226

227227
fn parse_as_kind(code: &str, kind: SyntaxKind) -> Option<SyntaxNode> {
228228
if ast::Expr::can_cast(kind) {
229-
if let Ok(expr) = ast::Expr::parse(code) {
230-
return Some(expr.syntax().clone());
229+
if let Ok(expr) = fragments::expr(code) {
230+
return Some(expr);
231231
}
232232
}
233233
if ast::Item::can_cast(kind) {

0 commit comments

Comments
 (0)