mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
Modify hacks::parse_expr_from_str()
to take an edition too
This will be needed as we parse unknown identifiers and want to insert them into source code.
This commit is contained in:
parent
e6d59e65ec
commit
ddbb28daa0
4 changed files with 14 additions and 10 deletions
|
@ -14,7 +14,7 @@ use ide_db::{
|
|||
use itertools::Itertools;
|
||||
use syntax::{
|
||||
ast::{self, AttrKind},
|
||||
AstNode, SyntaxKind, T,
|
||||
AstNode, Edition, SyntaxKind, T,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
|
@ -373,7 +373,9 @@ fn parse_comma_sep_expr(input: ast::TokenTree) -> Option<Vec<ast::Expr>> {
|
|||
input_expressions
|
||||
.into_iter()
|
||||
.filter_map(|(is_sep, group)| (!is_sep).then_some(group))
|
||||
.filter_map(|mut tokens| syntax::hacks::parse_expr_from_str(&tokens.join("")))
|
||||
.filter_map(|mut tokens| {
|
||||
syntax::hacks::parse_expr_from_str(&tokens.join(""), Edition::CURRENT)
|
||||
})
|
||||
.collect::<Vec<ast::Expr>>(),
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue