last use of parse api in ssr

This commit is contained in:
Aleksey Kladov 2021-12-27 21:41:34 +03:00
parent 45bba40079
commit f9e06e6524

View File

@ -226,8 +226,8 @@ fn token_is_method_call_receiver(token: &SyntaxToken) -> bool {
fn parse_as_kind(code: &str, kind: SyntaxKind) -> Option<SyntaxNode> {
if ast::Expr::can_cast(kind) {
if let Ok(expr) = ast::Expr::parse(code) {
return Some(expr.syntax().clone());
if let Ok(expr) = fragments::expr(code) {
return Some(expr);
}
}
if ast::Item::can_cast(kind) {