diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-11-04 12:37:29 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-11-04 12:37:29 +0000 |
commit | bd6eeffb2fe47b4b352d6f53e874cabfec04213c (patch) | |
tree | 962bbdba89c8cf199bb946f40b2ac703706881aa /crates/ide/src/diagnostics | |
parent | 99a8e59f68db7d66a8b5f83c3566f67028ed2675 (diff) | |
parent | 6145234450cc3e8d79c7f4e2105e36ccd96ee3b4 (diff) |
Merge #6456
6456: Support record variants in extract_struct_from_enum_variant r=matklad a=Veykril
As requested :)
This also prevents the assist from being disabled if a definition in the value namespace exists with the same name as our new struct since that won't cause a collision
#4468
Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/ide/src/diagnostics')
-rw-r--r-- | crates/ide/src/diagnostics/fixes.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/ide/src/diagnostics/fixes.rs b/crates/ide/src/diagnostics/fixes.rs index 02e17ba43..d275dd75b 100644 --- a/crates/ide/src/diagnostics/fixes.rs +++ b/crates/ide/src/diagnostics/fixes.rs | |||
@@ -157,7 +157,8 @@ fn missing_record_expr_field_fix( | |||
157 | return None; | 157 | return None; |
158 | } | 158 | } |
159 | let new_field = make::record_field( | 159 | let new_field = make::record_field( |
160 | record_expr_field.field_name()?, | 160 | None, |
161 | make::name(record_expr_field.field_name()?.text()), | ||
161 | make::ty(&new_field_type.display_source_code(sema.db, module.into()).ok()?), | 162 | make::ty(&new_field_type.display_source_code(sema.db, module.into()).ok()?), |
162 | ); | 163 | ); |
163 | 164 | ||