aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/goto_definition.rs
diff options
context:
space:
mode:
authorVille Penttinen <[email protected]>2019-02-22 08:15:23 +0000
committerVille Penttinen <[email protected]>2019-02-22 08:15:23 +0000
commit247d1c17b385ff8a8c1dda2e899495146b643b98 (patch)
treed0b80f6321d596cc151488e88a2747d168f7137c /crates/ra_ide_api/src/goto_definition.rs
parent39679d499f5e0b5d26ae0f0b707f6db8901cdb66 (diff)
Change resolve_path to return the fully resolved path or PerNs::none
This also adds new pub(crate) resolve_path_segments which returns the PathResult, which may or may not be fully resolved. PathResult is also now pub(crate) since it is an implementation detail.
Diffstat (limited to 'crates/ra_ide_api/src/goto_definition.rs')
-rw-r--r--crates/ra_ide_api/src/goto_definition.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_ide_api/src/goto_definition.rs b/crates/ra_ide_api/src/goto_definition.rs
index 76aaebd52..96ed8c8e9 100644
--- a/crates/ra_ide_api/src/goto_definition.rs
+++ b/crates/ra_ide_api/src/goto_definition.rs
@@ -79,7 +79,7 @@ pub(crate) fn reference_definition(
79 if let Some(path) = 79 if let Some(path) =
80 name_ref.syntax().ancestors().find_map(ast::Path::cast).and_then(hir::Path::from_ast) 80 name_ref.syntax().ancestors().find_map(ast::Path::cast).and_then(hir::Path::from_ast)
81 { 81 {
82 let resolved = resolver.resolve_path(db, &path).into_per_ns(); 82 let resolved = resolver.resolve_path(db, &path);
83 match resolved.clone().take_types().or_else(|| resolved.take_values()) { 83 match resolved.clone().take_types().or_else(|| resolved.take_values()) {
84 Some(Resolution::Def(def)) => return Exact(NavigationTarget::from_def(db, def)), 84 Some(Resolution::Def(def)) => return Exact(NavigationTarget::from_def(db, def)),
85 Some(Resolution::LocalBinding(pat)) => { 85 Some(Resolution::LocalBinding(pat)) => {