aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/display
diff options
context:
space:
mode:
authorNick Spain <[email protected]>2021-01-01 02:50:50 +0000
committerNick Spain <[email protected]>2021-01-02 10:53:51 +0000
commitea4708c444509449b86c50b7b1b23f9ff5af4e97 (patch)
tree2c5c5c17589f0457ba9e63b4370eb9c6951b1d87 /crates/ide/src/display
parent2de2b1eca3c3a3a74c0374f4de0b0c3ff25e66a9 (diff)
Mark HasSource::source_old as deprecated but allow at all call sites
Diffstat (limited to 'crates/ide/src/display')
-rw-r--r--crates/ide/src/display/navigation_target.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/ide/src/display/navigation_target.rs b/crates/ide/src/display/navigation_target.rs
index de4c0fa12..efa0418ad 100644
--- a/crates/ide/src/display/navigation_target.rs
+++ b/crates/ide/src/display/navigation_target.rs
@@ -285,6 +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 #[allow(deprecated)]
288 let src = self.source_old(db); 289 let src = self.source_old(db);
289 let mut res = NavigationTarget::from_named( 290 let mut res = NavigationTarget::from_named(
290 db, 291 db,
@@ -314,6 +315,7 @@ impl ToNav for hir::Module {
314 315
315impl ToNav for hir::Impl { 316impl ToNav for hir::Impl {
316 fn to_nav(&self, db: &RootDatabase) -> NavigationTarget { 317 fn to_nav(&self, db: &RootDatabase) -> NavigationTarget {
318 #[allow(deprecated)]
317 let src = self.source_old(db); 319 let src = self.source_old(db);
318 let derive_attr = self.is_builtin_derive(db); 320 let derive_attr = self.is_builtin_derive(db);
319 let frange = if let Some(item) = &derive_attr { 321 let frange = if let Some(item) = &derive_attr {
@@ -339,6 +341,7 @@ impl ToNav for hir::Impl {
339 341
340impl ToNav for hir::Field { 342impl ToNav for hir::Field {
341 fn to_nav(&self, db: &RootDatabase) -> NavigationTarget { 343 fn to_nav(&self, db: &RootDatabase) -> NavigationTarget {
344 #[allow(deprecated)]
342 let src = self.source_old(db); 345 let src = self.source_old(db);
343 346
344 match &src.value { 347 match &src.value {
@@ -365,6 +368,7 @@ impl ToNav for hir::Field {
365 368
366impl ToNav for hir::MacroDef { 369impl ToNav for hir::MacroDef {
367 fn to_nav(&self, db: &RootDatabase) -> NavigationTarget { 370 fn to_nav(&self, db: &RootDatabase) -> NavigationTarget {
371 #[allow(deprecated)]
368 let src = self.source_old(db); 372 let src = self.source_old(db);
369 log::debug!("nav target {:#?}", src.value.syntax()); 373 log::debug!("nav target {:#?}", src.value.syntax());
370 let mut res = NavigationTarget::from_named( 374 let mut res = NavigationTarget::from_named(
@@ -448,6 +452,7 @@ impl ToNav for hir::Label {
448 452
449impl ToNav for hir::TypeParam { 453impl ToNav for hir::TypeParam {
450 fn to_nav(&self, db: &RootDatabase) -> NavigationTarget { 454 fn to_nav(&self, db: &RootDatabase) -> NavigationTarget {
455 #[allow(deprecated)]
451 let src = self.source_old(db); 456 let src = self.source_old(db);
452 let full_range = match &src.value { 457 let full_range = match &src.value {
453 Either::Left(it) => it.syntax().text_range(), 458 Either::Left(it) => it.syntax().text_range(),
@@ -472,6 +477,7 @@ impl ToNav for hir::TypeParam {
472 477
473impl ToNav for hir::LifetimeParam { 478impl ToNav for hir::LifetimeParam {
474 fn to_nav(&self, db: &RootDatabase) -> NavigationTarget { 479 fn to_nav(&self, db: &RootDatabase) -> NavigationTarget {
480 #[allow(deprecated)]
475 let src = self.source_old(db); 481 let src = self.source_old(db);
476 let full_range = src.value.syntax().text_range(); 482 let full_range = src.value.syntax().text_range();
477 NavigationTarget { 483 NavigationTarget {