diff options
author | Aleksey Kladov <[email protected]> | 2018-11-27 22:53:54 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-11-27 22:53:54 +0000 |
commit | 9027a21f9a1c7fcee0a59a1e28928fed29781dd8 (patch) | |
tree | 48a1d6ae7046e995baafbb053c43688cd9496935 /crates/ra_analysis/src/hir/mod.rs | |
parent | 00df339c419fc75af6a939b75be8bef5b5a69732 (diff) |
Introduce SourceItemId
Diffstat (limited to 'crates/ra_analysis/src/hir/mod.rs')
-rw-r--r-- | crates/ra_analysis/src/hir/mod.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/ra_analysis/src/hir/mod.rs b/crates/ra_analysis/src/hir/mod.rs index aa416df20..9527cc33f 100644 --- a/crates/ra_analysis/src/hir/mod.rs +++ b/crates/ra_analysis/src/hir/mod.rs | |||
@@ -16,6 +16,7 @@ use std::ops::Index; | |||
16 | use ra_syntax::{SyntaxNodeRef, SyntaxNode}; | 16 | use ra_syntax::{SyntaxNodeRef, SyntaxNode}; |
17 | 17 | ||
18 | use crate::{ | 18 | use crate::{ |
19 | FileId, | ||
19 | hir::db::HirDatabase, | 20 | hir::db::HirDatabase, |
20 | loc2id::{DefId, DefLoc}, | 21 | loc2id::{DefId, DefLoc}, |
21 | Cancelable, | 22 | Cancelable, |
@@ -53,6 +54,12 @@ impl DefId { | |||
53 | /// it's OK to use it as a salsa key/value. | 54 | /// it's OK to use it as a salsa key/value. |
54 | pub(crate) type SourceFileItemId = Id<SyntaxNode>; | 55 | pub(crate) type SourceFileItemId = Id<SyntaxNode>; |
55 | 56 | ||
57 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | ||
58 | pub(crate) struct SourceItemId { | ||
59 | file_id: FileId, | ||
60 | item_id: SourceFileItemId, | ||
61 | } | ||
62 | |||
56 | /// Maps item's `SyntaxNode`s to `SourceFileItemId` and back. | 63 | /// Maps item's `SyntaxNode`s to `SourceFileItemId` and back. |
57 | #[derive(Debug, PartialEq, Eq, Default)] | 64 | #[derive(Debug, PartialEq, Eq, Default)] |
58 | pub(crate) struct SourceFileItems { | 65 | pub(crate) struct SourceFileItems { |