From df6bbc6e420e869c4a3a6effb21170c952727d04 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 11 Jan 2019 13:05:45 +0300 Subject: Make from_syntax private --- crates/ra_ide_api/src/navigation_target.rs | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'crates/ra_ide_api/src/navigation_target.rs') diff --git a/crates/ra_ide_api/src/navigation_target.rs b/crates/ra_ide_api/src/navigation_target.rs index bacb7329f..eaf46fd01 100644 --- a/crates/ra_ide_api/src/navigation_target.rs +++ b/crates/ra_ide_api/src/navigation_target.rs @@ -19,19 +19,6 @@ impl NavigationTarget { } } - pub(crate) fn from_syntax( - name: Option, - file_id: FileId, - node: &SyntaxNode, - ) -> NavigationTarget { - NavigationTarget { - file_id, - name: name.map(|n| n.to_string().into()).unwrap_or("".into()), - kind: node.kind(), - range: node.range(), - ptr: Some(LocalSyntaxPtr::new(node)), - } - } // TODO once Def::Item is gone, this should be able to always return a NavigationTarget pub(crate) fn from_def(db: &RootDatabase, def: Def) -> Cancelable> { Ok(match def { @@ -83,4 +70,14 @@ impl NavigationTarget { Def::Item => None, }) } + + fn from_syntax(name: Option, file_id: FileId, node: &SyntaxNode) -> NavigationTarget { + NavigationTarget { + file_id, + name: name.map(|n| n.to_string().into()).unwrap_or("".into()), + kind: node.kind(), + range: node.range(), + ptr: Some(LocalSyntaxPtr::new(node)), + } + } } -- cgit v1.2.3