mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Precompute macro fragment kind
This commit is contained in:
parent
cf4d4f646b
commit
9cf8d325a2
9 changed files with 113 additions and 74 deletions
|
@ -175,8 +175,13 @@ fn lazy_expand(
|
|||
) -> ExpandResult<Option<InFile<SyntaxNode>>> {
|
||||
let ast_id = db.ast_id_map(macro_call.file_id).ast_id(¯o_call.value);
|
||||
|
||||
let fragment = crate::to_fragment_kind(¯o_call.value);
|
||||
let id: MacroCallId = def
|
||||
.as_lazy_macro(db, krate, MacroCallKind::FnLike { ast_id: macro_call.with_value(ast_id) })
|
||||
.as_lazy_macro(
|
||||
db,
|
||||
krate,
|
||||
MacroCallKind::FnLike { ast_id: macro_call.with_value(ast_id), fragment },
|
||||
)
|
||||
.into();
|
||||
|
||||
let err = db.macro_expand_error(id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue