aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src/descriptors/function/imp.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-11-27 18:45:42 +0000
committerAleksey Kladov <[email protected]>2018-11-27 18:45:42 +0000
commitd659b7a2f03788eb0f4f15e3730bbf65a18ed818 (patch)
treec7112f1e0785606ab67b3df8d7a8b411909f54e1 /crates/ra_analysis/src/descriptors/function/imp.rs
parent9f08341aa486ea59cb488635f19e960523568fb8 (diff)
start descriptors -> hir rename
Diffstat (limited to 'crates/ra_analysis/src/descriptors/function/imp.rs')
-rw-r--r--crates/ra_analysis/src/descriptors/function/imp.rs21
1 files changed, 0 insertions, 21 deletions
diff --git a/crates/ra_analysis/src/descriptors/function/imp.rs b/crates/ra_analysis/src/descriptors/function/imp.rs
deleted file mode 100644
index e09deba0f..000000000
--- a/crates/ra_analysis/src/descriptors/function/imp.rs
+++ /dev/null
@@ -1,21 +0,0 @@
1use std::sync::Arc;
2
3use ra_syntax::ast::{AstNode, FnDef, FnDefNode};
4
5use crate::descriptors::{
6 function::{FnId, FnScopes},
7 DescriptorDatabase,
8};
9
10/// Resolve `FnId` to the corresponding `SyntaxNode`
11pub(crate) fn fn_syntax(db: &impl DescriptorDatabase, fn_id: FnId) -> FnDefNode {
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()
15}
16
17pub(crate) fn fn_scopes(db: &impl DescriptorDatabase, fn_id: FnId) -> Arc<FnScopes> {
18 let syntax = db._fn_syntax(fn_id);
19 let res = FnScopes::new(syntax.borrowed());
20 Arc::new(res)
21}