mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
allow expanding expressions
This commit is contained in:
parent
16c7405262
commit
caa8663c08
2 changed files with 8 additions and 7 deletions
|
@ -81,6 +81,9 @@ impl HirFileId {
|
|||
MacroFileKind::Items => {
|
||||
Some(mbe::token_tree_to_ast_item_list(&tt).syntax().to_owned())
|
||||
}
|
||||
MacroFileKind::Expr => {
|
||||
mbe::token_tree_to_expr(&tt).ok().map(|it| it.syntax().to_owned())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -102,6 +105,7 @@ struct MacroFile {
|
|||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
pub(crate) enum MacroFileKind {
|
||||
Items,
|
||||
Expr,
|
||||
}
|
||||
|
||||
impl From<FileId> for HirFileId {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue