aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src/hir/mod.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-11-27 22:53:54 +0000
committerAleksey Kladov <[email protected]>2018-11-27 22:53:54 +0000
commit9027a21f9a1c7fcee0a59a1e28928fed29781dd8 (patch)
tree48a1d6ae7046e995baafbb053c43688cd9496935 /crates/ra_analysis/src/hir/mod.rs
parent00df339c419fc75af6a939b75be8bef5b5a69732 (diff)
Introduce SourceItemId
Diffstat (limited to 'crates/ra_analysis/src/hir/mod.rs')
-rw-r--r--crates/ra_analysis/src/hir/mod.rs7
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;
16use ra_syntax::{SyntaxNodeRef, SyntaxNode}; 16use ra_syntax::{SyntaxNodeRef, SyntaxNode};
17 17
18use crate::{ 18use 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.
54pub(crate) type SourceFileItemId = Id<SyntaxNode>; 55pub(crate) type SourceFileItemId = Id<SyntaxNode>;
55 56
57#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
58pub(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)]
58pub(crate) struct SourceFileItems { 65pub(crate) struct SourceFileItems {