From e7206467d57c555f1ca1fee6acc0461d7579f4f7 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Mon, 9 Mar 2020 00:13:04 +0800 Subject: Add parse_to_token_tree --- crates/ra_hir_expand/src/builtin_macro.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/ra_hir_expand') diff --git a/crates/ra_hir_expand/src/builtin_macro.rs b/crates/ra_hir_expand/src/builtin_macro.rs index 9bc33cfa8..3f60b1cca 100644 --- a/crates/ra_hir_expand/src/builtin_macro.rs +++ b/crates/ra_hir_expand/src/builtin_macro.rs @@ -7,6 +7,7 @@ use crate::{ use crate::{quote, EagerMacroId, LazyMacroId, MacroCallId}; use either::Either; +use mbe::parse_to_token_tree; use ra_db::{FileId, RelativePath}; use ra_parser::FragmentKind; @@ -306,10 +307,9 @@ fn include_expand( // FIXME: // Handle include as expression - let node = - db.parse_or_expand(file_id.into()).ok_or_else(|| mbe::ExpandError::ConversionError)?; - let res = - mbe::syntax_node_to_token_tree(&node).ok_or_else(|| mbe::ExpandError::ConversionError)?.0; + let res = parse_to_token_tree(&db.file_text(file_id.into())) + .ok_or_else(|| mbe::ExpandError::ConversionError)? + .0; Ok((res, FragmentKind::Items)) } -- cgit v1.2.3