diff options
author | Nick Spain <[email protected]> | 2021-01-01 04:02:39 +0000 |
---|---|---|
committer | Nick Spain <[email protected]> | 2021-01-02 10:53:52 +0000 |
commit | c936e4b86fd5de8e9709cd01547a69054cdec91b (patch) | |
tree | da2e5ac682091deafecc9177b6bfa8e008541bc3 /crates/ide/src | |
parent | 562e2ee28a4397878accfde014d68ab17d1b504a (diff) |
source_old -> source for cases that can be handled by simple bubbling
Diffstat (limited to 'crates/ide/src')
-rw-r--r-- | crates/ide/src/diagnostics/fixes.rs | 6 | ||||
-rw-r--r-- | crates/ide/src/hover.rs | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/crates/ide/src/diagnostics/fixes.rs b/crates/ide/src/diagnostics/fixes.rs index 0b5e0a4c1..ec0f840e9 100644 --- a/crates/ide/src/diagnostics/fixes.rs +++ b/crates/ide/src/diagnostics/fixes.rs | |||
@@ -157,7 +157,7 @@ fn missing_record_expr_field_fix( | |||
157 | VariantDef::Struct(s) => { | 157 | VariantDef::Struct(s) => { |
158 | module = s.module(sema.db); | 158 | module = s.module(sema.db); |
159 | #[allow(deprecated)] | 159 | #[allow(deprecated)] |
160 | let source = s.source_old(sema.db); | 160 | let source = s.source(sema.db)?; |
161 | def_file_id = source.file_id; | 161 | def_file_id = source.file_id; |
162 | let fields = source.value.field_list()?; | 162 | let fields = source.value.field_list()?; |
163 | record_field_list(fields)? | 163 | record_field_list(fields)? |
@@ -165,14 +165,14 @@ fn missing_record_expr_field_fix( | |||
165 | VariantDef::Union(u) => { | 165 | VariantDef::Union(u) => { |
166 | module = u.module(sema.db); | 166 | module = u.module(sema.db); |
167 | #[allow(deprecated)] | 167 | #[allow(deprecated)] |
168 | let source = u.source_old(sema.db); | 168 | let source = u.source(sema.db)?; |
169 | def_file_id = source.file_id; | 169 | def_file_id = source.file_id; |
170 | source.value.record_field_list()? | 170 | source.value.record_field_list()? |
171 | } | 171 | } |
172 | VariantDef::Variant(e) => { | 172 | VariantDef::Variant(e) => { |
173 | module = e.module(sema.db); | 173 | module = e.module(sema.db); |
174 | #[allow(deprecated)] | 174 | #[allow(deprecated)] |
175 | let source = e.source_old(sema.db); | 175 | let source = e.source(sema.db)?; |
176 | def_file_id = source.file_id; | 176 | def_file_id = source.file_id; |
177 | let fields = source.value.field_list()?; | 177 | let fields = source.value.field_list()?; |
178 | record_field_list(fields)? | 178 | record_field_list(fields)? |
diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs index a18dcdd8e..d2a0cfcd4 100644 --- a/crates/ide/src/hover.rs +++ b/crates/ide/src/hover.rs | |||
@@ -207,7 +207,7 @@ fn runnable_action( | |||
207 | }, | 207 | }, |
208 | ModuleDef::Function(it) => { | 208 | ModuleDef::Function(it) => { |
209 | #[allow(deprecated)] | 209 | #[allow(deprecated)] |
210 | let src = it.source_old(sema.db); | 210 | let src = it.source(sema.db)?; |
211 | if src.file_id != file_id.into() { | 211 | if src.file_id != file_id.into() { |
212 | mark::hit!(hover_macro_generated_struct_fn_doc_comment); | 212 | mark::hit!(hover_macro_generated_struct_fn_doc_comment); |
213 | mark::hit!(hover_macro_generated_struct_fn_doc_attr); | 213 | mark::hit!(hover_macro_generated_struct_fn_doc_attr); |
@@ -332,7 +332,7 @@ fn hover_for_definition(db: &RootDatabase, def: Definition) -> Option<Markup> { | |||
332 | } | 332 | } |
333 | Definition::Field(def) => { | 333 | Definition::Field(def) => { |
334 | #[allow(deprecated)] | 334 | #[allow(deprecated)] |
335 | let src = def.source_old(db).value; | 335 | let src = def.source(db)?.value; |
336 | if let FieldSource::Named(it) = src { | 336 | if let FieldSource::Named(it) = src { |
337 | from_def_source_labeled(db, def, it.short_label(), mod_path) | 337 | from_def_source_labeled(db, def, it.short_label(), mod_path) |
338 | } else { | 338 | } else { |
@@ -382,7 +382,7 @@ fn hover_for_definition(db: &RootDatabase, def: Definition) -> Option<Markup> { | |||
382 | A: ShortLabel, | 382 | A: ShortLabel, |
383 | { | 383 | { |
384 | #[allow(deprecated)] | 384 | #[allow(deprecated)] |
385 | let short_label = def.source_old(db).value.short_label(); | 385 | let short_label = def.source(db)?.value.short_label(); |
386 | from_def_source_labeled(db, def, short_label, mod_path) | 386 | from_def_source_labeled(db, def, short_label, mod_path) |
387 | } | 387 | } |
388 | 388 | ||