aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ids.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/ids.rs')
-rw-r--r--crates/ra_hir/src/ids.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_hir/src/ids.rs b/crates/ra_hir/src/ids.rs
index 8ac49eba3..0aa687a08 100644
--- a/crates/ra_hir/src/ids.rs
+++ b/crates/ra_hir/src/ids.rs
@@ -9,25 +9,25 @@ use crate::{
9 9
10use crate::code_model_api::Module; 10use crate::code_model_api::Module;
11 11
12/// hir makes a heavy use of ids: integer (u32) handlers to various things. You 12/// hir makes heavy use of ids: integer (u32) handlers to various things. You
13/// can think of id as a pointer (but without a lifetime) or a file descriptor 13/// can think of id as a pointer (but without a lifetime) or a file descriptor
14/// (but for hir objects). 14/// (but for hir objects).
15/// 15///
16/// This module defines a bunch of ids we are using. The most important ones are 16/// This module defines a bunch of ids we are using. The most important ones are
17/// probably `HirFileId` and `DefId`. 17/// probably `HirFileId` and `DefId`.
18 18
19/// Input to the analyzer is a set of file, where each file is indetified by 19/// Input to the analyzer is a set of files, where each file is indentified by
20/// `FileId` and contains source code. However, another source of source code in 20/// `FileId` and contains source code. However, another source of source code in
21/// Rust are macros: each macro can be thought of as producing a "temporary 21/// Rust are macros: each macro can be thought of as producing a "temporary
22/// file". To assign id to such file, we use the id of a macro call that 22/// file". To assign an id to such a file, we use the id of the macro call that
23/// produced the file. So, a `HirFileId` is either a `FileId` (source code 23/// produced the file. So, a `HirFileId` is either a `FileId` (source code
24/// written by user), or a `MacroCallId` (source code produced by macro). 24/// written by user), or a `MacroCallId` (source code produced by macro).
25/// 25///
26/// What is a `MacroCallId`? Simplifying, it's a `HirFileId` of a file containin 26/// What is a `MacroCallId`? Simplifying, it's a `HirFileId` of a file containin
27/// the call plus the offset of the macro call in the file. Note that this is a 27/// the call plus the offset of the macro call in the file. Note that this is a
28/// recursive definition! Nethetheless, size_of of `HirFileId` is finite 28/// recursive definition! However, the size_of of `HirFileId` is finite
29/// (because everything bottoms out at the real `FileId`) and small 29/// (because everything bottoms out at the real `FileId`) and small
30/// (`MacroCallId` uses location interner). 30/// (`MacroCallId` uses the location interner).
31#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] 31#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
32pub struct HirFileId(HirFileIdRepr); 32pub struct HirFileId(HirFileIdRepr);
33 33
@@ -235,7 +235,7 @@ pub struct SourceItemId {
235 pub(crate) item_id: Option<SourceFileItemId>, 235 pub(crate) item_id: Option<SourceFileItemId>,
236} 236}
237 237
238/// Maps item's `SyntaxNode`s to `SourceFileItemId` and back. 238/// Maps items' `SyntaxNode`s to `SourceFileItemId`s and back.
239#[derive(Debug, PartialEq, Eq)] 239#[derive(Debug, PartialEq, Eq)]
240pub struct SourceFileItems { 240pub struct SourceFileItems {
241 file_id: HirFileId, 241 file_id: HirFileId,