rust-analyzer guided tuple field to named field
This commit is contained in:
parent
b08a557f80
commit
e3828777a6
16 changed files with 33 additions and 24 deletions
|
@ -25,12 +25,12 @@ pub fn expand(
|
|||
// FIXME - if we get deref patterns, use them to reduce duplication here
|
||||
let (item, is_stmt, ty_span) =
|
||||
if let Annotatable::Item(item) = &item
|
||||
&& let ItemKind::Static(ast::Static(ty, ..)) = &item.kind
|
||||
&& let ItemKind::Static(ast::Static { ty, ..}) = &item.kind
|
||||
{
|
||||
(item, false, ecx.with_def_site_ctxt(ty.span))
|
||||
} else if let Annotatable::Stmt(stmt) = &item
|
||||
&& let StmtKind::Item(item) = &stmt.kind
|
||||
&& let ItemKind::Static(ast::Static(ty, ..)) = &item.kind
|
||||
&& let ItemKind::Static(ast::Static { ty, ..}) = &item.kind
|
||||
{
|
||||
(item, true, ecx.with_def_site_ctxt(ty.span))
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue