mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-24 04:46:58 +00:00
Update crates/ide-assists/src/handlers/move_format_string_arg.rs
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
parent
fb5ae9906b
commit
54e9324e93
@ -41,7 +41,7 @@ use syntax::{ast, AstNode, AstToken, NodeOrToken, SyntaxKind::COMMA, TextRange};
|
||||
|
||||
pub(crate) fn move_format_string_arg(acc: &mut Assists, ctx: &AssistContext<'_>) -> Option<()> {
|
||||
let fmt_string = ctx.find_token_at_offset::<ast::String>()?;
|
||||
let tt = fmt_string.syntax().parent_ancestors().find_map(ast::TokenTree::cast)?;
|
||||
let tt = fmt_string.syntax().parent().and_then(ast::TokenTree::cast)?;
|
||||
|
||||
let expanded_t = ast::String::cast(
|
||||
ctx.sema.descend_into_macros_with_kind_preference(fmt_string.syntax().clone()),
|
||||
|
Loading…
Reference in New Issue
Block a user