diff options
Diffstat (limited to 'crates/ra_hir/src/function/mod.rs')
-rw-r--r-- | crates/ra_hir/src/function/mod.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/ra_hir/src/function/mod.rs b/crates/ra_hir/src/function/mod.rs index a3ed00f02..c8af2e54f 100644 --- a/crates/ra_hir/src/function/mod.rs +++ b/crates/ra_hir/src/function/mod.rs | |||
@@ -15,10 +15,10 @@ use crate::{ | |||
15 | FnId, HirDatabase, SourceItemId, | 15 | FnId, HirDatabase, SourceItemId, |
16 | }; | 16 | }; |
17 | 17 | ||
18 | pub(crate) use self::scope::FnScopes; | 18 | pub use self::scope::FnScopes; |
19 | 19 | ||
20 | impl FnId { | 20 | impl FnId { |
21 | pub(crate) fn get(db: &impl HirDatabase, file_id: FileId, fn_def: ast::FnDef) -> FnId { | 21 | pub fn get(db: &impl HirDatabase, file_id: FileId, fn_def: ast::FnDef) -> FnId { |
22 | let file_items = db.file_items(file_id); | 22 | let file_items = db.file_items(file_id); |
23 | let item_id = file_items.id_of(fn_def.syntax()); | 23 | let item_id = file_items.id_of(fn_def.syntax()); |
24 | let item_id = SourceItemId { file_id, item_id }; | 24 | let item_id = SourceItemId { file_id, item_id }; |
@@ -26,12 +26,12 @@ impl FnId { | |||
26 | } | 26 | } |
27 | } | 27 | } |
28 | 28 | ||
29 | pub(crate) struct Function { | 29 | pub struct Function { |
30 | fn_id: FnId, | 30 | fn_id: FnId, |
31 | } | 31 | } |
32 | 32 | ||
33 | impl Function { | 33 | impl Function { |
34 | pub(crate) fn guess_from_source( | 34 | pub fn guess_from_source( |
35 | db: &impl HirDatabase, | 35 | db: &impl HirDatabase, |
36 | file_id: FileId, | 36 | file_id: FileId, |
37 | fn_def: ast::FnDef, | 37 | fn_def: ast::FnDef, |
@@ -40,7 +40,7 @@ impl Function { | |||
40 | Function { fn_id } | 40 | Function { fn_id } |
41 | } | 41 | } |
42 | 42 | ||
43 | pub(crate) fn guess_for_name_ref( | 43 | pub fn guess_for_name_ref( |
44 | db: &impl HirDatabase, | 44 | db: &impl HirDatabase, |
45 | file_id: FileId, | 45 | file_id: FileId, |
46 | name_ref: ast::NameRef, | 46 | name_ref: ast::NameRef, |
@@ -48,7 +48,7 @@ impl Function { | |||
48 | Function::guess_for_node(db, file_id, name_ref.syntax()) | 48 | Function::guess_for_node(db, file_id, name_ref.syntax()) |
49 | } | 49 | } |
50 | 50 | ||
51 | pub(crate) fn guess_for_bind_pat( | 51 | pub fn guess_for_bind_pat( |
52 | db: &impl HirDatabase, | 52 | db: &impl HirDatabase, |
53 | file_id: FileId, | 53 | file_id: FileId, |
54 | bind_pat: ast::BindPat, | 54 | bind_pat: ast::BindPat, |
@@ -66,11 +66,11 @@ impl Function { | |||
66 | Some(res) | 66 | Some(res) |
67 | } | 67 | } |
68 | 68 | ||
69 | pub(crate) fn scope(&self, db: &impl HirDatabase) -> Arc<FnScopes> { | 69 | pub fn scope(&self, db: &impl HirDatabase) -> Arc<FnScopes> { |
70 | db.fn_scopes(self.fn_id) | 70 | db.fn_scopes(self.fn_id) |
71 | } | 71 | } |
72 | 72 | ||
73 | pub(crate) fn signature_info(&self, db: &impl HirDatabase) -> Option<FnSignatureInfo> { | 73 | pub fn signature_info(&self, db: &impl HirDatabase) -> Option<FnSignatureInfo> { |
74 | let syntax = db.fn_syntax(self.fn_id); | 74 | let syntax = db.fn_syntax(self.fn_id); |
75 | FnSignatureInfo::new(syntax.borrowed()) | 75 | FnSignatureInfo::new(syntax.borrowed()) |
76 | } | 76 | } |