diff options
Diffstat (limited to 'crates/ra_hir/src/ids.rs')
-rw-r--r-- | crates/ra_hir/src/ids.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/crates/ra_hir/src/ids.rs b/crates/ra_hir/src/ids.rs index 5272656ec..7dd4b540e 100644 --- a/crates/ra_hir/src/ids.rs +++ b/crates/ra_hir/src/ids.rs | |||
@@ -86,12 +86,9 @@ impl HirFileId { | |||
86 | } | 86 | } |
87 | } | 87 | } |
88 | 88 | ||
89 | pub(crate) fn hir_source_file( | 89 | pub(crate) fn hir_parse(db: &impl HirDatabase, file_id: HirFileId) -> TreeArc<SourceFile> { |
90 | db: &impl HirDatabase, | ||
91 | file_id: HirFileId, | ||
92 | ) -> TreeArc<SourceFile> { | ||
93 | match file_id.0 { | 90 | match file_id.0 { |
94 | HirFileIdRepr::File(file_id) => db.source_file(file_id), | 91 | HirFileIdRepr::File(file_id) => db.parse(file_id), |
95 | HirFileIdRepr::Macro(m) => { | 92 | HirFileIdRepr::Macro(m) => { |
96 | if let Some(exp) = db.expand_macro_invocation(m) { | 93 | if let Some(exp) = db.expand_macro_invocation(m) { |
97 | return exp.file(); | 94 | return exp.file(); |
@@ -370,7 +367,7 @@ impl SourceFileItems { | |||
370 | self.arena.iter().map(|(_id, i)| i).collect::<Vec<_>>(), | 367 | self.arena.iter().map(|(_id, i)| i).collect::<Vec<_>>(), |
371 | ); | 368 | ); |
372 | } | 369 | } |
373 | pub fn id_of_source_file(&self) -> SourceFileItemId { | 370 | pub fn id_of_parse(&self) -> SourceFileItemId { |
374 | let (id, _syntax) = self.arena.iter().next().unwrap(); | 371 | let (id, _syntax) = self.arena.iter().next().unwrap(); |
375 | id | 372 | id |
376 | } | 373 | } |