diff options
author | Aleksey Kladov <[email protected]> | 2019-01-03 18:28:35 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-03 18:29:17 +0000 |
commit | d61707b4e1f0bdfc7f62b1abf78fdc45c0128699 (patch) | |
tree | 5a278ad534d2de9f308bbdfef323c3b20bf9a653 /crates/ra_hir/src/ids.rs | |
parent | ebd7c04faa27564ca3f03eed6d4a3636b7d3fc4c (diff) |
index stuff produced by macros
Diffstat (limited to 'crates/ra_hir/src/ids.rs')
-rw-r--r-- | crates/ra_hir/src/ids.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/ra_hir/src/ids.rs b/crates/ra_hir/src/ids.rs index a09dee8b1..4c7ebe3ea 100644 --- a/crates/ra_hir/src/ids.rs +++ b/crates/ra_hir/src/ids.rs | |||
@@ -48,6 +48,13 @@ impl HirFileId { | |||
48 | } | 48 | } |
49 | } | 49 | } |
50 | 50 | ||
51 | pub(crate) fn as_macro_call_id(self) -> Option<MacroCallId> { | ||
52 | match self.0 { | ||
53 | HirFileIdRepr::Macro(it) => Some(it), | ||
54 | _ => None, | ||
55 | } | ||
56 | } | ||
57 | |||
51 | pub(crate) fn hir_source_file(db: &impl HirDatabase, file_id: HirFileId) -> SourceFileNode { | 58 | pub(crate) fn hir_source_file(db: &impl HirDatabase, file_id: HirFileId) -> SourceFileNode { |
52 | match file_id.0 { | 59 | match file_id.0 { |
53 | HirFileIdRepr::File(file_id) => db.source_file(file_id), | 60 | HirFileIdRepr::File(file_id) => db.source_file(file_id), |