aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-08-13 15:36:55 +0100
committerAleksey Kladov <[email protected]>2020-08-13 15:36:55 +0100
commitae71a631fd657368e8593feb5e025d23147afe60 (patch)
treef38493871f6598f37a9c342713ce3faff0057646
parent6a77ec7bbe6ddbf663dce9529d11d1bb56c5489a (diff)
Rename ra_hir -> hir
-rw-r--r--Cargo.lock46
-rw-r--r--crates/hir/Cargo.toml (renamed from crates/ra_hir/Cargo.toml)9
-rw-r--r--crates/hir/src/code_model.rs (renamed from crates/ra_hir/src/code_model.rs)0
-rw-r--r--crates/hir/src/db.rs (renamed from crates/ra_hir/src/db.rs)0
-rw-r--r--crates/hir/src/diagnostics.rs (renamed from crates/ra_hir/src/diagnostics.rs)0
-rw-r--r--crates/hir/src/from_id.rs (renamed from crates/ra_hir/src/from_id.rs)0
-rw-r--r--crates/hir/src/has_source.rs (renamed from crates/ra_hir/src/has_source.rs)0
-rw-r--r--crates/hir/src/lib.rs (renamed from crates/ra_hir/src/lib.rs)4
-rw-r--r--crates/hir/src/semantics.rs (renamed from crates/ra_hir/src/semantics.rs)0
-rw-r--r--crates/hir/src/semantics/source_to_def.rs (renamed from crates/ra_hir/src/semantics/source_to_def.rs)0
-rw-r--r--crates/hir/src/source_analyzer.rs (renamed from crates/ra_hir/src/source_analyzer.rs)0
-rw-r--r--crates/ra_assists/Cargo.toml2
-rw-r--r--crates/ra_ide/Cargo.toml2
-rw-r--r--crates/ra_ide/src/lib.rs2
-rw-r--r--crates/ra_ide_db/Cargo.toml2
-rw-r--r--crates/ra_ssr/Cargo.toml2
-rw-r--r--crates/rust-analyzer/Cargo.toml2
-rw-r--r--docs/dev/README.md6
-rw-r--r--docs/dev/architecture.md6
-rw-r--r--docs/dev/guide.md38
-rw-r--r--xtask/tests/tidy.rs2
21 files changed, 61 insertions, 62 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 6ecea3647..ae71ea9fd 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -464,6 +464,24 @@ dependencies = [
464] 464]
465 465
466[[package]] 466[[package]]
467name = "hir"
468version = "0.0.0"
469dependencies = [
470 "arrayvec",
471 "base_db",
472 "either",
473 "hir_def",
474 "hir_expand",
475 "hir_ty",
476 "itertools",
477 "log",
478 "profile",
479 "rustc-hash",
480 "stdx",
481 "syntax",
482]
483
484[[package]]
467name = "hir_def" 485name = "hir_def"
468version = "0.0.0" 486version = "0.0.0"
469dependencies = [ 487dependencies = [
@@ -1071,9 +1089,9 @@ version = "0.1.0"
1071dependencies = [ 1089dependencies = [
1072 "base_db", 1090 "base_db",
1073 "either", 1091 "either",
1092 "hir",
1074 "itertools", 1093 "itertools",
1075 "profile", 1094 "profile",
1076 "ra_hir",
1077 "ra_ide_db", 1095 "ra_ide_db",
1078 "rustc-hash", 1096 "rustc-hash",
1079 "stdx", 1097 "stdx",
@@ -1083,24 +1101,6 @@ dependencies = [
1083] 1101]
1084 1102
1085[[package]] 1103[[package]]
1086name = "ra_hir"
1087version = "0.1.0"
1088dependencies = [
1089 "arrayvec",
1090 "base_db",
1091 "either",
1092 "hir_def",
1093 "hir_expand",
1094 "hir_ty",
1095 "itertools",
1096 "log",
1097 "profile",
1098 "rustc-hash",
1099 "stdx",
1100 "syntax",
1101]
1102
1103[[package]]
1104name = "ra_ide" 1104name = "ra_ide"
1105version = "0.1.0" 1105version = "0.1.0"
1106dependencies = [ 1106dependencies = [
@@ -1108,13 +1108,13 @@ dependencies = [
1108 "cfg", 1108 "cfg",
1109 "either", 1109 "either",
1110 "expect", 1110 "expect",
1111 "hir",
1111 "indexmap", 1112 "indexmap",
1112 "itertools", 1113 "itertools",
1113 "log", 1114 "log",
1114 "oorandom", 1115 "oorandom",
1115 "profile", 1116 "profile",
1116 "ra_assists", 1117 "ra_assists",
1117 "ra_hir",
1118 "ra_ide_db", 1118 "ra_ide_db",
1119 "ra_ssr", 1119 "ra_ssr",
1120 "rustc-hash", 1120 "rustc-hash",
@@ -1131,10 +1131,10 @@ dependencies = [
1131 "base_db", 1131 "base_db",
1132 "either", 1132 "either",
1133 "fst", 1133 "fst",
1134 "hir",
1134 "log", 1135 "log",
1135 "once_cell", 1136 "once_cell",
1136 "profile", 1137 "profile",
1137 "ra_hir",
1138 "rayon", 1138 "rayon",
1139 "rustc-hash", 1139 "rustc-hash",
1140 "stdx", 1140 "stdx",
@@ -1149,7 +1149,7 @@ version = "0.1.0"
1149dependencies = [ 1149dependencies = [
1150 "base_db", 1150 "base_db",
1151 "expect", 1151 "expect",
1152 "ra_hir", 1152 "hir",
1153 "ra_ide_db", 1153 "ra_ide_db",
1154 "rustc-hash", 1154 "rustc-hash",
1155 "syntax", 1155 "syntax",
@@ -1236,6 +1236,7 @@ dependencies = [
1236 "env_logger", 1236 "env_logger",
1237 "expect", 1237 "expect",
1238 "flycheck", 1238 "flycheck",
1239 "hir",
1239 "hir_def", 1240 "hir_def",
1240 "hir_ty", 1241 "hir_ty",
1241 "itertools", 1242 "itertools",
@@ -1251,7 +1252,6 @@ dependencies = [
1251 "proc_macro_srv", 1252 "proc_macro_srv",
1252 "profile", 1253 "profile",
1253 "project_model", 1254 "project_model",
1254 "ra_hir",
1255 "ra_ide", 1255 "ra_ide",
1256 "ra_ide_db", 1256 "ra_ide_db",
1257 "ra_ssr", 1257 "ra_ssr",
diff --git a/crates/ra_hir/Cargo.toml b/crates/hir/Cargo.toml
index 61cc099ac..dbb2986b6 100644
--- a/crates/ra_hir/Cargo.toml
+++ b/crates/hir/Cargo.toml
@@ -1,9 +1,9 @@
1[package] 1[package]
2edition = "2018" 2name = "hir"
3name = "ra_hir" 3version = "0.0.0"
4version = "0.1.0"
5authors = ["rust-analyzer developers"]
6license = "MIT OR Apache-2.0" 4license = "MIT OR Apache-2.0"
5authors = ["rust-analyzer developers"]
6edition = "2018"
7 7
8[lib] 8[lib]
9doctest = false 9doctest = false
@@ -13,7 +13,6 @@ log = "0.4.8"
13rustc-hash = "1.1.0" 13rustc-hash = "1.1.0"
14either = "1.5.3" 14either = "1.5.3"
15arrayvec = "0.5.1" 15arrayvec = "0.5.1"
16
17itertools = "0.9.0" 16itertools = "0.9.0"
18 17
19stdx = { path = "../stdx" } 18stdx = { path = "../stdx" }
diff --git a/crates/ra_hir/src/code_model.rs b/crates/hir/src/code_model.rs
index 8ffb9e99b..8ffb9e99b 100644
--- a/crates/ra_hir/src/code_model.rs
+++ b/crates/hir/src/code_model.rs
diff --git a/crates/ra_hir/src/db.rs b/crates/hir/src/db.rs
index 07333c453..07333c453 100644
--- a/crates/ra_hir/src/db.rs
+++ b/crates/hir/src/db.rs
diff --git a/crates/ra_hir/src/diagnostics.rs b/crates/hir/src/diagnostics.rs
index 363164b9b..363164b9b 100644
--- a/crates/ra_hir/src/diagnostics.rs
+++ b/crates/hir/src/diagnostics.rs
diff --git a/crates/ra_hir/src/from_id.rs b/crates/hir/src/from_id.rs
index a53ac1e08..a53ac1e08 100644
--- a/crates/ra_hir/src/from_id.rs
+++ b/crates/hir/src/from_id.rs
diff --git a/crates/ra_hir/src/has_source.rs b/crates/hir/src/has_source.rs
index a50d4ff02..a50d4ff02 100644
--- a/crates/ra_hir/src/has_source.rs
+++ b/crates/hir/src/has_source.rs
diff --git a/crates/ra_hir/src/lib.rs b/crates/hir/src/lib.rs
index 34b02c536..24a0f6b4b 100644
--- a/crates/ra_hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -9,11 +9,11 @@
9//! It is written in "OO" style. Each type is self contained (as in, it knows it's 9//! It is written in "OO" style. Each type is self contained (as in, it knows it's
10//! parents and full context). It should be "clean code". 10//! parents and full context). It should be "clean code".
11//! 11//!
12//! `ra_hir_*` crates are the implementation of the compiler logic. 12//! `hir_*` crates are the implementation of the compiler logic.
13//! They are written in "ECS" style, with relatively little abstractions. 13//! They are written in "ECS" style, with relatively little abstractions.
14//! Many types are not self-contained, and explicitly use local indexes, arenas, etc. 14//! Many types are not self-contained, and explicitly use local indexes, arenas, etc.
15//! 15//!
16//! `ra_hir` is what insulates the "we don't know how to actually write an incremental compiler" 16//! `hir` is what insulates the "we don't know how to actually write an incremental compiler"
17//! from the ide with completions, hovers, etc. It is a (soft, internal) boundary: 17//! from the ide with completions, hovers, etc. It is a (soft, internal) boundary:
18//! https://www.tedinski.com/2018/02/06/system-boundaries.html. 18//! https://www.tedinski.com/2018/02/06/system-boundaries.html.
19 19
diff --git a/crates/ra_hir/src/semantics.rs b/crates/hir/src/semantics.rs
index 1467d825d..1467d825d 100644
--- a/crates/ra_hir/src/semantics.rs
+++ b/crates/hir/src/semantics.rs
diff --git a/crates/ra_hir/src/semantics/source_to_def.rs b/crates/hir/src/semantics/source_to_def.rs
index 5918b9541..5918b9541 100644
--- a/crates/ra_hir/src/semantics/source_to_def.rs
+++ b/crates/hir/src/semantics/source_to_def.rs
diff --git a/crates/ra_hir/src/source_analyzer.rs b/crates/hir/src/source_analyzer.rs
index 8750584f9..8750584f9 100644
--- a/crates/ra_hir/src/source_analyzer.rs
+++ b/crates/hir/src/source_analyzer.rs
diff --git a/crates/ra_assists/Cargo.toml b/crates/ra_assists/Cargo.toml
index ebac09be6..cacc063da 100644
--- a/crates/ra_assists/Cargo.toml
+++ b/crates/ra_assists/Cargo.toml
@@ -20,5 +20,5 @@ text_edit = { path = "../text_edit" }
20profile = { path = "../profile" } 20profile = { path = "../profile" }
21base_db = { path = "../base_db" } 21base_db = { path = "../base_db" }
22ra_ide_db = { path = "../ra_ide_db" } 22ra_ide_db = { path = "../ra_ide_db" }
23hir = { path = "../ra_hir", package = "ra_hir" } 23hir = { path = "../hir" }
24test_utils = { path = "../test_utils" } 24test_utils = { path = "../test_utils" }
diff --git a/crates/ra_ide/Cargo.toml b/crates/ra_ide/Cargo.toml
index 1af51f3ae..a701cdf1d 100644
--- a/crates/ra_ide/Cargo.toml
+++ b/crates/ra_ide/Cargo.toml
@@ -33,7 +33,7 @@ ra_ssr = { path = "../ra_ssr" }
33 33
34# ra_ide should depend only on the top-level `hir` package. if you need 34# ra_ide should depend only on the top-level `hir` package. if you need
35# something from some `hir_xxx` subpackage, reexport the API via `hir`. 35# something from some `hir_xxx` subpackage, reexport the API via `hir`.
36hir = { path = "../ra_hir", package = "ra_hir" } 36hir = { path = "../hir" }
37 37
38[dev-dependencies] 38[dev-dependencies]
39expect = { path = "../expect" } 39expect = { path = "../expect" }
diff --git a/crates/ra_ide/src/lib.rs b/crates/ra_ide/src/lib.rs
index 789fbdaf2..0d14c823a 100644
--- a/crates/ra_ide/src/lib.rs
+++ b/crates/ra_ide/src/lib.rs
@@ -3,7 +3,7 @@
3//! Strings, suitable for displaying to the human. 3//! Strings, suitable for displaying to the human.
4//! 4//!
5//! What powers this API are the `RootDatabase` struct, which defines a `salsa` 5//! What powers this API are the `RootDatabase` struct, which defines a `salsa`
6//! database, and the `ra_hir` crate, where majority of the analysis happens. 6//! database, and the `hir` crate, where majority of the analysis happens.
7//! However, IDE specific bits of the analysis (most notably completion) happen 7//! However, IDE specific bits of the analysis (most notably completion) happen
8//! in this crate. 8//! in this crate.
9 9
diff --git a/crates/ra_ide_db/Cargo.toml b/crates/ra_ide_db/Cargo.toml
index 0cda7090d..eda257a3a 100644
--- a/crates/ra_ide_db/Cargo.toml
+++ b/crates/ra_ide_db/Cargo.toml
@@ -29,4 +29,4 @@ test_utils = { path = "../test_utils" }
29 29
30# ra_ide should depend only on the top-level `hir` package. if you need 30# ra_ide should depend only on the top-level `hir` package. if you need
31# something from some `hir_xxx` subpackage, reexport the API via `hir`. 31# something from some `hir_xxx` subpackage, reexport the API via `hir`.
32hir = { path = "../ra_hir", package = "ra_hir" } 32hir = { path = "../hir" }
diff --git a/crates/ra_ssr/Cargo.toml b/crates/ra_ssr/Cargo.toml
index f290939cf..bed4bbdf1 100644
--- a/crates/ra_ssr/Cargo.toml
+++ b/crates/ra_ssr/Cargo.toml
@@ -15,7 +15,7 @@ text_edit = { path = "../text_edit" }
15syntax = { path = "../syntax" } 15syntax = { path = "../syntax" }
16base_db = { path = "../base_db" } 16base_db = { path = "../base_db" }
17ra_ide_db = { path = "../ra_ide_db" } 17ra_ide_db = { path = "../ra_ide_db" }
18hir = { path = "../ra_hir", package = "ra_hir" } 18hir = { path = "../hir" }
19rustc-hash = "1.1.0" 19rustc-hash = "1.1.0"
20test_utils = { path = "../test_utils" } 20test_utils = { path = "../test_utils" }
21 21
diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml
index e17fe47da..c0257e9c8 100644
--- a/crates/rust-analyzer/Cargo.toml
+++ b/crates/rust-analyzer/Cargo.toml
@@ -49,7 +49,7 @@ toolchain = { path = "../toolchain" }
49base_db = { path = "../base_db" } 49base_db = { path = "../base_db" }
50ra_ide_db = { path = "../ra_ide_db" } 50ra_ide_db = { path = "../ra_ide_db" }
51ra_ssr = { path = "../ra_ssr" } 51ra_ssr = { path = "../ra_ssr" }
52hir = { path = "../ra_hir", package = "ra_hir" } 52hir = { path = "../hir" }
53hir_def = { path = "../hir_def" } 53hir_def = { path = "../hir_def" }
54hir_ty = { path = "../hir_ty" } 54hir_ty = { path = "../hir_ty" }
55proc_macro_srv = { path = "../proc_macro_srv" } 55proc_macro_srv = { path = "../proc_macro_srv" }
diff --git a/docs/dev/README.md b/docs/dev/README.md
index 4aab6e2b8..04bebbfca 100644
--- a/docs/dev/README.md
+++ b/docs/dev/README.md
@@ -148,14 +148,14 @@ Internal representations are lowered to LSP in the `rust-analyzer` crate (the on
148 148
149## IDE/Compiler split 149## IDE/Compiler split
150 150
151There's a semi-hard split between "compiler" and "IDE", at the `ra_hir` crate. 151There's a semi-hard split between "compiler" and "IDE", at the `hir` crate.
152Compiler derives new facts about source code. 152Compiler derives new facts about source code.
153It explicitly acknowledges that not all info is available (i.e. you can't look at types during name resolution). 153It explicitly acknowledges that not all info is available (i.e. you can't look at types during name resolution).
154 154
155IDE assumes that all information is available at all times. 155IDE assumes that all information is available at all times.
156 156
157IDE should use only types from `ra_hir`, and should not depend on the underling compiler types. 157IDE should use only types from `hir`, and should not depend on the underling compiler types.
158`ra_hir` is a facade. 158`hir` is a facade.
159 159
160## IDE API 160## IDE API
161 161
diff --git a/docs/dev/architecture.md b/docs/dev/architecture.md
index 746d41f83..0ffe61026 100644
--- a/docs/dev/architecture.md
+++ b/docs/dev/architecture.md
@@ -102,7 +102,7 @@ defines most of the "input" queries: facts supplied by the client of the
102analyzer. Reading the docs of the `base_db::input` module should be useful: 102analyzer. Reading the docs of the `base_db::input` module should be useful:
103everything else is strictly derived from those inputs. 103everything else is strictly derived from those inputs.
104 104
105### `crates/ra_hir*` crates 105### `crates/hir*` crates
106 106
107HIR provides high-level "object oriented" access to Rust code. 107HIR provides high-level "object oriented" access to Rust code.
108 108
@@ -113,10 +113,10 @@ is responsible for guessing a HIR for a particular source position.
113 113
114Underneath, HIR works on top of salsa, using a `HirDatabase` trait. 114Underneath, HIR works on top of salsa, using a `HirDatabase` trait.
115 115
116`ra_hir_xxx` crates have a strong ECS flavor, in that they work with raw ids and 116`hir_xxx` crates have a strong ECS flavor, in that they work with raw ids and
117directly query the database. 117directly query the database.
118 118
119The top-level `ra_hir` façade crate wraps ids into a more OO-flavored API. 119The top-level `hir` façade crate wraps ids into a more OO-flavored API.
120 120
121### `crates/ra_ide` 121### `crates/ra_ide`
122 122
diff --git a/docs/dev/guide.md b/docs/dev/guide.md
index d14143226..29d84bf3f 100644
--- a/docs/dev/guide.md
+++ b/docs/dev/guide.md
@@ -275,7 +275,7 @@ several times, with different sets of `cfg`s enabled. The IDE-specific task of
275mapping source code position into a semantic model is inherently imprecise for 275mapping source code position into a semantic model is inherently imprecise for
276this reason, and is handled by the [`source_binder`]. 276this reason, and is handled by the [`source_binder`].
277 277
278[`source_binder`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/source_binder.rs 278[`source_binder`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/hir/src/source_binder.rs
279 279
280The semantic interface is declared in the [`code_model_api`] module. Each entity is 280The semantic interface is declared in the [`code_model_api`] module. Each entity is
281identified by an integer ID and has a bunch of methods which take a salsa database 281identified by an integer ID and has a bunch of methods which take a salsa database
@@ -283,8 +283,8 @@ as an argument and returns other entities (which are also IDs). Internally, thes
283methods invoke various queries on the database to build the model on demand. 283methods invoke various queries on the database to build the model on demand.
284Here's [the list of queries]. 284Here's [the list of queries].
285 285
286[`code_model_api`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/code_model_api.rs 286[`code_model_api`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/hir/src/code_model_api.rs
287[the list of queries]: https://github.com/rust-analyzer/rust-analyzer/blob/7e84440e25e19529e4ff8a66e521d1b06349c6ec/crates/ra_hir/src/db.rs#L20-L106 287[the list of queries]: https://github.com/rust-analyzer/rust-analyzer/blob/7e84440e25e19529e4ff8a66e521d1b06349c6ec/crates/hir/src/db.rs#L20-L106
288 288
289The first step of building the model is parsing the source code. 289The first step of building the model is parsing the source code.
290 290
@@ -341,7 +341,7 @@ The algorithm for building a tree of modules is to start with a crate root
341declarations and recursively process child modules. This is handled by the 341declarations and recursively process child modules. This is handled by the
342[`module_tree_query`], with two slight variations. 342[`module_tree_query`], with two slight variations.
343 343
344[`module_tree_query`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/module_tree.rs#L116-L123 344[`module_tree_query`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/hir/src/module_tree.rs#L116-L123
345 345
346First, rust-analyzer builds a module tree for all crates in a source root 346First, rust-analyzer builds a module tree for all crates in a source root
347simultaneously. The main reason for this is historical (`module_tree` predates 347simultaneously. The main reason for this is historical (`module_tree` predates
@@ -364,7 +364,7 @@ the same, we don't have to re-execute [`module_tree_query`]. In fact, we only
364need to re-execute it when we add/remove new files or when we change mod 364need to re-execute it when we add/remove new files or when we change mod
365declarations. 365declarations.
366 366
367[`submodules_query`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/module_tree.rs#L41 367[`submodules_query`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/hir/src/module_tree.rs#L41
368 368
369We store the resulting modules in a `Vec`-based indexed arena. The indices in 369We store the resulting modules in a `Vec`-based indexed arena. The indices in
370the arena becomes module IDs. And this brings us to the next topic: 370the arena becomes module IDs. And this brings us to the next topic:
@@ -393,7 +393,7 @@ database we use includes a couple of [interners]. How to "garbage collect"
393unused locations is an open question. 393unused locations is an open question.
394 394
395[`LocationInterner`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/base_db/src/loc2id.rs#L65-L71 395[`LocationInterner`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/base_db/src/loc2id.rs#L65-L71
396[interners]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/db.rs#L22-L23 396[interners]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/hir/src/db.rs#L22-L23
397 397
398For example, we use `LocationInterner` to assign IDs to definitions of functions, 398For example, we use `LocationInterner` to assign IDs to definitions of functions,
399structs, enums, etc. The location, [`DefLoc`] contains two bits of information: 399structs, enums, etc. The location, [`DefLoc`] contains two bits of information:
@@ -407,7 +407,7 @@ using offsets, text ranges or syntax trees as keys and values for queries. What
407we do instead is we store "index" of the item among all of the items of a file 407we do instead is we store "index" of the item among all of the items of a file
408(so, a positional based ID, but localized to a single file). 408(so, a positional based ID, but localized to a single file).
409 409
410[`DefLoc`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/ids.rs#L127-L139 410[`DefLoc`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/hir/src/ids.rs#L127-L139
411 411
412One thing we've glossed over for the time being is support for macros. We have 412One thing we've glossed over for the time being is support for macros. We have
413only proof of concept handling of macros at the moment, but they are extremely 413only proof of concept handling of macros at the moment, but they are extremely
@@ -440,7 +440,7 @@ terms of `HirFileId`! This does not recur infinitely though: any chain of
440`HirFileId`s bottoms out in `HirFileId::FileId`, that is, some source file 440`HirFileId`s bottoms out in `HirFileId::FileId`, that is, some source file
441actually written by the user. 441actually written by the user.
442 442
443[`HirFileId`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/ids.rs#L18-L125 443[`HirFileId`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/hir/src/ids.rs#L18-L125
444 444
445Now that we understand how to identify a definition, in a source or in a 445Now that we understand how to identify a definition, in a source or in a
446macro-generated file, we can discuss name resolution a bit. 446macro-generated file, we can discuss name resolution a bit.
@@ -454,14 +454,14 @@ each module into a position-independent representation which does not change if
454we modify bodies of the items. After that we [loop] resolving all imports until 454we modify bodies of the items. After that we [loop] resolving all imports until
455we've reached a fixed point. 455we've reached a fixed point.
456 456
457[lower]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/nameres/lower.rs#L113-L117 457[lower]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/hir/src/nameres/lower.rs#L113-L117
458[loop]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/nameres.rs#L186-L196 458[loop]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/hir/src/nameres.rs#L186-L196
459 459
460And, given all our preparation with IDs and a position-independent representation, 460And, given all our preparation with IDs and a position-independent representation,
461it is satisfying to [test] that typing inside function body does not invalidate 461it is satisfying to [test] that typing inside function body does not invalidate
462name resolution results. 462name resolution results.
463 463
464[test]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/nameres/tests.rs#L376 464[test]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/hir/src/nameres/tests.rs#L376
465 465
466An interesting fact about name resolution is that it "erases" all of the 466An interesting fact about name resolution is that it "erases" all of the
467intermediate paths from the imports: in the end, we know which items are defined 467intermediate paths from the imports: in the end, we know which items are defined
@@ -496,10 +496,10 @@ there's an intermediate [projection query] which returns only the first
496position-independent part of the lowering. The result of this query is stable. 496position-independent part of the lowering. The result of this query is stable.
497Naturally, name resolution [uses] this stable projection query. 497Naturally, name resolution [uses] this stable projection query.
498 498
499[imports]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/nameres/lower.rs#L52-L59 499[imports]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/hir/src/nameres/lower.rs#L52-L59
500[`SourceMap`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/nameres/lower.rs#L52-L59 500[`SourceMap`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/hir/src/nameres/lower.rs#L52-L59
501[projection query]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/nameres/lower.rs#L97-L103 501[projection query]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/hir/src/nameres/lower.rs#L97-L103
502[uses]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/query_definitions.rs#L49 502[uses]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/hir/src/query_definitions.rs#L49
503 503
504## Type inference 504## Type inference
505 505
@@ -521,10 +521,10 @@ construct a mapping from `ExprId`s to types.
521 521
522[@flodiebold]: https://github.com/flodiebold 522[@flodiebold]: https://github.com/flodiebold
523[#327]: https://github.com/rust-analyzer/rust-analyzer/pull/327 523[#327]: https://github.com/rust-analyzer/rust-analyzer/pull/327
524[lower the AST]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/expr.rs 524[lower the AST]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/hir/src/expr.rs
525[positional ID]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/expr.rs#L13-L15 525[positional ID]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/hir/src/expr.rs#L13-L15
526[a source map]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/expr.rs#L41-L44 526[a source map]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/hir/src/expr.rs#L41-L44
527[type inference]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/ty.rs#L1208-L1223 527[type inference]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/hir/src/ty.rs#L1208-L1223
528 528
529## Tying it all together: completion 529## Tying it all together: completion
530 530
diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs
index 5a5bd4a3e..97a11a01e 100644
--- a/xtask/tests/tidy.rs
+++ b/xtask/tests/tidy.rs
@@ -192,7 +192,7 @@ impl TidyDocs {
192 } 192 }
193 193
194 let poorly_documented = [ 194 let poorly_documented = [
195 "ra_hir", 195 "hir",
196 "hir_expand", 196 "hir_expand",
197 "ra_ide", 197 "ra_ide",
198 "mbe", 198 "mbe",