diff options
| author | Lukas Wirth <me@lukaswirth.dev> | 2025-06-17 08:20:02 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-17 08:20:02 +0000 |
| commit | 3b9ef2889ad6caa440fa753560cd43d733cf3435 (patch) | |
| tree | b7d65d764332dd87bcd37ce4400b2aeb63e4c0dc /src/tools/rust-analyzer/crates/syntax | |
| parent | e4e01f6352e234f1bbee0b4fa066e4228586a485 (diff) | |
| parent | 2a473e5aa6c8869dfef3891e32c77085338e4f46 (diff) | |
Merge pull request #19939 from ChayimFriedman2/fill-arms-self
feat: In "Fill match arms", allow users to prefer `Self` to the enum name when possible
Diffstat (limited to 'src/tools/rust-analyzer/crates/syntax')
| -rw-r--r-- | src/tools/rust-analyzer/crates/syntax/src/ast/make.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/tools/rust-analyzer/crates/syntax/src/ast/make.rs b/src/tools/rust-analyzer/crates/syntax/src/ast/make.rs index fab4cb287c3..955aadaa25d 100644 --- a/src/tools/rust-analyzer/crates/syntax/src/ast/make.rs +++ b/src/tools/rust-analyzer/crates/syntax/src/ast/make.rs @@ -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 { "" } } |
