diff options
author | Aleksey Kladov <[email protected]> | 2019-03-02 13:59:18 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-03-02 13:59:18 +0000 |
commit | 8fc08d36e33ad95d70d262cef7d2e694f7f8f502 (patch) | |
tree | ac8a3c42e334f1c9b5207de9b0c6ba55c8838c83 /crates | |
parent | 03b2ab8e1f11f0e05234da9162ef57f7a30a64af (diff) |
remove second way to get the body
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_hir/src/expr.rs | 4 | ||||
-rw-r--r-- | crates/ra_ide_api/src/goto_definition.rs | 2 |
2 files changed, 1 insertions, 5 deletions
diff --git a/crates/ra_hir/src/expr.rs b/crates/ra_hir/src/expr.rs index 6043f4028..d6c551fb2 100644 --- a/crates/ra_hir/src/expr.rs +++ b/crates/ra_hir/src/expr.rs | |||
@@ -77,10 +77,6 @@ impl Body { | |||
77 | pub fn pats(&self) -> impl Iterator<Item = (PatId, &Pat)> { | 77 | pub fn pats(&self) -> impl Iterator<Item = (PatId, &Pat)> { |
78 | self.pats.iter() | 78 | self.pats.iter() |
79 | } | 79 | } |
80 | |||
81 | pub fn source_map(&self, db: &impl HirDatabase) -> Arc<BodySourceMap> { | ||
82 | db.body_with_source_map(self.owner).1 | ||
83 | } | ||
84 | } | 80 | } |
85 | 81 | ||
86 | // needs arbitrary_self_types to be a method... or maybe move to the def? | 82 | // needs arbitrary_self_types to be a method... or maybe move to the def? |
diff --git a/crates/ra_ide_api/src/goto_definition.rs b/crates/ra_ide_api/src/goto_definition.rs index 1f284af56..9ec179593 100644 --- a/crates/ra_ide_api/src/goto_definition.rs +++ b/crates/ra_ide_api/src/goto_definition.rs | |||
@@ -109,7 +109,7 @@ pub(crate) fn reference_definition( | |||
109 | Some(Resolution::Def(def)) => return Exact(NavigationTarget::from_def(db, def)), | 109 | Some(Resolution::Def(def)) => return Exact(NavigationTarget::from_def(db, def)), |
110 | Some(Resolution::LocalBinding(pat)) => { | 110 | Some(Resolution::LocalBinding(pat)) => { |
111 | let body = resolver.body().expect("no body for local binding"); | 111 | let body = resolver.body().expect("no body for local binding"); |
112 | let source_map = body.source_map(db); | 112 | let source_map = body.owner().body_source_map(db); |
113 | let ptr = source_map.pat_syntax(pat).expect("pattern not found in syntax mapping"); | 113 | let ptr = source_map.pat_syntax(pat).expect("pattern not found in syntax mapping"); |
114 | let name = | 114 | let name = |
115 | path.as_ident().cloned().expect("local binding from a multi-segment path"); | 115 | path.as_ident().cloned().expect("local binding from a multi-segment path"); |