aboutsummaryrefslogtreecommitdiff
path: root/crates/ide
diff options
context:
space:
mode:
authorNick Spain <[email protected]>2021-01-02 11:11:25 +0000
committerNick Spain <[email protected]>2021-01-02 11:11:25 +0000
commit40cd6cdf67dcfad89a80ff3a662bec2dfd983d67 (patch)
tree9101b9ae60806cfa9612d4617f6acef514c3f111 /crates/ide
parent887028fcf52bf7f3af55114f112123c902989bed (diff)
Fix ConstParam HasSource impl and implement TryToNav not Nav
Diffstat (limited to 'crates/ide')
-rw-r--r--crates/ide/src/display/navigation_target.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ide/src/display/navigation_target.rs b/crates/ide/src/display/navigation_target.rs
index 1fb26c226..e24c78301 100644
--- a/crates/ide/src/display/navigation_target.rs
+++ b/crates/ide/src/display/navigation_target.rs
@@ -218,7 +218,7 @@ impl TryToNav for Definition {
218 Definition::TypeParam(it) => it.try_to_nav(db), 218 Definition::TypeParam(it) => it.try_to_nav(db),
219 Definition::LifetimeParam(it) => it.try_to_nav(db), 219 Definition::LifetimeParam(it) => it.try_to_nav(db),
220 Definition::Label(it) => Some(it.to_nav(db)), 220 Definition::Label(it) => Some(it.to_nav(db)),
221 Definition::ConstParam(it) => Some(it.to_nav(db)), 221 Definition::ConstParam(it) => it.try_to_nav(db),
222 } 222 }
223 } 223 }
224} 224}
@@ -479,11 +479,11 @@ impl TryToNav for hir::LifetimeParam {
479 } 479 }
480} 480}
481 481
482impl ToNav for hir::ConstParam { 482impl TryToNav for hir::ConstParam {
483 fn to_nav(&self, db: &RootDatabase) -> NavigationTarget { 483 fn try_to_nav(&self, db: &RootDatabase) -> Option<NavigationTarget> {
484 let src = self.source(db); 484 let src = self.source(db)?;
485 let full_range = src.value.syntax().text_range(); 485 let full_range = src.value.syntax().text_range();
486 NavigationTarget { 486 Some(NavigationTarget {
487 file_id: src.file_id.original_file(db), 487 file_id: src.file_id.original_file(db),
488 name: self.name(db).to_string().into(), 488 name: self.name(db).to_string().into(),
489 kind: Some(SymbolKind::ConstParam), 489 kind: Some(SymbolKind::ConstParam),
@@ -492,7 +492,7 @@ impl ToNav for hir::ConstParam {
492 container_name: None, 492 container_name: None,
493 description: None, 493 description: None,
494 docs: None, 494 docs: None,
495 } 495 })
496 } 496 }
497} 497}
498 498