-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Migrate inline_type_alias
assist to use syntax_editor
#20314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate inline_type_alias
assist to use syntax_editor
#20314
Conversation
} else if let Some(name_ref) = ast::NameRef::cast(syntax.clone()) { | ||
let Some(replacement_syntax) = const_and_type_map.0.get(&name_ref.to_string()) else { | ||
continue; | ||
}; | ||
let new_string = replacement_syntax.to_string(); | ||
let new = if new_string == "_" { | ||
make::wildcard_pat().syntax().clone_for_update() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to replace this with
pub fn wildcard_pat(&self) -> ast::WildcardPat { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
One more thing here: rust-analyzer/crates/ide-assists/src/handlers/inline_type_alias.rs Lines 203 to 208 in eb3d909
with
and
Everything else looks good to me! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
part of #15710 and #18285