From 231f730e87b15ba040a6bb963d5b6077ed02e2d9 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Date: Mon, 22 Jan 2024 15:18:51 +0500 Subject: [PATCH] internal: Make TryToNav trait public Currently there is no proper way to get a target FileRange for a given Definition. --- crates/ide/src/lib.rs | 4 ++-- crates/ide/src/navigation_target.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/ide/src/lib.rs b/crates/ide/src/lib.rs index 81682e07e0..a50aa2e6df 100644 --- a/crates/ide/src/lib.rs +++ b/crates/ide/src/lib.rs @@ -79,7 +79,7 @@ use syntax::SourceFile; use triomphe::Arc; use view_memory_layout::{view_memory_layout, RecursiveMemoryLayout}; -use crate::navigation_target::{ToNav, TryToNav}; +use crate::navigation_target::ToNav; pub use crate::{ annotations::{Annotation, AnnotationConfig, AnnotationKind, AnnotationLocation}, @@ -104,7 +104,7 @@ pub use crate::{ SymbolInformationKind, }, move_item::Direction, - navigation_target::{NavigationTarget, UpmappingResult}, + navigation_target::{NavigationTarget, TryToNav, UpmappingResult}, prime_caches::ParallelPrimeCachesProgress, references::ReferenceSearchResult, rename::RenameError, diff --git a/crates/ide/src/navigation_target.rs b/crates/ide/src/navigation_target.rs index c8d7b7e25b..bfd91feeb3 100644 --- a/crates/ide/src/navigation_target.rs +++ b/crates/ide/src/navigation_target.rs @@ -76,7 +76,7 @@ pub(crate) trait ToNav { fn to_nav(&self, db: &RootDatabase) -> UpmappingResult; } -pub(crate) trait TryToNav { +pub trait TryToNav { fn try_to_nav(&self, db: &RootDatabase) -> Option>; }