Make from_syntax private
This commit is contained in:
parent
2aa125251e
commit
df6bbc6e42
@ -243,7 +243,7 @@ impl Query {
|
||||
}
|
||||
}
|
||||
|
||||
/// `NavigationTarget` represents and element in the editor's UI whihc you can
|
||||
/// `NavigationTarget` represents and element in the editor's UI which you can
|
||||
/// click on to navigate to a particular piece of code.
|
||||
///
|
||||
/// Typically, a `NavigationTarget` corresponds to some element in the source
|
||||
|
@ -19,19 +19,6 @@ impl NavigationTarget {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn from_syntax(
|
||||
name: Option<Name>,
|
||||
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<Option<NavigationTarget>> {
|
||||
Ok(match def {
|
||||
@ -83,4 +70,14 @@ impl NavigationTarget {
|
||||
Def::Item => None,
|
||||
})
|
||||
}
|
||||
|
||||
fn from_syntax(name: Option<Name>, 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)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user