aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide/src')
-rw-r--r--crates/ide/src/diagnostics/fixes.rs6
-rw-r--r--crates/ide/src/display/navigation_target.rs12
-rw-r--r--crates/ide/src/hover.rs8
3 files changed, 13 insertions, 13 deletions
diff --git a/crates/ide/src/diagnostics/fixes.rs b/crates/ide/src/diagnostics/fixes.rs
index d79f5c170..702e8239d 100644
--- a/crates/ide/src/diagnostics/fixes.rs
+++ b/crates/ide/src/diagnostics/fixes.rs
@@ -156,20 +156,20 @@ fn missing_record_expr_field_fix(
156 let record_fields = match VariantDef::from(def_id) { 156 let record_fields = match VariantDef::from(def_id) {
157 VariantDef::Struct(s) => { 157 VariantDef::Struct(s) => {
158 module = s.module(sema.db); 158 module = s.module(sema.db);
159 let source = s.source(sema.db); 159 let source = s.source_old(sema.db);
160 def_file_id = source.file_id; 160 def_file_id = source.file_id;
161 let fields = source.value.field_list()?; 161 let fields = source.value.field_list()?;
162 record_field_list(fields)? 162 record_field_list(fields)?
163 } 163 }
164 VariantDef::Union(u) => { 164 VariantDef::Union(u) => {
165 module = u.module(sema.db); 165 module = u.module(sema.db);
166 let source = u.source(sema.db); 166 let source = u.source_old(sema.db);
167 def_file_id = source.file_id; 167 def_file_id = source.file_id;
168 source.value.record_field_list()? 168 source.value.record_field_list()?
169 } 169 }
170 VariantDef::Variant(e) => { 170 VariantDef::Variant(e) => {
171 module = e.module(sema.db); 171 module = e.module(sema.db);
172 let source = e.source(sema.db); 172 let source = e.source_old(sema.db);
173 def_file_id = source.file_id; 173 def_file_id = source.file_id;
174 let fields = source.value.field_list()?; 174 let fields = source.value.field_list()?;
175 record_field_list(fields)? 175 record_field_list(fields)?
diff --git a/crates/ide/src/display/navigation_target.rs b/crates/ide/src/display/navigation_target.rs
index bcde2b6f1..de4c0fa12 100644
--- a/crates/ide/src/display/navigation_target.rs
+++ b/crates/ide/src/display/navigation_target.rs
@@ -285,7 +285,7 @@ where
285 D::Ast: ast::NameOwner + ShortLabel, 285 D::Ast: ast::NameOwner + ShortLabel,
286{ 286{
287 fn to_nav(&self, db: &RootDatabase) -> NavigationTarget { 287 fn to_nav(&self, db: &RootDatabase) -> NavigationTarget {
288 let src = self.source(db); 288 let src = self.source_old(db);
289 let mut res = NavigationTarget::from_named( 289 let mut res = NavigationTarget::from_named(
290 db, 290 db,
291 src.as_ref().map(|it| it as &dyn ast::NameOwner), 291 src.as_ref().map(|it| it as &dyn ast::NameOwner),
@@ -314,7 +314,7 @@ impl ToNav for hir::Module {
314 314
315impl ToNav for hir::Impl { 315impl ToNav for hir::Impl {
316 fn to_nav(&self, db: &RootDatabase) -> NavigationTarget { 316 fn to_nav(&self, db: &RootDatabase) -> NavigationTarget {
317 let src = self.source(db); 317 let src = self.source_old(db);
318 let derive_attr = self.is_builtin_derive(db); 318 let derive_attr = self.is_builtin_derive(db);
319 let frange = if let Some(item) = &derive_attr { 319 let frange = if let Some(item) = &derive_attr {
320 item.syntax().original_file_range(db) 320 item.syntax().original_file_range(db)
@@ -339,7 +339,7 @@ impl ToNav for hir::Impl {
339 339
340impl ToNav for hir::Field { 340impl ToNav for hir::Field {
341 fn to_nav(&self, db: &RootDatabase) -> NavigationTarget { 341 fn to_nav(&self, db: &RootDatabase) -> NavigationTarget {
342 let src = self.source(db); 342 let src = self.source_old(db);
343 343
344 match &src.value { 344 match &src.value {
345 FieldSource::Named(it) => { 345 FieldSource::Named(it) => {
@@ -365,7 +365,7 @@ impl ToNav for hir::Field {
365 365
366impl ToNav for hir::MacroDef { 366impl ToNav for hir::MacroDef {
367 fn to_nav(&self, db: &RootDatabase) -> NavigationTarget { 367 fn to_nav(&self, db: &RootDatabase) -> NavigationTarget {
368 let src = self.source(db); 368 let src = self.source_old(db);
369 log::debug!("nav target {:#?}", src.value.syntax()); 369 log::debug!("nav target {:#?}", src.value.syntax());
370 let mut res = NavigationTarget::from_named( 370 let mut res = NavigationTarget::from_named(
371 db, 371 db,
@@ -448,7 +448,7 @@ impl ToNav for hir::Label {
448 448
449impl ToNav for hir::TypeParam { 449impl ToNav for hir::TypeParam {
450 fn to_nav(&self, db: &RootDatabase) -> NavigationTarget { 450 fn to_nav(&self, db: &RootDatabase) -> NavigationTarget {
451 let src = self.source(db); 451 let src = self.source_old(db);
452 let full_range = match &src.value { 452 let full_range = match &src.value {
453 Either::Left(it) => it.syntax().text_range(), 453 Either::Left(it) => it.syntax().text_range(),
454 Either::Right(it) => it.syntax().text_range(), 454 Either::Right(it) => it.syntax().text_range(),
@@ -472,7 +472,7 @@ impl ToNav for hir::TypeParam {
472 472
473impl ToNav for hir::LifetimeParam { 473impl ToNav for hir::LifetimeParam {
474 fn to_nav(&self, db: &RootDatabase) -> NavigationTarget { 474 fn to_nav(&self, db: &RootDatabase) -> NavigationTarget {
475 let src = self.source(db); 475 let src = self.source_old(db);
476 let full_range = src.value.syntax().text_range(); 476 let full_range = src.value.syntax().text_range();
477 NavigationTarget { 477 NavigationTarget {
478 file_id: src.file_id.original_file(db), 478 file_id: src.file_id.original_file(db),
diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs
index 98c7bfbe5..90781ea34 100644
--- a/crates/ide/src/hover.rs
+++ b/crates/ide/src/hover.rs
@@ -206,7 +206,7 @@ fn runnable_action(
206 _ => None, 206 _ => None,
207 }, 207 },
208 ModuleDef::Function(it) => { 208 ModuleDef::Function(it) => {
209 let src = it.source(sema.db); 209 let src = it.source_old(sema.db);
210 if src.file_id != file_id.into() { 210 if src.file_id != file_id.into() {
211 mark::hit!(hover_macro_generated_struct_fn_doc_comment); 211 mark::hit!(hover_macro_generated_struct_fn_doc_comment);
212 mark::hit!(hover_macro_generated_struct_fn_doc_attr); 212 mark::hit!(hover_macro_generated_struct_fn_doc_attr);
@@ -332,11 +332,11 @@ fn hover_for_definition(db: &RootDatabase, def: Definition) -> Option<Markup> {
332 if it.is_proc_macro() { 332 if it.is_proc_macro() {
333 return None; 333 return None;
334 } 334 }
335 let label = macro_label(&it.source(db).value); 335 let label = macro_label(&it.source_old(db).value);
336 from_def_source_labeled(db, it, Some(label), mod_path) 336 from_def_source_labeled(db, it, Some(label), mod_path)
337 } 337 }
338 Definition::Field(def) => { 338 Definition::Field(def) => {
339 let src = def.source(db).value; 339 let src = def.source_old(db).value;
340 if let FieldSource::Named(it) = src { 340 if let FieldSource::Named(it) = src {
341 from_def_source_labeled(db, def, it.short_label(), mod_path) 341 from_def_source_labeled(db, def, it.short_label(), mod_path)
342 } else { 342 } else {
@@ -385,7 +385,7 @@ fn hover_for_definition(db: &RootDatabase, def: Definition) -> Option<Markup> {
385 D: HasSource<Ast = A> + HasAttrs + Copy, 385 D: HasSource<Ast = A> + HasAttrs + Copy,
386 A: ShortLabel, 386 A: ShortLabel,
387 { 387 {
388 let short_label = def.source(db).value.short_label(); 388 let short_label = def.source_old(db).value.short_label();
389 from_def_source_labeled(db, def, short_label, mod_path) 389 from_def_source_labeled(db, def, short_label, mod_path)
390 } 390 }
391 391