diff --git a/crates/ra_hir/src/code_model_api.rs b/crates/ra_hir/src/code_model_api.rs
index e69f546ffec..8ec6b9b2b02 100644
--- a/crates/ra_hir/src/code_model_api.rs
+++ b/crates/ra_hir/src/code_model_api.rs
@@ -274,6 +274,8 @@ pub struct Function {
pub(crate) def_id: DefId,
}
+pub use crate::code_model_impl::function::ScopeEntryWithSyntax;
+
/// The declared signature of a function.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct FnSignature {
diff --git a/crates/ra_hir/src/code_model_impl/function.rs b/crates/ra_hir/src/code_model_impl/function.rs
index 1bd4cc8022a..009175bab96 100644
--- a/crates/ra_hir/src/code_model_impl/function.rs
+++ b/crates/ra_hir/src/code_model_impl/function.rs
@@ -15,7 +15,7 @@
impl_block::ImplBlock,
};
-pub use self::scope::{FnScopes, ScopesWithSyntaxMapping};
+pub use self::scope::{FnScopes, ScopesWithSyntaxMapping, ScopeEntryWithSyntax};
impl Function {
pub(crate) fn new(def_id: DefId) -> Function {
diff --git a/crates/ra_hir/src/lib.rs b/crates/ra_hir/src/lib.rs
index 1aca2f06717..fe8be570072 100644
--- a/crates/ra_hir/src/lib.rs
+++ b/crates/ra_hir/src/lib.rs
@@ -59,5 +59,5 @@ macro_rules! ctry {
Def,
Module, ModuleSource, Problem,
Struct, Enum, EnumVariant,
- Function, FnSignature,
+ Function, FnSignature, ScopeEntryWithSyntax,
};
diff --git a/crates/ra_ide_api/src/goto_definition.rs b/crates/ra_ide_api/src/goto_definition.rs
index eaddd50835f..8d2ff561ac6 100644
--- a/crates/ra_ide_api/src/goto_definition.rs
+++ b/crates/ra_ide_api/src/goto_definition.rs
@@ -1,22 +1,24 @@
use ra_db::{FileId, Cancelable, SyntaxDatabase};
use ra_syntax::{
- TextRange, AstNode, ast, SyntaxKind::{NAME, MODULE},
+ AstNode, ast,
algo::find_node_at_offset,
};
-use crate::{FilePosition, NavigationTarget, db::RootDatabase};
+use crate::{FilePosition, NavigationTarget, db::RootDatabase, RangeInfo};
pub(crate) fn goto_definition(
db: &RootDatabase,
position: FilePosition,
-) -> Cancelable