mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-04 10:50:15 +00:00
In "Fill match arms", allow users to prefer Self
to the enum name when possible
But default to not to. I chose to have a more generic config name because maybe other assists could also use the same approach.
This commit is contained in:
parent
4fd1cdb3e3
commit
25a7b2480e
7 changed files with 227 additions and 29 deletions
|
@ -134,6 +134,13 @@ pub fn name_ref(name_ref: &str) -> ast::NameRef {
|
|||
}
|
||||
}
|
||||
}
|
||||
pub fn name_ref_self_ty() -> ast::NameRef {
|
||||
quote! {
|
||||
NameRef {
|
||||
[Self]
|
||||
}
|
||||
}
|
||||
}
|
||||
fn raw_ident_esc(ident: &str) -> &'static str {
|
||||
if is_raw_identifier(ident, Edition::CURRENT) { "r#" } else { "" }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue