diff options
author | Aleksey Kladov <[email protected]> | 2018-11-18 13:21:23 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-11-18 13:21:23 +0000 |
commit | 4e48917c00d24e1e1785e1959a2f3495a902410b (patch) | |
tree | 0ae3a1f3c92ce9e308934e023d6a24385b4260d6 /crates/ra_analysis/src/descriptors/function/imp.rs | |
parent | cb22a799d60c6c5f81ad0f3d0361f575264f3bc2 (diff) |
use loc2id for FnIds
Diffstat (limited to 'crates/ra_analysis/src/descriptors/function/imp.rs')
-rw-r--r-- | crates/ra_analysis/src/descriptors/function/imp.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_analysis/src/descriptors/function/imp.rs b/crates/ra_analysis/src/descriptors/function/imp.rs index a989a04cd..a7257acf9 100644 --- a/crates/ra_analysis/src/descriptors/function/imp.rs +++ b/crates/ra_analysis/src/descriptors/function/imp.rs | |||
@@ -8,9 +8,9 @@ use crate::descriptors::{ | |||
8 | }; | 8 | }; |
9 | 9 | ||
10 | /// Resolve `FnId` to the corresponding `SyntaxNode` | 10 | /// Resolve `FnId` to the corresponding `SyntaxNode` |
11 | /// TODO: this should return something more type-safe then `SyntaxNode` | ||
12 | pub(crate) fn fn_syntax(db: &impl DescriptorDatabase, fn_id: FnId) -> FnDefNode { | 11 | pub(crate) fn fn_syntax(db: &impl DescriptorDatabase, fn_id: FnId) -> FnDefNode { |
13 | let syntax = db.resolve_syntax_ptr(fn_id.0); | 12 | let ptr = db.id_maps().fn_ptr(fn_id); |
13 | let syntax = db.resolve_syntax_ptr(ptr); | ||
14 | FnDef::cast(syntax.borrowed()).unwrap().owned() | 14 | FnDef::cast(syntax.borrowed()).unwrap().owned() |
15 | } | 15 | } |
16 | 16 | ||