aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2018-12-20 09:16:07 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2018-12-20 09:16:07 +0000
commit9a16cf2bf646a4a881f3f5acbf5582dacc4337bf (patch)
treeff90eb390a8f5af47b6d0c6ec4c49b4431b82d1c
parentdbb62b5baa36783bbca06f09c77794fce3ceff0c (diff)
parenta084412f0698d5f54d586f707930e141c88b0673 (diff)
Merge #292
292: Vfs r=matklad a=matklad closes #243 Co-authored-by: Aleksey Kladov <[email protected]>
-rw-r--r--Cargo.lock465
-rw-r--r--Cargo.toml1
-rw-r--r--crates/ra_analysis/src/db.rs10
-rw-r--r--crates/ra_analysis/src/imp.rs139
-rw-r--r--crates/ra_analysis/src/lib.rs104
-rw-r--r--crates/ra_analysis/src/mock_analysis.rs10
-rw-r--r--crates/ra_db/src/file_resolver.rs76
-rw-r--r--crates/ra_db/src/input.rs27
-rw-r--r--crates/ra_db/src/lib.rs7
-rw-r--r--crates/ra_db/src/mock.rs28
-rw-r--r--crates/ra_hir/Cargo.toml1
-rw-r--r--crates/ra_hir/src/mock.rs46
-rw-r--r--crates/ra_hir/src/module/imp.rs50
-rw-r--r--crates/ra_hir/src/module/nameres.rs51
-rw-r--r--crates/ra_hir/src/module/nameres/tests.rs7
-rw-r--r--crates/ra_lsp_server/Cargo.toml4
-rw-r--r--crates/ra_lsp_server/src/lib.rs2
-rw-r--r--crates/ra_lsp_server/src/main_loop.rs147
-rw-r--r--crates/ra_lsp_server/src/main_loop/handlers.rs4
-rw-r--r--crates/ra_lsp_server/src/path_map.rs126
-rw-r--r--crates/ra_lsp_server/src/project_model.rs1
-rw-r--r--crates/ra_lsp_server/src/server_world.rs225
-rw-r--r--crates/ra_lsp_server/src/vfs.rs67
-rw-r--r--crates/ra_lsp_server/tests/heavy_tests/main.rs3
-rw-r--r--crates/ra_lsp_server/tests/heavy_tests/support.rs4
-rw-r--r--crates/ra_vfs/Cargo.toml17
-rw-r--r--crates/ra_vfs/src/arena.rs53
-rw-r--r--crates/ra_vfs/src/io.rs76
-rw-r--r--crates/ra_vfs/src/lib.rs350
-rw-r--r--crates/ra_vfs/tests/vfs.rs101
-rw-r--r--crates/thread_worker/src/lib.rs9
31 files changed, 1354 insertions, 857 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 522550eb5..7ebe6e67f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3,7 +3,7 @@ name = "aho-corasick"
3version = "0.6.9" 3version = "0.6.9"
4source = "registry+https://github.com/rust-lang/crates.io-index" 4source = "registry+https://github.com/rust-lang/crates.io-index"
5dependencies = [ 5dependencies = [
6 "memchr 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 6 "memchr 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
7] 7]
8 8
9[[package]] 9[[package]]
@@ -21,10 +21,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
21 21
22[[package]] 22[[package]]
23name = "arrayvec" 23name = "arrayvec"
24version = "0.4.7" 24version = "0.4.9"
25source = "registry+https://github.com/rust-lang/crates.io-index" 25source = "registry+https://github.com/rust-lang/crates.io-index"
26dependencies = [ 26dependencies = [
27 "nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", 27 "nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
28] 28]
29 29
30[[package]] 30[[package]]
@@ -32,30 +32,36 @@ name = "atty"
32version = "0.2.11" 32version = "0.2.11"
33source = "registry+https://github.com/rust-lang/crates.io-index" 33source = "registry+https://github.com/rust-lang/crates.io-index"
34dependencies = [ 34dependencies = [
35 "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", 35 "libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)",
36 "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 36 "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
37 "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 37 "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
38] 38]
39 39
40[[package]] 40[[package]]
41name = "autocfg"
42version = "0.1.1"
43source = "registry+https://github.com/rust-lang/crates.io-index"
44
45[[package]]
41name = "backtrace" 46name = "backtrace"
42version = "0.3.9" 47version = "0.3.13"
43source = "registry+https://github.com/rust-lang/crates.io-index" 48source = "registry+https://github.com/rust-lang/crates.io-index"
44dependencies = [ 49dependencies = [
45 "backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", 50 "autocfg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
51 "backtrace-sys 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)",
46 "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 52 "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
47 "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", 53 "libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)",
48 "rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", 54 "rustc-demangle 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
49 "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 55 "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
50] 56]
51 57
52[[package]] 58[[package]]
53name = "backtrace-sys" 59name = "backtrace-sys"
54version = "0.1.24" 60version = "0.1.26"
55source = "registry+https://github.com/rust-lang/crates.io-index" 61source = "registry+https://github.com/rust-lang/crates.io-index"
56dependencies = [ 62dependencies = [
57 "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", 63 "cc 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)",
58 "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", 64 "libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)",
59] 65]
60 66
61[[package]] 67[[package]]
@@ -93,19 +99,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
93 99
94[[package]] 100[[package]]
95name = "cargo_metadata" 101name = "cargo_metadata"
96version = "0.6.1" 102version = "0.6.4"
97source = "registry+https://github.com/rust-lang/crates.io-index" 103source = "registry+https://github.com/rust-lang/crates.io-index"
98dependencies = [ 104dependencies = [
99 "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", 105 "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
100 "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", 106 "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
101 "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", 107 "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
102 "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", 108 "serde_derive 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
103 "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", 109 "serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)",
104] 110]
105 111
106[[package]] 112[[package]]
107name = "cc" 113name = "cc"
108version = "1.0.25" 114version = "1.0.27"
109source = "registry+https://github.com/rust-lang/crates.io-index" 115source = "registry+https://github.com/rust-lang/crates.io-index"
110 116
111[[package]] 117[[package]]
@@ -120,7 +126,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
120dependencies = [ 126dependencies = [
121 "num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", 127 "num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)",
122 "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", 128 "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
123 "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", 129 "time 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)",
124] 130]
125 131
126[[package]] 132[[package]]
@@ -150,11 +156,11 @@ name = "crossbeam-channel"
150version = "0.2.6" 156version = "0.2.6"
151source = "registry+https://github.com/rust-lang/crates.io-index" 157source = "registry+https://github.com/rust-lang/crates.io-index"
152dependencies = [ 158dependencies = [
153 "crossbeam-epoch 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", 159 "crossbeam-epoch 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
154 "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", 160 "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
155 "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", 161 "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
156 "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", 162 "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
157 "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", 163 "smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)",
158] 164]
159 165
160[[package]] 166[[package]]
@@ -171,23 +177,23 @@ name = "crossbeam-epoch"
171version = "0.3.1" 177version = "0.3.1"
172source = "registry+https://github.com/rust-lang/crates.io-index" 178source = "registry+https://github.com/rust-lang/crates.io-index"
173dependencies = [ 179dependencies = [
174 "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", 180 "arrayvec 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
175 "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 181 "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
176 "crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 182 "crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
177 "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 183 "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
178 "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 184 "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
179 "nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", 185 "nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
180 "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 186 "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
181] 187]
182 188
183[[package]] 189[[package]]
184name = "crossbeam-epoch" 190name = "crossbeam-epoch"
185version = "0.6.0" 191version = "0.6.1"
186source = "registry+https://github.com/rust-lang/crates.io-index" 192source = "registry+https://github.com/rust-lang/crates.io-index"
187dependencies = [ 193dependencies = [
188 "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", 194 "arrayvec 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
189 "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 195 "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
190 "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", 196 "crossbeam-utils 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
191 "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 197 "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
192 "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 198 "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
193 "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 199 "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -207,13 +213,21 @@ version = "0.5.0"
207source = "registry+https://github.com/rust-lang/crates.io-index" 213source = "registry+https://github.com/rust-lang/crates.io-index"
208 214
209[[package]] 215[[package]]
216name = "crossbeam-utils"
217version = "0.6.3"
218source = "registry+https://github.com/rust-lang/crates.io-index"
219dependencies = [
220 "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
221]
222
223[[package]]
210name = "derive-new" 224name = "derive-new"
211version = "0.5.6" 225version = "0.5.6"
212source = "registry+https://github.com/rust-lang/crates.io-index" 226source = "registry+https://github.com/rust-lang/crates.io-index"
213dependencies = [ 227dependencies = [
214 "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", 228 "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
215 "quote 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", 229 "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
216 "syn 0.15.18 (registry+https://github.com/rust-lang/crates.io-index)", 230 "syn 0.15.23 (registry+https://github.com/rust-lang/crates.io-index)",
217] 231]
218 232
219[[package]] 233[[package]]
@@ -249,7 +263,7 @@ name = "error-chain"
249version = "0.12.0" 263version = "0.12.0"
250source = "registry+https://github.com/rust-lang/crates.io-index" 264source = "registry+https://github.com/rust-lang/crates.io-index"
251dependencies = [ 265dependencies = [
252 "backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", 266 "backtrace 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)",
253] 267]
254 268
255[[package]] 269[[package]]
@@ -257,7 +271,7 @@ name = "failure"
257version = "0.1.3" 271version = "0.1.3"
258source = "registry+https://github.com/rust-lang/crates.io-index" 272source = "registry+https://github.com/rust-lang/crates.io-index"
259dependencies = [ 273dependencies = [
260 "backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", 274 "backtrace 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)",
261 "failure_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", 275 "failure_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
262] 276]
263 277
@@ -266,9 +280,9 @@ name = "failure_derive"
266version = "0.1.3" 280version = "0.1.3"
267source = "registry+https://github.com/rust-lang/crates.io-index" 281source = "registry+https://github.com/rust-lang/crates.io-index"
268dependencies = [ 282dependencies = [
269 "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", 283 "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
270 "quote 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", 284 "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
271 "syn 0.15.18 (registry+https://github.com/rust-lang/crates.io-index)", 285 "syn 0.15.23 (registry+https://github.com/rust-lang/crates.io-index)",
272 "synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", 286 "synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
273] 287]
274 288
@@ -279,18 +293,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
279 293
280[[package]] 294[[package]]
281name = "flexi_logger" 295name = "flexi_logger"
282version = "0.10.0" 296version = "0.10.3"
283source = "registry+https://github.com/rust-lang/crates.io-index" 297source = "registry+https://github.com/rust-lang/crates.io-index"
284dependencies = [ 298dependencies = [
285 "chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", 299 "chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
286 "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 300 "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
287 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", 301 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
288 "regex 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", 302 "regex 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
289] 303]
290 304
291[[package]] 305[[package]]
292name = "fst" 306name = "fst"
293version = "0.3.2" 307version = "0.3.3"
294source = "registry+https://github.com/rust-lang/crates.io-index" 308source = "registry+https://github.com/rust-lang/crates.io-index"
295dependencies = [ 309dependencies = [
296 "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", 310 "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -319,9 +333,9 @@ dependencies = [
319 "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", 333 "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
320 "languageserver-types 0.53.0 (registry+https://github.com/rust-lang/crates.io-index)", 334 "languageserver-types 0.53.0 (registry+https://github.com/rust-lang/crates.io-index)",
321 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", 335 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
322 "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", 336 "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
323 "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", 337 "serde_derive 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
324 "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", 338 "serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)",
325] 339]
326 340
327[[package]] 341[[package]]
@@ -339,7 +353,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
339 353
340[[package]] 354[[package]]
341name = "heck" 355name = "heck"
342version = "0.3.0" 356version = "0.3.1"
343source = "registry+https://github.com/rust-lang/crates.io-index" 357source = "registry+https://github.com/rust-lang/crates.io-index"
344dependencies = [ 358dependencies = [
345 "unicode-segmentation 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 359 "unicode-segmentation 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -381,7 +395,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
381 395
382[[package]] 396[[package]]
383name = "itertools" 397name = "itertools"
384version = "0.7.8" 398version = "0.7.11"
385source = "registry+https://github.com/rust-lang/crates.io-index" 399source = "registry+https://github.com/rust-lang/crates.io-index"
386dependencies = [ 400dependencies = [
387 "either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", 401 "either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -405,9 +419,9 @@ dependencies = [
405 "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", 419 "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
406 "num-derive 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", 420 "num-derive 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
407 "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", 421 "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
408 "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", 422 "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
409 "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", 423 "serde_derive 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
410 "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", 424 "serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)",
411 "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", 425 "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
412 "url_serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 426 "url_serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
413] 427]
@@ -419,15 +433,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
419 433
420[[package]] 434[[package]]
421name = "libc" 435name = "libc"
422version = "0.2.43" 436version = "0.2.45"
423source = "registry+https://github.com/rust-lang/crates.io-index" 437source = "registry+https://github.com/rust-lang/crates.io-index"
424 438
425[[package]] 439[[package]]
426name = "lock_api" 440name = "lock_api"
427version = "0.1.4" 441version = "0.1.5"
428source = "registry+https://github.com/rust-lang/crates.io-index" 442source = "registry+https://github.com/rust-lang/crates.io-index"
429dependencies = [ 443dependencies = [
430 "owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 444 "owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
431 "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 445 "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
432] 446]
433 447
@@ -451,11 +465,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
451 465
452[[package]] 466[[package]]
453name = "memchr" 467name = "memchr"
454version = "2.1.1" 468version = "2.1.2"
455source = "registry+https://github.com/rust-lang/crates.io-index" 469source = "registry+https://github.com/rust-lang/crates.io-index"
456dependencies = [ 470dependencies = [
457 "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 471 "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
458 "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", 472 "libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)",
459 "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", 473 "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
460] 474]
461 475
@@ -464,7 +478,7 @@ name = "memmap"
464version = "0.6.2" 478version = "0.6.2"
465source = "registry+https://github.com/rust-lang/crates.io-index" 479source = "registry+https://github.com/rust-lang/crates.io-index"
466dependencies = [ 480dependencies = [
467 "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", 481 "libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)",
468 "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 482 "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
469] 483]
470 484
@@ -475,7 +489,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
475 489
476[[package]] 490[[package]]
477name = "nodrop" 491name = "nodrop"
478version = "0.1.12" 492version = "0.1.13"
479source = "registry+https://github.com/rust-lang/crates.io-index" 493source = "registry+https://github.com/rust-lang/crates.io-index"
480 494
481[[package]] 495[[package]]
@@ -484,9 +498,9 @@ version = "0.2.3"
484source = "registry+https://github.com/rust-lang/crates.io-index" 498source = "registry+https://github.com/rust-lang/crates.io-index"
485dependencies = [ 499dependencies = [
486 "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", 500 "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
487 "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", 501 "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
488 "quote 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", 502 "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
489 "syn 0.15.18 (registry+https://github.com/rust-lang/crates.io-index)", 503 "syn 0.15.23 (registry+https://github.com/rust-lang/crates.io-index)",
490] 504]
491 505
492[[package]] 506[[package]]
@@ -504,15 +518,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
504 518
505[[package]] 519[[package]]
506name = "num_cpus" 520name = "num_cpus"
507version = "1.8.0" 521version = "1.9.0"
508source = "registry+https://github.com/rust-lang/crates.io-index" 522source = "registry+https://github.com/rust-lang/crates.io-index"
509dependencies = [ 523dependencies = [
510 "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", 524 "libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)",
511] 525]
512 526
513[[package]] 527[[package]]
514name = "owning_ref" 528name = "owning_ref"
515version = "0.3.3" 529version = "0.4.0"
516source = "registry+https://github.com/rust-lang/crates.io-index" 530source = "registry+https://github.com/rust-lang/crates.io-index"
517dependencies = [ 531dependencies = [
518 "stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 532 "stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -523,18 +537,39 @@ name = "parking_lot"
523version = "0.6.4" 537version = "0.6.4"
524source = "registry+https://github.com/rust-lang/crates.io-index" 538source = "registry+https://github.com/rust-lang/crates.io-index"
525dependencies = [ 539dependencies = [
526 "lock_api 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 540 "lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
527 "parking_lot_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 541 "parking_lot_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
528] 542]
529 543
530[[package]] 544[[package]]
545name = "parking_lot"
546version = "0.7.0"
547source = "registry+https://github.com/rust-lang/crates.io-index"
548dependencies = [
549 "lock_api 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
550 "parking_lot_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
551]
552
553[[package]]
531name = "parking_lot_core" 554name = "parking_lot_core"
532version = "0.3.1" 555version = "0.3.1"
533source = "registry+https://github.com/rust-lang/crates.io-index" 556source = "registry+https://github.com/rust-lang/crates.io-index"
534dependencies = [ 557dependencies = [
535 "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", 558 "libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)",
536 "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", 559 "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
537 "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", 560 "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
561 "smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)",
562 "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
563]
564
565[[package]]
566name = "parking_lot_core"
567version = "0.4.0"
568source = "registry+https://github.com/rust-lang/crates.io-index"
569dependencies = [
570 "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
571 "rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
572 "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
538 "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", 573 "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
539 "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 574 "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
540] 575]
@@ -568,8 +603,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
568dependencies = [ 603dependencies = [
569 "pest 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 604 "pest 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
570 "pest_meta 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)", 605 "pest_meta 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
571 "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", 606 "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
572 "quote 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", 607 "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
573 "syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)", 608 "syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)",
574] 609]
575 610
@@ -585,7 +620,7 @@ dependencies = [
585 620
586[[package]] 621[[package]]
587name = "proc-macro2" 622name = "proc-macro2"
588version = "0.4.20" 623version = "0.4.24"
589source = "registry+https://github.com/rust-lang/crates.io-index" 624source = "registry+https://github.com/rust-lang/crates.io-index"
590dependencies = [ 625dependencies = [
591 "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 626 "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -593,17 +628,17 @@ dependencies = [
593 628
594[[package]] 629[[package]]
595name = "quote" 630name = "quote"
596version = "0.6.9" 631version = "0.6.10"
597source = "registry+https://github.com/rust-lang/crates.io-index" 632source = "registry+https://github.com/rust-lang/crates.io-index"
598dependencies = [ 633dependencies = [
599 "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", 634 "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
600] 635]
601 636
602[[package]] 637[[package]]
603name = "ra_analysis" 638name = "ra_analysis"
604version = "0.1.0" 639version = "0.1.0"
605dependencies = [ 640dependencies = [
606 "fst 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", 641 "fst 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
607 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", 642 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
608 "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", 643 "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
609 "ra_db 0.1.0", 644 "ra_db 0.1.0",
@@ -647,7 +682,7 @@ dependencies = [
647name = "ra_editor" 682name = "ra_editor"
648version = "0.1.0" 683version = "0.1.0"
649dependencies = [ 684dependencies = [
650 "itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)", 685 "itertools 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
651 "join_to_string 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 686 "join_to_string 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
652 "ra_syntax 0.1.0", 687 "ra_syntax 0.1.0",
653 "ra_text_edit 0.1.0", 688 "ra_text_edit 0.1.0",
@@ -660,6 +695,7 @@ dependencies = [
660name = "ra_hir" 695name = "ra_hir"
661version = "0.1.0" 696version = "0.1.0"
662dependencies = [ 697dependencies = [
698 "arrayvec 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
663 "id-arena 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 699 "id-arena 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
664 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", 700 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
665 "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", 701 "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -676,26 +712,28 @@ dependencies = [
676name = "ra_lsp_server" 712name = "ra_lsp_server"
677version = "0.1.0" 713version = "0.1.0"
678dependencies = [ 714dependencies = [
679 "cargo_metadata 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", 715 "cargo_metadata 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
680 "crossbeam-channel 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", 716 "crossbeam-channel 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
681 "drop_bomb 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 717 "drop_bomb 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
682 "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", 718 "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
683 "failure_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", 719 "failure_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
684 "flexi_logger 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", 720 "flexi_logger 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)",
685 "gen_lsp_server 0.1.0", 721 "gen_lsp_server 0.1.0",
686 "im 12.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 722 "im 12.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
687 "languageserver-types 0.53.0 (registry+https://github.com/rust-lang/crates.io-index)", 723 "languageserver-types 0.53.0 (registry+https://github.com/rust-lang/crates.io-index)",
688 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", 724 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
725 "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
689 "ra_analysis 0.1.0", 726 "ra_analysis 0.1.0",
690 "ra_editor 0.1.0", 727 "ra_editor 0.1.0",
691 "ra_syntax 0.1.0", 728 "ra_syntax 0.1.0",
692 "ra_text_edit 0.1.0", 729 "ra_text_edit 0.1.0",
730 "ra_vfs 0.1.0",
693 "rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", 731 "rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
694 "relative-path 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 732 "relative-path 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
695 "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 733 "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
696 "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", 734 "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
697 "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", 735 "serde_derive 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
698 "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", 736 "serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)",
699 "smol_str 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", 737 "smol_str 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
700 "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", 738 "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
701 "test_utils 0.1.0", 739 "test_utils 0.1.0",
@@ -703,23 +741,23 @@ dependencies = [
703 "thread_worker 0.1.0", 741 "thread_worker 0.1.0",
704 "threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", 742 "threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
705 "url_serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 743 "url_serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
706 "walkdir 2.2.6 (registry+https://github.com/rust-lang/crates.io-index)", 744 "walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
707] 745]
708 746
709[[package]] 747[[package]]
710name = "ra_syntax" 748name = "ra_syntax"
711version = "0.1.0" 749version = "0.1.0"
712dependencies = [ 750dependencies = [
713 "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", 751 "arrayvec 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
714 "drop_bomb 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 752 "drop_bomb 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
715 "itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)", 753 "itertools 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
716 "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", 754 "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
717 "ra_text_edit 0.1.0", 755 "ra_text_edit 0.1.0",
718 "rowan 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 756 "rowan 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
719 "test_utils 0.1.0", 757 "test_utils 0.1.0",
720 "text_unit 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", 758 "text_unit 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
721 "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 759 "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
722 "walkdir 2.2.6 (registry+https://github.com/rust-lang/crates.io-index)", 760 "walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
723] 761]
724 762
725[[package]] 763[[package]]
@@ -731,12 +769,25 @@ dependencies = [
731] 769]
732 770
733[[package]] 771[[package]]
772name = "ra_vfs"
773version = "0.1.0"
774dependencies = [
775 "crossbeam-channel 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
776 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
777 "relative-path 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
778 "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
779 "tempfile 3.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
780 "thread_worker 0.1.0",
781 "walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
782]
783
784[[package]]
734name = "rand" 785name = "rand"
735version = "0.4.3" 786version = "0.4.3"
736source = "registry+https://github.com/rust-lang/crates.io-index" 787source = "registry+https://github.com/rust-lang/crates.io-index"
737dependencies = [ 788dependencies = [
738 "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 789 "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
739 "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", 790 "libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)",
740 "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 791 "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
741] 792]
742 793
@@ -747,12 +798,39 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
747dependencies = [ 798dependencies = [
748 "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", 799 "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
749 "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 800 "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
750 "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", 801 "libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)",
751 "rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 802 "rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
752 "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 803 "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
753] 804]
754 805
755[[package]] 806[[package]]
807name = "rand"
808version = "0.6.1"
809source = "registry+https://github.com/rust-lang/crates.io-index"
810dependencies = [
811 "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
812 "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
813 "libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)",
814 "rand_chacha 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
815 "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
816 "rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
817 "rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
818 "rand_pcg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
819 "rand_xorshift 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
820 "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
821 "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
822]
823
824[[package]]
825name = "rand_chacha"
826version = "0.1.0"
827source = "registry+https://github.com/rust-lang/crates.io-index"
828dependencies = [
829 "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
830 "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
831]
832
833[[package]]
756name = "rand_core" 834name = "rand_core"
757version = "0.2.2" 835version = "0.2.2"
758source = "registry+https://github.com/rust-lang/crates.io-index" 836source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -766,6 +844,39 @@ version = "0.3.0"
766source = "registry+https://github.com/rust-lang/crates.io-index" 844source = "registry+https://github.com/rust-lang/crates.io-index"
767 845
768[[package]] 846[[package]]
847name = "rand_hc"
848version = "0.1.0"
849source = "registry+https://github.com/rust-lang/crates.io-index"
850dependencies = [
851 "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
852]
853
854[[package]]
855name = "rand_isaac"
856version = "0.1.1"
857source = "registry+https://github.com/rust-lang/crates.io-index"
858dependencies = [
859 "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
860]
861
862[[package]]
863name = "rand_pcg"
864version = "0.1.1"
865source = "registry+https://github.com/rust-lang/crates.io-index"
866dependencies = [
867 "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
868 "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
869]
870
871[[package]]
872name = "rand_xorshift"
873version = "0.1.0"
874source = "registry+https://github.com/rust-lang/crates.io-index"
875dependencies = [
876 "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
877]
878
879[[package]]
769name = "rayon" 880name = "rayon"
770version = "1.0.3" 881version = "1.0.3"
771source = "registry+https://github.com/rust-lang/crates.io-index" 882source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -782,13 +893,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
782dependencies = [ 893dependencies = [
783 "crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 894 "crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
784 "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 895 "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
785 "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", 896 "libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)",
786 "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", 897 "num_cpus 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
787] 898]
788 899
789[[package]] 900[[package]]
790name = "redox_syscall" 901name = "redox_syscall"
791version = "0.1.40" 902version = "0.1.44"
792source = "registry+https://github.com/rust-lang/crates.io-index" 903source = "registry+https://github.com/rust-lang/crates.io-index"
793 904
794[[package]] 905[[package]]
@@ -796,27 +907,27 @@ name = "redox_termios"
796version = "0.1.1" 907version = "0.1.1"
797source = "registry+https://github.com/rust-lang/crates.io-index" 908source = "registry+https://github.com/rust-lang/crates.io-index"
798dependencies = [ 909dependencies = [
799 "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", 910 "redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)",
800] 911]
801 912
802[[package]] 913[[package]]
803name = "regex" 914name = "regex"
804version = "1.0.6" 915version = "1.1.0"
805source = "registry+https://github.com/rust-lang/crates.io-index" 916source = "registry+https://github.com/rust-lang/crates.io-index"
806dependencies = [ 917dependencies = [
807 "aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", 918 "aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)",
808 "memchr 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 919 "memchr 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
809 "regex-syntax 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", 920 "regex-syntax 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
810 "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 921 "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
811 "utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 922 "utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
812] 923]
813 924
814[[package]] 925[[package]]
815name = "regex-syntax" 926name = "regex-syntax"
816version = "0.6.2" 927version = "0.6.4"
817source = "registry+https://github.com/rust-lang/crates.io-index" 928source = "registry+https://github.com/rust-lang/crates.io-index"
818dependencies = [ 929dependencies = [
819 "ucd-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 930 "ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
820] 931]
821 932
822[[package]] 933[[package]]
@@ -839,12 +950,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
839dependencies = [ 950dependencies = [
840 "base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", 951 "base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)",
841 "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", 952 "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
842 "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", 953 "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
843] 954]
844 955
845[[package]] 956[[package]]
846name = "rowan" 957name = "rowan"
847version = "0.1.2" 958version = "0.1.3"
848source = "registry+https://github.com/rust-lang/crates.io-index" 959source = "registry+https://github.com/rust-lang/crates.io-index"
849dependencies = [ 960dependencies = [
850 "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", 961 "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -854,7 +965,7 @@ dependencies = [
854 965
855[[package]] 966[[package]]
856name = "rustc-demangle" 967name = "rustc-demangle"
857version = "0.1.9" 968version = "0.1.11"
858source = "registry+https://github.com/rust-lang/crates.io-index" 969source = "registry+https://github.com/rust-lang/crates.io-index"
859 970
860[[package]] 971[[package]]
@@ -875,7 +986,7 @@ dependencies = [
875 986
876[[package]] 987[[package]]
877name = "ryu" 988name = "ryu"
878version = "0.2.6" 989version = "0.2.7"
879source = "registry+https://github.com/rust-lang/crates.io-index" 990source = "registry+https://github.com/rust-lang/crates.io-index"
880 991
881[[package]] 992[[package]]
@@ -890,11 +1001,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
890dependencies = [ 1001dependencies = [
891 "derive-new 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", 1002 "derive-new 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
892 "indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 1003 "indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
893 "lock_api 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 1004 "lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
894 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", 1005 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
895 "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", 1006 "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
896 "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 1007 "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
897 "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", 1008 "smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)",
898] 1009]
899 1010
900[[package]] 1011[[package]]
@@ -916,7 +1027,7 @@ version = "0.9.0"
916source = "registry+https://github.com/rust-lang/crates.io-index" 1027source = "registry+https://github.com/rust-lang/crates.io-index"
917dependencies = [ 1028dependencies = [
918 "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", 1029 "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
919 "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", 1030 "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
920] 1031]
921 1032
922[[package]] 1033[[package]]
@@ -926,30 +1037,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
926 1037
927[[package]] 1038[[package]]
928name = "serde" 1039name = "serde"
929version = "1.0.80" 1040version = "1.0.82"
930source = "registry+https://github.com/rust-lang/crates.io-index" 1041source = "registry+https://github.com/rust-lang/crates.io-index"
931dependencies = [ 1042dependencies = [
932 "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", 1043 "serde_derive 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
933] 1044]
934 1045
935[[package]] 1046[[package]]
936name = "serde_derive" 1047name = "serde_derive"
937version = "1.0.80" 1048version = "1.0.82"
938source = "registry+https://github.com/rust-lang/crates.io-index" 1049source = "registry+https://github.com/rust-lang/crates.io-index"
939dependencies = [ 1050dependencies = [
940 "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", 1051 "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
941 "quote 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", 1052 "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
942 "syn 0.15.18 (registry+https://github.com/rust-lang/crates.io-index)", 1053 "syn 0.15.23 (registry+https://github.com/rust-lang/crates.io-index)",
943] 1054]
944 1055
945[[package]] 1056[[package]]
946name = "serde_json" 1057name = "serde_json"
947version = "1.0.32" 1058version = "1.0.33"
948source = "registry+https://github.com/rust-lang/crates.io-index" 1059source = "registry+https://github.com/rust-lang/crates.io-index"
949dependencies = [ 1060dependencies = [
950 "itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", 1061 "itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
951 "ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", 1062 "ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
952 "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", 1063 "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
953] 1064]
954 1065
955[[package]] 1066[[package]]
@@ -973,7 +1084,7 @@ dependencies = [
973 1084
974[[package]] 1085[[package]]
975name = "smallvec" 1086name = "smallvec"
976version = "0.6.5" 1087version = "0.6.7"
977source = "registry+https://github.com/rust-lang/crates.io-index" 1088source = "registry+https://github.com/rust-lang/crates.io-index"
978dependencies = [ 1089dependencies = [
979 "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 1090 "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -984,7 +1095,7 @@ name = "smol_str"
984version = "0.1.7" 1095version = "0.1.7"
985source = "registry+https://github.com/rust-lang/crates.io-index" 1096source = "registry+https://github.com/rust-lang/crates.io-index"
986dependencies = [ 1097dependencies = [
987 "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", 1098 "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
988] 1099]
989 1100
990[[package]] 1101[[package]]
@@ -1007,18 +1118,18 @@ name = "syn"
1007version = "0.14.9" 1118version = "0.14.9"
1008source = "registry+https://github.com/rust-lang/crates.io-index" 1119source = "registry+https://github.com/rust-lang/crates.io-index"
1009dependencies = [ 1120dependencies = [
1010 "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", 1121 "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
1011 "quote 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", 1122 "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
1012 "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 1123 "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
1013] 1124]
1014 1125
1015[[package]] 1126[[package]]
1016name = "syn" 1127name = "syn"
1017version = "0.15.18" 1128version = "0.15.23"
1018source = "registry+https://github.com/rust-lang/crates.io-index" 1129source = "registry+https://github.com/rust-lang/crates.io-index"
1019dependencies = [ 1130dependencies = [
1020 "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", 1131 "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
1021 "quote 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", 1132 "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
1022 "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 1133 "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
1023] 1134]
1024 1135
@@ -1027,9 +1138,9 @@ name = "synstructure"
1027version = "0.10.1" 1138version = "0.10.1"
1028source = "registry+https://github.com/rust-lang/crates.io-index" 1139source = "registry+https://github.com/rust-lang/crates.io-index"
1029dependencies = [ 1140dependencies = [
1030 "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", 1141 "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
1031 "quote 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", 1142 "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
1032 "syn 0.15.18 (registry+https://github.com/rust-lang/crates.io-index)", 1143 "syn 0.15.23 (registry+https://github.com/rust-lang/crates.io-index)",
1033 "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 1144 "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
1034] 1145]
1035 1146
@@ -1043,8 +1154,21 @@ dependencies = [
1043] 1154]
1044 1155
1045[[package]] 1156[[package]]
1157name = "tempfile"
1158version = "3.0.5"
1159source = "registry+https://github.com/rust-lang/crates.io-index"
1160dependencies = [
1161 "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
1162 "libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)",
1163 "rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
1164 "redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)",
1165 "remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
1166 "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
1167]
1168
1169[[package]]
1046name = "tera" 1170name = "tera"
1047version = "0.11.19" 1171version = "0.11.20"
1048source = "registry+https://github.com/rust-lang/crates.io-index" 1172source = "registry+https://github.com/rust-lang/crates.io-index"
1049dependencies = [ 1173dependencies = [
1050 "chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", 1174 "chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1054,9 +1178,9 @@ dependencies = [
1054 "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 1178 "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
1055 "pest 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 1179 "pest 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
1056 "pest_derive 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 1180 "pest_derive 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
1057 "regex 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", 1181 "regex 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
1058 "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", 1182 "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
1059 "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", 1183 "serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)",
1060 "slug 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 1184 "slug 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
1061 "unic-segment 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", 1185 "unic-segment 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
1062 "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", 1186 "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1068,9 +1192,9 @@ version = "0.0.1"
1068source = "registry+https://github.com/rust-lang/crates.io-index" 1192source = "registry+https://github.com/rust-lang/crates.io-index"
1069dependencies = [ 1193dependencies = [
1070 "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", 1194 "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
1071 "heck 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", 1195 "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
1072 "ron 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 1196 "ron 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
1073 "tera 0.11.19 (registry+https://github.com/rust-lang/crates.io-index)", 1197 "tera 0.11.20 (registry+https://github.com/rust-lang/crates.io-index)",
1074] 1198]
1075 1199
1076[[package]] 1200[[package]]
@@ -1078,8 +1202,8 @@ name = "termion"
1078version = "1.5.1" 1202version = "1.5.1"
1079source = "registry+https://github.com/rust-lang/crates.io-index" 1203source = "registry+https://github.com/rust-lang/crates.io-index"
1080dependencies = [ 1204dependencies = [
1081 "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", 1205 "libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)",
1082 "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", 1206 "redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)",
1083 "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 1207 "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
1084] 1208]
1085 1209
@@ -1088,8 +1212,8 @@ name = "test_utils"
1088version = "0.1.0" 1212version = "0.1.0"
1089dependencies = [ 1213dependencies = [
1090 "difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 1214 "difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
1091 "itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)", 1215 "itertools 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
1092 "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", 1216 "serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)",
1093 "text_unit 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", 1217 "text_unit 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
1094] 1218]
1095 1219
@@ -1098,7 +1222,7 @@ name = "text_unit"
1098version = "0.1.5" 1222version = "0.1.5"
1099source = "registry+https://github.com/rust-lang/crates.io-index" 1223source = "registry+https://github.com/rust-lang/crates.io-index"
1100dependencies = [ 1224dependencies = [
1101 "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", 1225 "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
1102] 1226]
1103 1227
1104[[package]] 1228[[package]]
@@ -1131,16 +1255,16 @@ name = "threadpool"
1131version = "1.7.1" 1255version = "1.7.1"
1132source = "registry+https://github.com/rust-lang/crates.io-index" 1256source = "registry+https://github.com/rust-lang/crates.io-index"
1133dependencies = [ 1257dependencies = [
1134 "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", 1258 "num_cpus 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
1135] 1259]
1136 1260
1137[[package]] 1261[[package]]
1138name = "time" 1262name = "time"
1139version = "0.1.40" 1263version = "0.1.41"
1140source = "registry+https://github.com/rust-lang/crates.io-index" 1264source = "registry+https://github.com/rust-lang/crates.io-index"
1141dependencies = [ 1265dependencies = [
1142 "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", 1266 "libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)",
1143 "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", 1267 "redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)",
1144 "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 1268 "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
1145] 1269]
1146 1270
@@ -1150,9 +1274,9 @@ version = "0.1.0"
1150dependencies = [ 1274dependencies = [
1151 "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)", 1275 "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
1152 "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", 1276 "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
1153 "itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)", 1277 "itertools 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
1154 "teraron 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 1278 "teraron 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
1155 "walkdir 2.2.6 (registry+https://github.com/rust-lang/crates.io-index)", 1279 "walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
1156] 1280]
1157 1281
1158[[package]] 1282[[package]]
@@ -1167,7 +1291,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1167 1291
1168[[package]] 1292[[package]]
1169name = "ucd-util" 1293name = "ucd-util"
1170version = "0.1.2" 1294version = "0.1.3"
1171source = "registry+https://github.com/rust-lang/crates.io-index" 1295source = "registry+https://github.com/rust-lang/crates.io-index"
1172 1296
1173[[package]] 1297[[package]]
@@ -1265,7 +1389,7 @@ name = "url_serde"
1265version = "0.2.0" 1389version = "0.2.0"
1266source = "registry+https://github.com/rust-lang/crates.io-index" 1390source = "registry+https://github.com/rust-lang/crates.io-index"
1267dependencies = [ 1391dependencies = [
1268 "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", 1392 "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
1269 "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", 1393 "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
1270] 1394]
1271 1395
@@ -1291,7 +1415,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1291 1415
1292[[package]] 1416[[package]]
1293name = "walkdir" 1417name = "walkdir"
1294version = "2.2.6" 1418version = "2.2.7"
1295source = "registry+https://github.com/rust-lang/crates.io-index" 1419source = "registry+https://github.com/rust-lang/crates.io-index"
1296dependencies = [ 1420dependencies = [
1297 "same-file 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", 1421 "same-file 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1330,17 +1454,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1330"checksum aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1e9a933f4e58658d7b12defcf96dc5c720f20832deebe3e0a19efd3b6aaeeb9e" 1454"checksum aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1e9a933f4e58658d7b12defcf96dc5c720f20832deebe3e0a19efd3b6aaeeb9e"
1331"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" 1455"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
1332"checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee" 1456"checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee"
1333"checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef" 1457"checksum arrayvec 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "d18513977c2d8261c448511c5c53dc66b26dfccbc3d4446672dea1e71a7d8a26"
1334"checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652" 1458"checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652"
1335"checksum backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "89a47830402e9981c5c41223151efcced65a0510c13097c769cede7efb34782a" 1459"checksum autocfg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4e5f34df7a019573fb8bdc7e24a2bfebe51a2a1d6bfdbaeccedb3c41fc574727"
1336"checksum backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "c66d56ac8dabd07f6aacdaf633f4b8262f5b3601a810a0dcddffd5c22c69daa0" 1460"checksum backtrace 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)" = "b5b493b66e03090ebc4343eb02f94ff944e0cbc9ac6571491d170ba026741eb5"
1461"checksum backtrace-sys 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)" = "3fcce89e5ad5c8949caa9434501f7b55415b3e7ad5270cb88c75a8d35e8f1279"
1337"checksum base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" 1462"checksum base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643"
1338"checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" 1463"checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12"
1339"checksum block-buffer 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a076c298b9ecdb530ed9d967e74a6027d6a7478924520acddcddc24c1c8ab3ab" 1464"checksum block-buffer 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a076c298b9ecdb530ed9d967e74a6027d6a7478924520acddcddc24c1c8ab3ab"
1340"checksum byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "560c32574a12a89ecd91f5e742165893f86e3ab98d21f8ea548658eb9eef5f40" 1465"checksum byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "560c32574a12a89ecd91f5e742165893f86e3ab98d21f8ea548658eb9eef5f40"
1341"checksum byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "94f88df23a25417badc922ab0f5716cc1330e87f71ddd9203b3a3ccd9cedf75d" 1466"checksum byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "94f88df23a25417badc922ab0f5716cc1330e87f71ddd9203b3a3ccd9cedf75d"
1342"checksum cargo_metadata 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1aaa1a9856ae2d188340526d0986feb6899c9ad11c5dfd73453c784fed6e373d" 1467"checksum cargo_metadata 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "e5d1b4d380e1bab994591a24c2bdd1b054f64b60bef483a8c598c7c345bc3bbe"
1343"checksum cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "f159dfd43363c4d08055a07703eb7a3406b0dac4d0584d96965a3262db3c9d16" 1468"checksum cc 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)" = "155ed195f7bd722d1dfeb30365b9d0c1f6a078fa7ca4014497e5935d90993d6f"
1344"checksum cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4" 1469"checksum cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4"
1345"checksum chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "45912881121cb26fad7c38c17ba7daa18764771836b34fab7d3fbd93ed633878" 1470"checksum chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "45912881121cb26fad7c38c17ba7daa18764771836b34fab7d3fbd93ed633878"
1346"checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e" 1471"checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e"
@@ -1348,9 +1473,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1348"checksum crossbeam-channel 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7b85741761b7f160bc5e7e0c14986ef685b7f8bf9b7ad081c60c604bb4649827" 1473"checksum crossbeam-channel 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7b85741761b7f160bc5e7e0c14986ef685b7f8bf9b7ad081c60c604bb4649827"
1349"checksum crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f739f8c5363aca78cfb059edf753d8f0d36908c348f3d8d1503f03d8b75d9cf3" 1474"checksum crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f739f8c5363aca78cfb059edf753d8f0d36908c348f3d8d1503f03d8b75d9cf3"
1350"checksum crossbeam-epoch 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "927121f5407de9956180ff5e936fe3cf4324279280001cd56b669d28ee7e9150" 1475"checksum crossbeam-epoch 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "927121f5407de9956180ff5e936fe3cf4324279280001cd56b669d28ee7e9150"
1351"checksum crossbeam-epoch 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9c90f1474584f38e270b5b613e898c8c328aa4f3dea85e0a27ac2e642f009416" 1476"checksum crossbeam-epoch 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2449aaa4ec7ef96e5fb24db16024b935df718e9ae1cec0a1e68feeca2efca7b8"
1352"checksum crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2760899e32a1d58d5abb31129f8fae5de75220bc2176e77ff7c627ae45c918d9" 1477"checksum crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2760899e32a1d58d5abb31129f8fae5de75220bc2176e77ff7c627ae45c918d9"
1353"checksum crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "677d453a17e8bd2b913fa38e8b9cf04bcdbb5be790aa294f2389661d72036015" 1478"checksum crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "677d453a17e8bd2b913fa38e8b9cf04bcdbb5be790aa294f2389661d72036015"
1479"checksum crossbeam-utils 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "41ee4864f4797060e52044376f7d107429ce1fb43460021b126424b7180ee21a"
1354"checksum derive-new 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "6ca414e896ae072546f4d789f452daaecf60ddee4c9df5dc6d5936d769e3d87c" 1480"checksum derive-new 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "6ca414e896ae072546f4d789f452daaecf60ddee4c9df5dc6d5936d769e3d87c"
1355"checksum deunicode 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "850878694b7933ca4c9569d30a34b55031b9b139ee1fc7b94a527c4ef960d690" 1481"checksum deunicode 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "850878694b7933ca4c9569d30a34b55031b9b139ee1fc7b94a527c4ef960d690"
1356"checksum difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" 1482"checksum difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198"
@@ -1361,95 +1487,104 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1361"checksum failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6dd377bcc1b1b7ce911967e3ec24fa19c3224394ec05b54aa7b083d498341ac7" 1487"checksum failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6dd377bcc1b1b7ce911967e3ec24fa19c3224394ec05b54aa7b083d498341ac7"
1362"checksum failure_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "64c2d913fe8ed3b6c6518eedf4538255b989945c14c2a7d5cbff62a5e2120596" 1488"checksum failure_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "64c2d913fe8ed3b6c6518eedf4538255b989945c14c2a7d5cbff62a5e2120596"
1363"checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" 1489"checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed"
1364"checksum flexi_logger 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "553854ebfebeae44ba699a9dc7d53a4036ccc01cd1e144aea0e3054c54383733" 1490"checksum flexi_logger 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4dda06444ccc8b0a6da19d939989b4a4e83f328710ada449eedaed48c8b903cd"
1365"checksum fst 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9b0408ab57c1bf7c634b2ac6a165d14f642dc3335a43203090a7f8c78b54577b" 1491"checksum fst 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "db72126ca7dff566cdbbdd54af44668c544897d9d3862b198141f176f1238bdf"
1366"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" 1492"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
1367"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" 1493"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
1368"checksum generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ef25c5683767570c2bbd7deba372926a55eaae9982d7726ee2a1050239d45b9d" 1494"checksum generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ef25c5683767570c2bbd7deba372926a55eaae9982d7726ee2a1050239d45b9d"
1369"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" 1495"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb"
1370"checksum heck 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ea04fa3ead4e05e51a7c806fc07271fdbde4e246a6c6d1efd52e72230b771b82" 1496"checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205"
1371"checksum humansize 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b6cab2627acfc432780848602f3f558f7e9dd427352224b0d9324025796d2a5e" 1497"checksum humansize 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b6cab2627acfc432780848602f3f558f7e9dd427352224b0d9324025796d2a5e"
1372"checksum id-arena 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3a7250033feafee46a1cecd2c2616a64aec1d064f38c9ae2bdd297728542843e" 1498"checksum id-arena 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3a7250033feafee46a1cecd2c2616a64aec1d064f38c9ae2bdd297728542843e"
1373"checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" 1499"checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e"
1374"checksum im 12.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ae9c7f9bb8aee47fc16d535a705f7867a9fc83bb822e5e1043bb98e77ffeed3c" 1500"checksum im 12.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ae9c7f9bb8aee47fc16d535a705f7867a9fc83bb822e5e1043bb98e77ffeed3c"
1375"checksum indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7e81a7c05f79578dbc15793d8b619db9ba32b4577003ef3af1a91c416798c58d" 1501"checksum indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7e81a7c05f79578dbc15793d8b619db9ba32b4577003ef3af1a91c416798c58d"
1376"checksum itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)" = "f58856976b776fedd95533137617a02fb25719f40e7d9b01c7043cd65474f450" 1502"checksum itertools 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)" = "0d47946d458e94a1b7bcabbf6521ea7c037062c81f534615abcad76e84d4970d"
1377"checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b" 1503"checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b"
1378"checksum join_to_string 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7bddc885f3fd69dd4b5d747c2efe6dd2c36d795ea9938281ed50910e32c95e31" 1504"checksum join_to_string 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7bddc885f3fd69dd4b5d747c2efe6dd2c36d795ea9938281ed50910e32c95e31"
1379"checksum languageserver-types 0.53.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a0be4f8f783832a308975035043c0e8ad18e11c3f3d395aa6f1a9f3a30b8e654" 1505"checksum languageserver-types 0.53.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a0be4f8f783832a308975035043c0e8ad18e11c3f3d395aa6f1a9f3a30b8e654"
1380"checksum lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a374c89b9db55895453a74c1e38861d9deec0b01b405a82516e9d5de4820dea1" 1506"checksum lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a374c89b9db55895453a74c1e38861d9deec0b01b405a82516e9d5de4820dea1"
1381"checksum libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)" = "76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d" 1507"checksum libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)" = "2d2857ec59fadc0773853c664d2d18e7198e83883e7060b63c924cb077bd5c74"
1382"checksum lock_api 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "775751a3e69bde4df9b38dd00a1b5d6ac13791e4223d4a0506577f0dd27cfb7a" 1508"checksum lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "62ebf1391f6acad60e5c8b43706dde4582df75c06698ab44511d15016bc2442c"
1383"checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6" 1509"checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6"
1384"checksum maplit 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08cbb6b4fef96b6d77bfc40ec491b1690c779e77b05cd9f07f787ed376fd4c43" 1510"checksum maplit 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08cbb6b4fef96b6d77bfc40ec491b1690c779e77b05cd9f07f787ed376fd4c43"
1385"checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" 1511"checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08"
1386"checksum memchr 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0a3eb002f0535929f1199681417029ebea04aadc0c7a4224b46be99c7f5d6a16" 1512"checksum memchr 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "db4c41318937f6e76648f42826b1d9ade5c09cafb5aef7e351240a70f39206e9"
1387"checksum memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e2ffa2c986de11a9df78620c01eeaaf27d94d3ff02bf81bfcca953102dd0c6ff" 1513"checksum memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e2ffa2c986de11a9df78620c01eeaaf27d94d3ff02bf81bfcca953102dd0c6ff"
1388"checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3" 1514"checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3"
1389"checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2" 1515"checksum nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945"
1390"checksum num-derive 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8af1847c907c2f04d7bfd572fb25bbb4385c637fe5be163cf2f8c5d778fe1e7d" 1516"checksum num-derive 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8af1847c907c2f04d7bfd572fb25bbb4385c637fe5be163cf2f8c5d778fe1e7d"
1391"checksum num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "e83d528d2677f0518c570baf2b7abdcf0cd2d248860b68507bdcb3e91d4c0cea" 1517"checksum num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "e83d528d2677f0518c570baf2b7abdcf0cd2d248860b68507bdcb3e91d4c0cea"
1392"checksum num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0b3a5d7cc97d6d30d8b9bc8fa19bf45349ffe46241e8816f50f62f6d6aaabee1" 1518"checksum num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0b3a5d7cc97d6d30d8b9bc8fa19bf45349ffe46241e8816f50f62f6d6aaabee1"
1393"checksum num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30" 1519"checksum num_cpus 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5a69d464bdc213aaaff628444e99578ede64e9c854025aa43b9796530afa9238"
1394"checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37" 1520"checksum owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "49a4b8ea2179e6a2e27411d3bca09ca6dd630821cf6894c6c7c8467a8ee7ef13"
1395"checksum parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0802bff09003b291ba756dc7e79313e51cc31667e94afbe847def490424cde5" 1521"checksum parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0802bff09003b291ba756dc7e79313e51cc31667e94afbe847def490424cde5"
1522"checksum parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9723236a9525c757d9725b993511e3fc941e33f27751942232f0058298297edf"
1396"checksum parking_lot_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad7f7e6ebdc79edff6fdcb87a55b620174f7a989e3eb31b65231f4af57f00b8c" 1523"checksum parking_lot_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad7f7e6ebdc79edff6fdcb87a55b620174f7a989e3eb31b65231f4af57f00b8c"
1524"checksum parking_lot_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94c8c7923936b28d546dfd14d4472eaf34c99b14e1c973a32b3e6d4eb04298c9"
1397"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" 1525"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831"
1398"checksum pest 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a677051ad923732bb5c70f2d45f8985a96e3eee2e2bff86697e3b11b0c3fcfde" 1526"checksum pest 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a677051ad923732bb5c70f2d45f8985a96e3eee2e2bff86697e3b11b0c3fcfde"
1399"checksum pest_derive 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b76f477146419bc539a63f4ef40e902166cb43b3e51cecc71d9136fd12c567e7" 1527"checksum pest_derive 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b76f477146419bc539a63f4ef40e902166cb43b3e51cecc71d9136fd12c567e7"
1400"checksum pest_generator 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ebee4e9680be4fd162e6f3394ae4192a6b60b1e4d17d845e631f0c68d1a3386" 1528"checksum pest_generator 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ebee4e9680be4fd162e6f3394ae4192a6b60b1e4d17d845e631f0c68d1a3386"
1401"checksum pest_meta 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1f6d5f6f0e6082578c86af197d780dc38328e3f768cec06aac9bc46d714e8221" 1529"checksum pest_meta 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1f6d5f6f0e6082578c86af197d780dc38328e3f768cec06aac9bc46d714e8221"
1402"checksum proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)" = "3d7b7eaaa90b4a90a932a9ea6666c95a389e424eff347f0f793979289429feee" 1530"checksum proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)" = "77619697826f31a02ae974457af0b29b723e5619e113e9397b8b82c6bd253f09"
1403"checksum quote 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "63b5829244f52738cfee93b3a165c1911388675be000c888d2fae620dee8fa5b" 1531"checksum quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "53fa22a1994bd0f9372d7a816207d8a2677ad0325b073f5c5332760f0fb62b5c"
1404"checksum rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8356f47b32624fef5b3301c1be97e5944ecdd595409cc5da11d05f211db6cfbd" 1532"checksum rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8356f47b32624fef5b3301c1be97e5944ecdd595409cc5da11d05f211db6cfbd"
1405"checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c" 1533"checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c"
1534"checksum rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ae9d223d52ae411a33cf7e54ec6034ec165df296ccd23533d671a28252b6f66a"
1535"checksum rand_chacha 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "771b009e3a508cb67e8823dda454aaa5368c7bc1c16829fb77d3e980440dd34a"
1406"checksum rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1961a422c4d189dfb50ffa9320bf1f2a9bd54ecb92792fb9477f99a1045f3372" 1536"checksum rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1961a422c4d189dfb50ffa9320bf1f2a9bd54ecb92792fb9477f99a1045f3372"
1407"checksum rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0905b6b7079ec73b314d4c748701f6931eb79fd97c668caa3f1899b22b32c6db" 1537"checksum rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0905b6b7079ec73b314d4c748701f6931eb79fd97c668caa3f1899b22b32c6db"
1538"checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4"
1539"checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08"
1540"checksum rand_pcg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "086bd09a33c7044e56bb44d5bdde5a60e7f119a9e95b0775f545de759a32fe05"
1541"checksum rand_xorshift 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "effa3fcaa47e18db002bdde6060944b6d2f9cfd8db471c30e873448ad9187be3"
1408"checksum rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "373814f27745b2686b350dd261bfd24576a6fb0e2c5919b3a2b6005f820b0473" 1542"checksum rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "373814f27745b2686b350dd261bfd24576a6fb0e2c5919b3a2b6005f820b0473"
1409"checksum rayon-core 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b055d1e92aba6877574d8fe604a63c8b5df60f60e5982bf7ccbb1338ea527356" 1543"checksum rayon-core 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b055d1e92aba6877574d8fe604a63c8b5df60f60e5982bf7ccbb1338ea527356"
1410"checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1" 1544"checksum redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)" = "a84bcd297b87a545980a2d25a0beb72a1f490c31f0a9fde52fca35bfbb1ceb70"
1411"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" 1545"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
1412"checksum regex 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ee84f70c8c08744ea9641a731c7fadb475bf2ecc52d7f627feb833e0b3990467" 1546"checksum regex 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "37e7cbbd370869ce2e8dff25c7018702d10b21a20ef7135316f8daecd6c25b7f"
1413"checksum regex-syntax 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "747ba3b235651f6e2f67dfa8bcdcd073ddb7c243cb21c442fc12395dfcac212d" 1547"checksum regex-syntax 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4e47a2ed29da7a9e1960e1639e7a982e6edc6d49be308a3b02daf511504a16d1"
1414"checksum relative-path 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0e7790c7f1cc73d831d28dc5a7deb316a006e7848e6a7f467cdb10a0a9e0fb1c" 1548"checksum relative-path 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0e7790c7f1cc73d831d28dc5a7deb316a006e7848e6a7f467cdb10a0a9e0fb1c"
1415"checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5" 1549"checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5"
1416"checksum ron 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c48677d8a9247a4e0d1f3f9cb4b0a8e29167fdc3c04f383a5e669cd7a960ae0f" 1550"checksum ron 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c48677d8a9247a4e0d1f3f9cb4b0a8e29167fdc3c04f383a5e669cd7a960ae0f"
1417"checksum rowan 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "795b1c830f5335e89f93415315518e9727307308c44c1e5adebe8a38f856c334" 1551"checksum rowan 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a9ccca91953e9c549cac18e8f41daa5d49dad1c9a4c9bb977ac42718bb34e1bf"
1418"checksum rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "bcfe5b13211b4d78e5c2cadfebd7769197d95c639c35a50057eb4c05de811395" 1552"checksum rustc-demangle 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "01b90379b8664dd83460d59bdc5dd1fd3172b8913788db483ed1325171eab2f7"
1419"checksum rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7540fc8b0c49f096ee9c961cda096467dce8084bec6bdca2fc83895fd9b28cb8" 1553"checksum rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7540fc8b0c49f096ee9c961cda096467dce8084bec6bdca2fc83895fd9b28cb8"
1420"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" 1554"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
1421"checksum ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7153dd96dade874ab973e098cb62fcdbb89a03682e46b144fd09550998d4a4a7" 1555"checksum ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "eb9e9b8cde282a9fe6a42dd4681319bfb63f121b8a8ee9439c6f4107e58a46f7"
1422"checksum safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8dca453248a96cb0749e36ccdfe2b0b4e54a61bfef89fb97ec621eb8e0a93dd9" 1556"checksum safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8dca453248a96cb0749e36ccdfe2b0b4e54a61bfef89fb97ec621eb8e0a93dd9"
1423"checksum salsa 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e56b13ce9b2bfaa1c89863d76880838c0734de85beeaef437fd70d4fa7e253d3" 1557"checksum salsa 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e56b13ce9b2bfaa1c89863d76880838c0734de85beeaef437fd70d4fa7e253d3"
1424"checksum same-file 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8f20c4be53a8a1ff4c1f1b2bd14570d2f634628709752f0702ecdd2b3f9a5267" 1558"checksum same-file 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8f20c4be53a8a1ff4c1f1b2bd14570d2f634628709752f0702ecdd2b3f9a5267"
1425"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" 1559"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27"
1426"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" 1560"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
1427"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" 1561"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
1428"checksum serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)" = "15c141fc7027dd265a47c090bf864cf62b42c4d228bbcf4e51a0c9e2b0d3f7ef" 1562"checksum serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)" = "6fa52f19aee12441d5ad11c9a00459122bd8f98707cadf9778c540674f1935b6"
1429"checksum serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)" = "225de307c6302bec3898c51ca302fc94a7a1697ef0845fcee6448f33c032249c" 1563"checksum serde_derive 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)" = "96a7f9496ac65a2db5929afa087b54f8fc5008dcfbe48a8874ed20049b0d6154"
1430"checksum serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)" = "43344e7ce05d0d8280c5940cabb4964bea626aa58b1ec0e8c73fa2a8512a38ce" 1564"checksum serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)" = "c37ccd6be3ed1fdf419ee848f7c758eb31b054d7cd3ae3600e3bae0adf569811"
1431"checksum sha-1 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "51b9d1f3b5de8a167ab06834a7c883bd197f2191e1dda1a22d9ccfeedbf9aded" 1565"checksum sha-1 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "51b9d1f3b5de8a167ab06834a7c883bd197f2191e1dda1a22d9ccfeedbf9aded"
1432"checksum slug 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b3bc762e6a4b6c6fcaade73e77f9ebc6991b676f88bb2358bddb56560f073373" 1566"checksum slug 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b3bc762e6a4b6c6fcaade73e77f9ebc6991b676f88bb2358bddb56560f073373"
1433"checksum smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "153ffa32fd170e9944f7e0838edf824a754ec4c1fc64746fcc9fe1f8fa602e5d" 1567"checksum smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "b73ea3738b47563803ef814925e69be00799a8c07420be8b996f8e98fb2336db"
1434"checksum smol_str 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f3ed6f19b800d76574926e458d5f8e2dbea86c2b58c08d33a982448f09ac8d0c" 1568"checksum smol_str 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f3ed6f19b800d76574926e458d5f8e2dbea86c2b58c08d33a982448f09ac8d0c"
1435"checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" 1569"checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8"
1436"checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" 1570"checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550"
1437"checksum superslice 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b50b13d42370e0f5fc62eafdd5c2d20065eaf5458dab215ff3e20e63eea96b30" 1571"checksum superslice 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b50b13d42370e0f5fc62eafdd5c2d20065eaf5458dab215ff3e20e63eea96b30"
1438"checksum syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)" = "261ae9ecaa397c42b960649561949d69311f08eeaea86a65696e6e46517cf741" 1572"checksum syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)" = "261ae9ecaa397c42b960649561949d69311f08eeaea86a65696e6e46517cf741"
1439"checksum syn 0.15.18 (registry+https://github.com/rust-lang/crates.io-index)" = "90c39a061e2f412a9f869540471ab679e85e50c6b05604daf28bc3060f75c430" 1573"checksum syn 0.15.23 (registry+https://github.com/rust-lang/crates.io-index)" = "9545a6a093a3f0bd59adb472700acc08cad3776f860f16a897dfce8c88721cbc"
1440"checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015" 1574"checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015"
1441"checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" 1575"checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8"
1442"checksum tera 0.11.19 (registry+https://github.com/rust-lang/crates.io-index)" = "6ac6d8ad623a7efcfb4367ce2a36f84ef849d5aa3c7bcf2e0324c4cbcc57ebaf" 1576"checksum tempfile 3.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "7e91405c14320e5c79b3d148e1c86f40749a36e490642202a31689cb1a3452b2"
1577"checksum tera 0.11.20 (registry+https://github.com/rust-lang/crates.io-index)" = "4b505279e19d8f7d24b1a9dc58327c9c36174b1a2c7ebdeac70792d017cb64f3"
1443"checksum teraron 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0d89ad4617d1dec55331067fadaa041e813479e1779616f3d3ce9308bf46184e" 1578"checksum teraron 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0d89ad4617d1dec55331067fadaa041e813479e1779616f3d3ce9308bf46184e"
1444"checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" 1579"checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096"
1445"checksum text_unit 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "8009d7bdbd896a7e09b595f8f9325a19047fc708653e60d0895202b82135048f" 1580"checksum text_unit 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "8009d7bdbd896a7e09b595f8f9325a19047fc708653e60d0895202b82135048f"
1446"checksum textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "307686869c93e71f94da64286f9a9524c0f308a9e1c87a583de8e9c9039ad3f6" 1581"checksum textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "307686869c93e71f94da64286f9a9524c0f308a9e1c87a583de8e9c9039ad3f6"
1447"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" 1582"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b"
1448"checksum threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e2f0c90a5f3459330ac8bc0d2f879c693bb7a2f59689c1083fc4ef83834da865" 1583"checksum threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e2f0c90a5f3459330ac8bc0d2f879c693bb7a2f59689c1083fc4ef83834da865"
1449"checksum time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "d825be0eb33fda1a7e68012d51e9c7f451dc1a69391e7fdc197060bb8c56667b" 1584"checksum time 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "847da467bf0db05882a9e2375934a8a55cffdc9db0d128af1518200260ba1f6c"
1450"checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" 1585"checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169"
1451"checksum ucd-trie 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "71a9c5b1fe77426cf144cc30e49e955270f5086e31a6441dfa8b32efc09b9d77" 1586"checksum ucd-trie 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "71a9c5b1fe77426cf144cc30e49e955270f5086e31a6441dfa8b32efc09b9d77"
1452"checksum ucd-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d0f8bfa9ff0cadcd210129ad9d2c5f145c13e9ced3d3e5d948a6213487d52444" 1587"checksum ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "535c204ee4d8434478593480b8f86ab45ec9aae0e83c568ca81abf0fd0e88f86"
1453"checksum unic-char-property 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ce36d3f7ce754afdbccccf8ff0dd0134e50fb44aaae579f96218856e9e5dbd1e" 1588"checksum unic-char-property 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ce36d3f7ce754afdbccccf8ff0dd0134e50fb44aaae579f96218856e9e5dbd1e"
1454"checksum unic-char-range 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9ab85fab42ad1b26cafc03bf891f69cb4d6e15f491030e89a0122197baa8ae8" 1589"checksum unic-char-range 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9ab85fab42ad1b26cafc03bf891f69cb4d6e15f491030e89a0122197baa8ae8"
1455"checksum unic-common 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff8d4a7ade929ef7d971e16ced21a8cd56a63869aa6032dfb8cb083cf7d077bf" 1590"checksum unic-common 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff8d4a7ade929ef7d971e16ced21a8cd56a63869aa6032dfb8cb083cf7d077bf"
@@ -1468,7 +1603,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1468"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" 1603"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a"
1469"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" 1604"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd"
1470"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" 1605"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
1471"checksum walkdir 2.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0ffb549f212c31e19f3667c55a7f515b983a84aef10fd0a4d1f9c125425115f3" 1606"checksum walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "9d9d7ed3431229a144296213105a390676cc49c9b6a72bd19f3176c98e129fa1"
1472"checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0" 1607"checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0"
1473"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1608"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
1474"checksum winapi-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "afc5508759c5bf4285e61feb862b6083c8480aec864fa17a81fdec6f69b461ab" 1609"checksum winapi-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "afc5508759c5bf4285e61feb862b6083c8480aec864fa17a81fdec6f69b461ab"
diff --git a/Cargo.toml b/Cargo.toml
index 5cfc064b5..95830561d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -2,4 +2,5 @@
2members = [ "crates/*" ] 2members = [ "crates/*" ]
3 3
4[profile.release] 4[profile.release]
5incremental = true
5debug = true 6debug = true
diff --git a/crates/ra_analysis/src/db.rs b/crates/ra_analysis/src/db.rs
index b8d774eb5..3d0f13f34 100644
--- a/crates/ra_analysis/src/db.rs
+++ b/crates/ra_analysis/src/db.rs
@@ -30,11 +30,11 @@ impl Default for RootDatabase {
30 runtime: salsa::Runtime::default(), 30 runtime: salsa::Runtime::default(),
31 id_maps: Default::default(), 31 id_maps: Default::default(),
32 }; 32 };
33 db.query_mut(ra_db::SourceRootQuery)
34 .set(ra_db::WORKSPACE, Default::default());
35 db.query_mut(ra_db::CrateGraphQuery) 33 db.query_mut(ra_db::CrateGraphQuery)
36 .set((), Default::default()); 34 .set((), Default::default());
37 db.query_mut(ra_db::LibrariesQuery) 35 db.query_mut(ra_db::LocalRootsQuery)
36 .set((), Default::default());
37 db.query_mut(ra_db::LibraryRootsQuery)
38 .set((), Default::default()); 38 .set((), Default::default());
39 db 39 db
40 } 40 }
@@ -61,9 +61,11 @@ salsa::database_storage! {
61 pub(crate) struct RootDatabaseStorage for RootDatabase { 61 pub(crate) struct RootDatabaseStorage for RootDatabase {
62 impl ra_db::FilesDatabase { 62 impl ra_db::FilesDatabase {
63 fn file_text() for ra_db::FileTextQuery; 63 fn file_text() for ra_db::FileTextQuery;
64 fn file_relative_path() for ra_db::FileRelativePathQuery;
64 fn file_source_root() for ra_db::FileSourceRootQuery; 65 fn file_source_root() for ra_db::FileSourceRootQuery;
65 fn source_root() for ra_db::SourceRootQuery; 66 fn source_root() for ra_db::SourceRootQuery;
66 fn libraries() for ra_db::LibrariesQuery; 67 fn local_roots() for ra_db::LocalRootsQuery;
68 fn library_roots() for ra_db::LibraryRootsQuery;
67 fn crate_graph() for ra_db::CrateGraphQuery; 69 fn crate_graph() for ra_db::CrateGraphQuery;
68 } 70 }
69 impl ra_db::SyntaxDatabase { 71 impl ra_db::SyntaxDatabase {
diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs
index 0de0e2645..c4291885a 100644
--- a/crates/ra_analysis/src/imp.rs
+++ b/crates/ra_analysis/src/imp.rs
@@ -10,9 +10,8 @@ use ra_syntax::{
10 SyntaxKind::*, 10 SyntaxKind::*,
11 SyntaxNodeRef, TextRange, TextUnit, 11 SyntaxNodeRef, TextRange, TextUnit,
12}; 12};
13use ra_db::{FilesDatabase, SourceRoot, SourceRootId, WORKSPACE, SyntaxDatabase}; 13use ra_db::{FilesDatabase, SourceRoot, SourceRootId, SyntaxDatabase};
14use rayon::prelude::*; 14use rayon::prelude::*;
15use rustc_hash::FxHashSet;
16use salsa::{Database, ParallelDatabase}; 15use salsa::{Database, ParallelDatabase};
17use hir::{ 16use hir::{
18 self, 17 self,
@@ -24,8 +23,8 @@ use hir::{
24use crate::{ 23use crate::{
25 completion::{completions, CompletionItem}, 24 completion::{completions, CompletionItem},
26 db, 25 db,
27 symbol_index::{SymbolIndex, SymbolsDatabase}, 26 symbol_index::{SymbolIndex, SymbolsDatabase, LibrarySymbolsQuery},
28 AnalysisChange, Cancelable, CrateId, Diagnostic, FileId, 27 AnalysisChange, RootChange, Cancelable, CrateId, Diagnostic, FileId,
29 FileSystemEdit, FilePosition, Query, SourceChange, SourceFileNodeEdit, 28 FileSystemEdit, FilePosition, Query, SourceChange, SourceFileNodeEdit,
30 ReferenceResolution, 29 ReferenceResolution,
31}; 30};
@@ -44,70 +43,41 @@ impl AnalysisHostImpl {
44 pub fn apply_change(&mut self, change: AnalysisChange) { 43 pub fn apply_change(&mut self, change: AnalysisChange) {
45 log::info!("apply_change {:?}", change); 44 log::info!("apply_change {:?}", change);
46 // self.gc_syntax_trees(); 45 // self.gc_syntax_trees();
47 46 if !change.new_roots.is_empty() {
48 for (file_id, text) in change.files_changed { 47 let mut local_roots = Vec::clone(&self.db.local_roots());
49 self.db 48 for (root_id, is_local) in change.new_roots {
50 .query_mut(ra_db::FileTextQuery)
51 .set(file_id, Arc::new(text))
52 }
53 if !(change.files_added.is_empty() && change.files_removed.is_empty()) {
54 let file_resolver = change
55 .file_resolver
56 .expect("change resolver when changing set of files");
57 let mut source_root = SourceRoot::clone(&self.db.source_root(WORKSPACE));
58 for (file_id, text) in change.files_added {
59 self.db 49 self.db
60 .query_mut(ra_db::FileTextQuery) 50 .query_mut(ra_db::SourceRootQuery)
61 .set(file_id, Arc::new(text)); 51 .set(root_id, Default::default());
62 self.db 52 if is_local {
63 .query_mut(ra_db::FileSourceRootQuery) 53 local_roots.push(root_id);
64 .set(file_id, ra_db::WORKSPACE); 54 }
65 source_root.files.insert(file_id);
66 }
67 for file_id in change.files_removed {
68 self.db
69 .query_mut(ra_db::FileTextQuery)
70 .set(file_id, Arc::new(String::new()));
71 source_root.files.remove(&file_id);
72 } 55 }
73 source_root.file_resolver = file_resolver;
74 self.db 56 self.db
75 .query_mut(ra_db::SourceRootQuery) 57 .query_mut(ra_db::LocalRootsQuery)
76 .set(WORKSPACE, Arc::new(source_root)) 58 .set((), Arc::new(local_roots));
59 }
60
61 for (root_id, root_change) in change.roots_changed {
62 self.apply_root_change(root_id, root_change);
63 }
64 for (file_id, text) in change.files_changed {
65 self.db.query_mut(ra_db::FileTextQuery).set(file_id, text)
77 } 66 }
78 if !change.libraries_added.is_empty() { 67 if !change.libraries_added.is_empty() {
79 let mut libraries = Vec::clone(&self.db.libraries()); 68 let mut libraries = Vec::clone(&self.db.library_roots());
80 for library in change.libraries_added { 69 for library in change.libraries_added {
81 let source_root_id = SourceRootId(1 + libraries.len() as u32); 70 libraries.push(library.root_id);
82 libraries.push(source_root_id);
83 let mut files = FxHashSet::default();
84 for (file_id, text) in library.files {
85 files.insert(file_id);
86 log::debug!(
87 "library file: {:?} {:?}",
88 file_id,
89 library.file_resolver.debug_path(file_id)
90 );
91 self.db
92 .query_mut(ra_db::FileSourceRootQuery)
93 .set_constant(file_id, source_root_id);
94 self.db
95 .query_mut(ra_db::FileTextQuery)
96 .set_constant(file_id, Arc::new(text));
97 }
98 let source_root = SourceRoot {
99 files,
100 file_resolver: library.file_resolver,
101 };
102 self.db 71 self.db
103 .query_mut(ra_db::SourceRootQuery) 72 .query_mut(ra_db::SourceRootQuery)
104 .set(source_root_id, Arc::new(source_root)); 73 .set(library.root_id, Default::default());
105 self.db 74 self.db
106 .query_mut(crate::symbol_index::LibrarySymbolsQuery) 75 .query_mut(LibrarySymbolsQuery)
107 .set(source_root_id, Arc::new(library.symbol_index)); 76 .set_constant(library.root_id, Arc::new(library.symbol_index));
77 self.apply_root_change(library.root_id, library.root_change);
108 } 78 }
109 self.db 79 self.db
110 .query_mut(ra_db::LibrariesQuery) 80 .query_mut(ra_db::LibraryRootsQuery)
111 .set((), Arc::new(libraries)); 81 .set((), Arc::new(libraries));
112 } 82 }
113 if let Some(crate_graph) = change.crate_graph { 83 if let Some(crate_graph) = change.crate_graph {
@@ -117,6 +87,34 @@ impl AnalysisHostImpl {
117 } 87 }
118 } 88 }
119 89
90 fn apply_root_change(&mut self, root_id: SourceRootId, root_change: RootChange) {
91 let mut source_root = SourceRoot::clone(&self.db.source_root(root_id));
92 for add_file in root_change.added {
93 self.db
94 .query_mut(ra_db::FileTextQuery)
95 .set(add_file.file_id, add_file.text);
96 self.db
97 .query_mut(ra_db::FileRelativePathQuery)
98 .set(add_file.file_id, add_file.path.clone());
99 self.db
100 .query_mut(ra_db::FileSourceRootQuery)
101 .set(add_file.file_id, root_id);
102 source_root.files.insert(add_file.path, add_file.file_id);
103 }
104 for remove_file in root_change.removed {
105 self.db
106 .query_mut(ra_db::FileTextQuery)
107 .set(remove_file.file_id, Default::default());
108 self.db
109 .query_mut(ra_db::FileRelativePathQuery)
110 .set(remove_file.file_id, Default::default());
111 source_root.files.remove(&remove_file.path);
112 }
113 self.db
114 .query_mut(ra_db::SourceRootQuery)
115 .set(root_id, Arc::new(source_root));
116 }
117
120 #[allow(unused)] 118 #[allow(unused)]
121 /// Ideally, we should call this function from time to time to collect heavy 119 /// Ideally, we should call this function from time to time to collect heavy
122 /// syntax trees. However, if we actually do that, everything is recomputed 120 /// syntax trees. However, if we actually do that, everything is recomputed
@@ -156,21 +154,26 @@ impl AnalysisImpl {
156 self.db.file_lines(file_id) 154 self.db.file_lines(file_id)
157 } 155 }
158 pub fn world_symbols(&self, query: Query) -> Cancelable<Vec<(FileId, FileSymbol)>> { 156 pub fn world_symbols(&self, query: Query) -> Cancelable<Vec<(FileId, FileSymbol)>> {
157 /// Need to wrap Snapshot to provide `Clone` impl for `map_with`
158 struct Snap(salsa::Snapshot<db::RootDatabase>);
159 impl Clone for Snap {
160 fn clone(&self) -> Snap {
161 Snap(self.0.snapshot())
162 }
163 }
164
159 let buf: Vec<Arc<SymbolIndex>> = if query.libs { 165 let buf: Vec<Arc<SymbolIndex>> = if query.libs {
166 let snap = Snap(self.db.snapshot());
160 self.db 167 self.db
161 .libraries() 168 .library_roots()
162 .iter() 169 .par_iter()
163 .map(|&lib_id| self.db.library_symbols(lib_id)) 170 .map_with(snap, |db, &lib_id| db.0.library_symbols(lib_id))
164 .collect() 171 .collect()
165 } else { 172 } else {
166 let files = &self.db.source_root(WORKSPACE).files; 173 let mut files = Vec::new();
167 174 for &root in self.db.local_roots().iter() {
168 /// Need to wrap Snapshot to provide `Clone` impl for `map_with` 175 let sr = self.db.source_root(root);
169 struct Snap(salsa::Snapshot<db::RootDatabase>); 176 files.extend(sr.files.values().map(|&it| it))
170 impl Clone for Snap {
171 fn clone(&self) -> Snap {
172 Snap(self.0.snapshot())
173 }
174 } 177 }
175 178
176 let snap = Snap(self.db.snapshot()); 179 let snap = Snap(self.db.snapshot());
diff --git a/crates/ra_analysis/src/lib.rs b/crates/ra_analysis/src/lib.rs
index 22fff71ab..a1d462528 100644
--- a/crates/ra_analysis/src/lib.rs
+++ b/crates/ra_analysis/src/lib.rs
@@ -18,9 +18,9 @@ pub mod mock_analysis;
18 18
19use std::{fmt, sync::Arc}; 19use std::{fmt, sync::Arc};
20 20
21use rustc_hash::FxHashMap;
21use ra_syntax::{SourceFileNode, TextRange, TextUnit}; 22use ra_syntax::{SourceFileNode, TextRange, TextUnit};
22use ra_text_edit::AtomTextEdit; 23use ra_text_edit::AtomTextEdit;
23use ra_db::FileResolverImp;
24use rayon::prelude::*; 24use rayon::prelude::*;
25use relative_path::RelativePathBuf; 25use relative_path::RelativePathBuf;
26 26
@@ -39,28 +39,54 @@ pub use hir::FnSignatureInfo;
39 39
40pub use ra_db::{ 40pub use ra_db::{
41 Canceled, Cancelable, FilePosition, 41 Canceled, Cancelable, FilePosition,
42 CrateGraph, CrateId, FileId, FileResolver 42 CrateGraph, CrateId, SourceRootId, FileId
43}; 43};
44 44
45#[derive(Default)] 45#[derive(Default)]
46pub struct AnalysisChange { 46pub struct AnalysisChange {
47 files_added: Vec<(FileId, String)>, 47 new_roots: Vec<(SourceRootId, bool)>,
48 files_changed: Vec<(FileId, String)>, 48 roots_changed: FxHashMap<SourceRootId, RootChange>,
49 files_removed: Vec<(FileId)>, 49 files_changed: Vec<(FileId, Arc<String>)>,
50 libraries_added: Vec<LibraryData>, 50 libraries_added: Vec<LibraryData>,
51 crate_graph: Option<CrateGraph>, 51 crate_graph: Option<CrateGraph>,
52 file_resolver: Option<FileResolverImp>, 52}
53
54#[derive(Default)]
55struct RootChange {
56 added: Vec<AddFile>,
57 removed: Vec<RemoveFile>,
58}
59
60#[derive(Debug)]
61struct AddFile {
62 file_id: FileId,
63 path: RelativePathBuf,
64 text: Arc<String>,
65}
66
67#[derive(Debug)]
68struct RemoveFile {
69 file_id: FileId,
70 path: RelativePathBuf,
53} 71}
54 72
55impl fmt::Debug for AnalysisChange { 73impl fmt::Debug for AnalysisChange {
56 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { 74 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
57 fmt.debug_struct("AnalysisChange") 75 fmt.debug_struct("AnalysisChange")
58 .field("files_added", &self.files_added.len()) 76 .field("new_roots", &self.new_roots)
77 .field("roots_changed", &self.roots_changed)
59 .field("files_changed", &self.files_changed.len()) 78 .field("files_changed", &self.files_changed.len())
60 .field("files_removed", &self.files_removed.len())
61 .field("libraries_added", &self.libraries_added.len()) 79 .field("libraries_added", &self.libraries_added.len())
62 .field("crate_graph", &self.crate_graph) 80 .field("crate_graph", &self.crate_graph)
63 .field("file_resolver", &self.file_resolver) 81 .finish()
82 }
83}
84
85impl fmt::Debug for RootChange {
86 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
87 fmt.debug_struct("AnalysisChange")
88 .field("added", &self.added.len())
89 .field("removed", &self.removed.len())
64 .finish() 90 .finish()
65 } 91 }
66} 92}
@@ -69,14 +95,37 @@ impl AnalysisChange {
69 pub fn new() -> AnalysisChange { 95 pub fn new() -> AnalysisChange {
70 AnalysisChange::default() 96 AnalysisChange::default()
71 } 97 }
72 pub fn add_file(&mut self, file_id: FileId, text: String) { 98 pub fn add_root(&mut self, root_id: SourceRootId, is_local: bool) {
73 self.files_added.push((file_id, text)) 99 self.new_roots.push((root_id, is_local));
74 } 100 }
75 pub fn change_file(&mut self, file_id: FileId, new_text: String) { 101 pub fn add_file(
102 &mut self,
103 root_id: SourceRootId,
104 file_id: FileId,
105 path: RelativePathBuf,
106 text: Arc<String>,
107 ) {
108 let file = AddFile {
109 file_id,
110 path,
111 text,
112 };
113 self.roots_changed
114 .entry(root_id)
115 .or_default()
116 .added
117 .push(file);
118 }
119 pub fn change_file(&mut self, file_id: FileId, new_text: Arc<String>) {
76 self.files_changed.push((file_id, new_text)) 120 self.files_changed.push((file_id, new_text))
77 } 121 }
78 pub fn remove_file(&mut self, file_id: FileId) { 122 pub fn remove_file(&mut self, root_id: SourceRootId, file_id: FileId, path: RelativePathBuf) {
79 self.files_removed.push(file_id) 123 let file = RemoveFile { file_id, path };
124 self.roots_changed
125 .entry(root_id)
126 .or_default()
127 .removed
128 .push(file);
80 } 129 }
81 pub fn add_library(&mut self, data: LibraryData) { 130 pub fn add_library(&mut self, data: LibraryData) {
82 self.libraries_added.push(data) 131 self.libraries_added.push(data)
@@ -84,9 +133,6 @@ impl AnalysisChange {
84 pub fn set_crate_graph(&mut self, graph: CrateGraph) { 133 pub fn set_crate_graph(&mut self, graph: CrateGraph) {
85 self.crate_graph = Some(graph); 134 self.crate_graph = Some(graph);
86 } 135 }
87 pub fn set_file_resolver(&mut self, file_resolver: Arc<FileResolver>) {
88 self.file_resolver = Some(FileResolverImp::new(file_resolver));
89 }
90} 136}
91 137
92/// `AnalysisHost` stores the current state of the world. 138/// `AnalysisHost` stores the current state of the world.
@@ -313,20 +359,32 @@ impl Analysis {
313 359
314#[derive(Debug)] 360#[derive(Debug)]
315pub struct LibraryData { 361pub struct LibraryData {
316 files: Vec<(FileId, String)>, 362 root_id: SourceRootId,
317 file_resolver: FileResolverImp, 363 root_change: RootChange,
318 symbol_index: SymbolIndex, 364 symbol_index: SymbolIndex,
319} 365}
320 366
321impl LibraryData { 367impl LibraryData {
322 pub fn prepare(files: Vec<(FileId, String)>, file_resolver: Arc<FileResolver>) -> LibraryData { 368 pub fn prepare(
323 let symbol_index = SymbolIndex::for_files(files.par_iter().map(|(file_id, text)| { 369 root_id: SourceRootId,
370 files: Vec<(FileId, RelativePathBuf, Arc<String>)>,
371 ) -> LibraryData {
372 let symbol_index = SymbolIndex::for_files(files.par_iter().map(|(file_id, _, text)| {
324 let file = SourceFileNode::parse(text); 373 let file = SourceFileNode::parse(text);
325 (*file_id, file) 374 (*file_id, file)
326 })); 375 }));
376 let mut root_change = RootChange::default();
377 root_change.added = files
378 .into_iter()
379 .map(|(file_id, path, text)| AddFile {
380 file_id,
381 path,
382 text,
383 })
384 .collect();
327 LibraryData { 385 LibraryData {
328 files, 386 root_id,
329 file_resolver: FileResolverImp::new(file_resolver), 387 root_change,
330 symbol_index, 388 symbol_index,
331 } 389 }
332 } 390 }
diff --git a/crates/ra_analysis/src/mock_analysis.rs b/crates/ra_analysis/src/mock_analysis.rs
index 0d9a7a147..7cbdfb953 100644
--- a/crates/ra_analysis/src/mock_analysis.rs
+++ b/crates/ra_analysis/src/mock_analysis.rs
@@ -4,7 +4,7 @@ use relative_path::{RelativePathBuf};
4use test_utils::{extract_offset, parse_fixture, CURSOR_MARKER}; 4use test_utils::{extract_offset, parse_fixture, CURSOR_MARKER};
5use ra_db::mock::FileMap; 5use ra_db::mock::FileMap;
6 6
7use crate::{Analysis, AnalysisChange, AnalysisHost, FileId, FilePosition}; 7use crate::{Analysis, AnalysisChange, AnalysisHost, FileId, FilePosition, SourceRootId};
8 8
9/// Mock analysis is used in test to bootstrap an AnalysisHost/Analysis 9/// Mock analysis is used in test to bootstrap an AnalysisHost/Analysis
10/// from a set of in-memory files. 10/// from a set of in-memory files.
@@ -78,14 +78,16 @@ impl MockAnalysis {
78 pub fn analysis_host(self) -> AnalysisHost { 78 pub fn analysis_host(self) -> AnalysisHost {
79 let mut host = AnalysisHost::default(); 79 let mut host = AnalysisHost::default();
80 let mut file_map = FileMap::default(); 80 let mut file_map = FileMap::default();
81 let source_root = SourceRootId(0);
81 let mut change = AnalysisChange::new(); 82 let mut change = AnalysisChange::new();
83 change.add_root(source_root, true);
82 for (path, contents) in self.files.into_iter() { 84 for (path, contents) in self.files.into_iter() {
83 assert!(path.starts_with('/')); 85 assert!(path.starts_with('/'));
84 let path = RelativePathBuf::from_path(&path[1..]).unwrap(); 86 let path = RelativePathBuf::from_path(&path[1..]).unwrap();
85 let file_id = file_map.add(path); 87 let file_id = file_map.add(path.clone());
86 change.add_file(file_id, contents); 88 change.add_file(source_root, file_id, path, Arc::new(contents));
87 } 89 }
88 change.set_file_resolver(Arc::new(file_map)); 90 // change.set_file_resolver(Arc::new(file_map));
89 host.apply_change(change); 91 host.apply_change(change);
90 host 92 host
91 } 93 }
diff --git a/crates/ra_db/src/file_resolver.rs b/crates/ra_db/src/file_resolver.rs
deleted file mode 100644
index f849ac752..000000000
--- a/crates/ra_db/src/file_resolver.rs
+++ /dev/null
@@ -1,76 +0,0 @@
1use std::{
2 sync::Arc,
3 hash::{Hash, Hasher},
4 fmt,
5};
6
7use relative_path::RelativePath;
8
9use crate::input::FileId;
10
11pub trait FileResolver: fmt::Debug + Send + Sync + 'static {
12 fn file_stem(&self, file_id: FileId) -> String;
13 fn resolve(&self, file_id: FileId, path: &RelativePath) -> Option<FileId>;
14 fn debug_path(&self, _1file_id: FileId) -> Option<std::path::PathBuf> {
15 None
16 }
17}
18
19#[derive(Clone, Debug)]
20pub struct FileResolverImp {
21 inner: Arc<FileResolver>,
22}
23
24impl PartialEq for FileResolverImp {
25 fn eq(&self, other: &FileResolverImp) -> bool {
26 self.inner() == other.inner()
27 }
28}
29
30impl Eq for FileResolverImp {}
31
32impl Hash for FileResolverImp {
33 fn hash<H: Hasher>(&self, hasher: &mut H) {
34 self.inner().hash(hasher);
35 }
36}
37
38impl FileResolverImp {
39 pub fn new(inner: Arc<FileResolver>) -> FileResolverImp {
40 FileResolverImp { inner }
41 }
42 pub fn file_stem(&self, file_id: FileId) -> String {
43 self.inner.file_stem(file_id)
44 }
45 pub fn resolve(&self, file_id: FileId, path: &RelativePath) -> Option<FileId> {
46 self.inner.resolve(file_id, path)
47 }
48 pub fn debug_path(&self, file_id: FileId) -> Option<std::path::PathBuf> {
49 self.inner.debug_path(file_id)
50 }
51 fn inner(&self) -> *const FileResolver {
52 &*self.inner
53 }
54}
55
56impl Default for FileResolverImp {
57 fn default() -> FileResolverImp {
58 #[derive(Debug)]
59 struct DummyResolver;
60 impl FileResolver for DummyResolver {
61 fn file_stem(&self, _file_: FileId) -> String {
62 panic!("file resolver not set")
63 }
64 fn resolve(
65 &self,
66 _file_id: FileId,
67 _path: &::relative_path::RelativePath,
68 ) -> Option<FileId> {
69 panic!("file resolver not set")
70 }
71 }
72 FileResolverImp {
73 inner: Arc::new(DummyResolver),
74 }
75 }
76}
diff --git a/crates/ra_db/src/input.rs b/crates/ra_db/src/input.rs
index ac144b991..cccf37cc2 100644
--- a/crates/ra_db/src/input.rs
+++ b/crates/ra_db/src/input.rs
@@ -1,10 +1,12 @@
1use std::sync::Arc; 1use std::sync::Arc;
2 2
3use rustc_hash::{FxHashSet, FxHashMap}; 3use rustc_hash::{FxHashMap};
4use relative_path::RelativePathBuf;
4use ra_syntax::SmolStr; 5use ra_syntax::SmolStr;
5use salsa; 6use salsa;
6 7
7use crate::file_resolver::FileResolverImp; 8#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
9pub struct SourceRootId(pub u32);
8 10
9#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] 11#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
10pub struct FileId(pub u32); 12pub struct FileId(pub u32);
@@ -85,6 +87,11 @@ salsa::query_group! {
85 type FileTextQuery; 87 type FileTextQuery;
86 storage input; 88 storage input;
87 } 89 }
90 /// Path to a file, relative to the root of its source root.
91 fn file_relative_path(file_id: FileId) -> RelativePathBuf {
92 type FileRelativePathQuery;
93 storage input;
94 }
88 fn file_source_root(file_id: FileId) -> SourceRootId { 95 fn file_source_root(file_id: FileId) -> SourceRootId {
89 type FileSourceRootQuery; 96 type FileSourceRootQuery;
90 storage input; 97 storage input;
@@ -93,8 +100,12 @@ salsa::query_group! {
93 type SourceRootQuery; 100 type SourceRootQuery;
94 storage input; 101 storage input;
95 } 102 }
96 fn libraries() -> Arc<Vec<SourceRootId>> { 103 fn local_roots() -> Arc<Vec<SourceRootId>> {
97 type LibrariesQuery; 104 type LocalRootsQuery;
105 storage input;
106 }
107 fn library_roots() -> Arc<Vec<SourceRootId>> {
108 type LibraryRootsQuery;
98 storage input; 109 storage input;
99 } 110 }
100 fn crate_graph() -> Arc<CrateGraph> { 111 fn crate_graph() -> Arc<CrateGraph> {
@@ -104,13 +115,7 @@ salsa::query_group! {
104 } 115 }
105} 116}
106 117
107#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
108pub struct SourceRootId(pub u32);
109
110#[derive(Default, Clone, Debug, PartialEq, Eq)] 118#[derive(Default, Clone, Debug, PartialEq, Eq)]
111pub struct SourceRoot { 119pub struct SourceRoot {
112 pub file_resolver: FileResolverImp, 120 pub files: FxHashMap<RelativePathBuf, FileId>,
113 pub files: FxHashSet<FileId>,
114} 121}
115
116pub const WORKSPACE: SourceRootId = SourceRootId(0);
diff --git a/crates/ra_db/src/lib.rs b/crates/ra_db/src/lib.rs
index 53805aada..65fa3cbfa 100644
--- a/crates/ra_db/src/lib.rs
+++ b/crates/ra_db/src/lib.rs
@@ -1,6 +1,5 @@
1//! ra_db defines basic database traits. Concrete DB is defined by ra_analysis. 1//! ra_db defines basic database traits. Concrete DB is defined by ra_analysis.
2mod syntax_ptr; 2mod syntax_ptr;
3mod file_resolver;
4mod input; 3mod input;
5mod loc2id; 4mod loc2id;
6pub mod mock; 5pub mod mock;
@@ -24,10 +23,10 @@ impl std::error::Error for Canceled {}
24 23
25pub use crate::{ 24pub use crate::{
26 syntax_ptr::LocalSyntaxPtr, 25 syntax_ptr::LocalSyntaxPtr,
27 file_resolver::{FileResolver, FileResolverImp},
28 input::{ 26 input::{
29 FilesDatabase, FileId, CrateId, SourceRoot, SourceRootId, CrateGraph, WORKSPACE, 27 FilesDatabase, FileId, CrateId, SourceRoot, SourceRootId, CrateGraph,
30 FileTextQuery, FileSourceRootQuery, SourceRootQuery, LibrariesQuery, CrateGraphQuery, 28 FileTextQuery, FileSourceRootQuery, SourceRootQuery, LocalRootsQuery, LibraryRootsQuery, CrateGraphQuery,
29 FileRelativePathQuery
31 }, 30 },
32 loc2id::{LocationIntener, NumericId}, 31 loc2id::{LocationIntener, NumericId},
33}; 32};
diff --git a/crates/ra_db/src/mock.rs b/crates/ra_db/src/mock.rs
index 2f7551597..5e185062b 100644
--- a/crates/ra_db/src/mock.rs
+++ b/crates/ra_db/src/mock.rs
@@ -1,9 +1,7 @@
1use std::sync::Arc;
2
3use rustc_hash::FxHashSet; 1use rustc_hash::FxHashSet;
4use relative_path::{RelativePath, RelativePathBuf}; 2use relative_path::{RelativePath, RelativePathBuf};
5 3
6use crate::{FileId, FileResolver, SourceRoot, FileResolverImp}; 4use crate::{FileId};
7 5
8#[derive(Default, Debug, Clone)] 6#[derive(Default, Debug, Clone)]
9pub struct FileMap(Vec<(FileId, RelativePathBuf)>); 7pub struct FileMap(Vec<(FileId, RelativePathBuf)>);
@@ -15,15 +13,6 @@ impl FileMap {
15 file_id 13 file_id
16 } 14 }
17 15
18 pub fn into_source_root(self) -> SourceRoot {
19 let files = self.files();
20 let file_resolver = FileResolverImp::new(Arc::new(self));
21 SourceRoot {
22 file_resolver,
23 files,
24 }
25 }
26
27 pub fn files(&self) -> FxHashSet<FileId> { 16 pub fn files(&self) -> FxHashSet<FileId> {
28 self.iter().map(|(id, _)| id).collect() 17 self.iter().map(|(id, _)| id).collect()
29 } 18 }
@@ -38,19 +27,4 @@ impl FileMap {
38 .iter() 27 .iter()
39 .map(|(id, path)| (*id, path.as_relative_path())) 28 .map(|(id, path)| (*id, path.as_relative_path()))
40 } 29 }
41
42 fn path(&self, id: FileId) -> &RelativePath {
43 self.iter().find(|&(it, _)| it == id).unwrap().1
44 }
45}
46
47impl FileResolver for FileMap {
48 fn file_stem(&self, id: FileId) -> String {
49 self.path(id).file_stem().unwrap().to_string()
50 }
51 fn resolve(&self, id: FileId, rel: &RelativePath) -> Option<FileId> {
52 let path = self.path(id).join(rel).normalize();
53 let id = self.iter().find(|&(_, p)| path == p)?.0;
54 Some(id)
55 }
56} 30}
diff --git a/crates/ra_hir/Cargo.toml b/crates/ra_hir/Cargo.toml
index 1b9e148b2..61650cee9 100644
--- a/crates/ra_hir/Cargo.toml
+++ b/crates/ra_hir/Cargo.toml
@@ -5,6 +5,7 @@ version = "0.1.0"
5authors = ["Aleksey Kladov <[email protected]>"] 5authors = ["Aleksey Kladov <[email protected]>"]
6 6
7[dependencies] 7[dependencies]
8arrayvec = "0.4.9"
8log = "0.4.5" 9log = "0.4.5"
9relative-path = "0.4.0" 10relative-path = "0.4.0"
10salsa = "0.8.0" 11salsa = "0.8.0"
diff --git a/crates/ra_hir/src/mock.rs b/crates/ra_hir/src/mock.rs
index b7193c4f3..9423e6571 100644
--- a/crates/ra_hir/src/mock.rs
+++ b/crates/ra_hir/src/mock.rs
@@ -2,12 +2,14 @@ use std::sync::Arc;
2 2
3use parking_lot::Mutex; 3use parking_lot::Mutex;
4use salsa::{self, Database}; 4use salsa::{self, Database};
5use ra_db::{LocationIntener, BaseDatabase, FilePosition, mock::FileMap, FileId, WORKSPACE, CrateGraph}; 5use ra_db::{LocationIntener, BaseDatabase, FilePosition, FileId, CrateGraph, SourceRoot, SourceRootId};
6use relative_path::RelativePathBuf; 6use relative_path::RelativePathBuf;
7use test_utils::{parse_fixture, CURSOR_MARKER, extract_offset}; 7use test_utils::{parse_fixture, CURSOR_MARKER, extract_offset};
8 8
9use crate::{db, DefId, DefLoc}; 9use crate::{db, DefId, DefLoc};
10 10
11const WORKSPACE: SourceRootId = SourceRootId(0);
12
11#[derive(Debug)] 13#[derive(Debug)]
12pub(crate) struct MockDatabase { 14pub(crate) struct MockDatabase {
13 events: Mutex<Option<Vec<salsa::Event<MockDatabase>>>>, 15 events: Mutex<Option<Vec<salsa::Event<MockDatabase>>>>,
@@ -16,10 +18,10 @@ pub(crate) struct MockDatabase {
16} 18}
17 19
18impl MockDatabase { 20impl MockDatabase {
19 pub(crate) fn with_files(fixture: &str) -> (MockDatabase, FileMap) { 21 pub(crate) fn with_files(fixture: &str) -> (MockDatabase, SourceRoot) {
20 let (db, file_map, position) = MockDatabase::from_fixture(fixture); 22 let (db, source_root, position) = MockDatabase::from_fixture(fixture);
21 assert!(position.is_none()); 23 assert!(position.is_none());
22 (db, file_map) 24 (db, source_root)
23 } 25 }
24 26
25 pub(crate) fn with_position(fixture: &str) -> (MockDatabase, FilePosition) { 27 pub(crate) fn with_position(fixture: &str) -> (MockDatabase, FilePosition) {
@@ -33,48 +35,50 @@ impl MockDatabase {
33 .set((), Arc::new(crate_graph)); 35 .set((), Arc::new(crate_graph));
34 } 36 }
35 37
36 fn from_fixture(fixture: &str) -> (MockDatabase, FileMap, Option<FilePosition>) { 38 fn from_fixture(fixture: &str) -> (MockDatabase, SourceRoot, Option<FilePosition>) {
37 let mut db = MockDatabase::default(); 39 let mut db = MockDatabase::default();
38 40
39 let mut position = None; 41 let mut position = None;
40 let mut file_map = FileMap::default(); 42 let mut source_root = SourceRoot::default();
41 for entry in parse_fixture(fixture) { 43 for entry in parse_fixture(fixture) {
42 if entry.text.contains(CURSOR_MARKER) { 44 if entry.text.contains(CURSOR_MARKER) {
43 assert!( 45 assert!(
44 position.is_none(), 46 position.is_none(),
45 "only one marker (<|>) per fixture is allowed" 47 "only one marker (<|>) per fixture is allowed"
46 ); 48 );
47 position = Some(db.add_file_with_position(&mut file_map, &entry.meta, &entry.text)); 49 position =
50 Some(db.add_file_with_position(&mut source_root, &entry.meta, &entry.text));
48 } else { 51 } else {
49 db.add_file(&mut file_map, &entry.meta, &entry.text); 52 db.add_file(&mut source_root, &entry.meta, &entry.text);
50 } 53 }
51 } 54 }
52 let source_root = file_map.clone().into_source_root();
53 db.query_mut(ra_db::SourceRootQuery) 55 db.query_mut(ra_db::SourceRootQuery)
54 .set(WORKSPACE, Arc::new(source_root)); 56 .set(WORKSPACE, Arc::new(source_root.clone()));
55 (db, file_map, position) 57 (db, source_root, position)
56 } 58 }
57 59
58 fn add_file(&mut self, file_map: &mut FileMap, path: &str, text: &str) -> FileId { 60 fn add_file(&mut self, source_root: &mut SourceRoot, path: &str, text: &str) -> FileId {
59 assert!(path.starts_with('/')); 61 assert!(path.starts_with('/'));
60 let path = RelativePathBuf::from_path(&path[1..]).unwrap(); 62 let path = RelativePathBuf::from_path(&path[1..]).unwrap();
61 63 let file_id = FileId(source_root.files.len() as u32);
62 let file_id = file_map.add(path);
63 let text = Arc::new(text.to_string()); 64 let text = Arc::new(text.to_string());
64 self.query_mut(ra_db::FileTextQuery).set(file_id, text); 65 self.query_mut(ra_db::FileTextQuery).set(file_id, text);
66 self.query_mut(ra_db::FileRelativePathQuery)
67 .set(file_id, path.clone());
65 self.query_mut(ra_db::FileSourceRootQuery) 68 self.query_mut(ra_db::FileSourceRootQuery)
66 .set(file_id, WORKSPACE); 69 .set(file_id, WORKSPACE);
70 source_root.files.insert(path, file_id);
67 file_id 71 file_id
68 } 72 }
69 73
70 fn add_file_with_position( 74 fn add_file_with_position(
71 &mut self, 75 &mut self,
72 file_map: &mut FileMap, 76 source_root: &mut SourceRoot,
73 path: &str, 77 path: &str,
74 text: &str, 78 text: &str,
75 ) -> FilePosition { 79 ) -> FilePosition {
76 let (offset, text) = extract_offset(text); 80 let (offset, text) = extract_offset(text);
77 let file_id = self.add_file(file_map, path, &text); 81 let file_id = self.add_file(source_root, path, &text);
78 FilePosition { file_id, offset } 82 FilePosition { file_id, offset }
79 } 83 }
80} 84}
@@ -104,11 +108,11 @@ impl Default for MockDatabase {
104 runtime: salsa::Runtime::default(), 108 runtime: salsa::Runtime::default(),
105 id_maps: Default::default(), 109 id_maps: Default::default(),
106 }; 110 };
107 db.query_mut(ra_db::SourceRootQuery)
108 .set(ra_db::WORKSPACE, Default::default());
109 db.query_mut(ra_db::CrateGraphQuery) 111 db.query_mut(ra_db::CrateGraphQuery)
110 .set((), Default::default()); 112 .set((), Default::default());
111 db.query_mut(ra_db::LibrariesQuery) 113 db.query_mut(ra_db::LocalRootsQuery)
114 .set((), Default::default());
115 db.query_mut(ra_db::LibraryRootsQuery)
112 .set((), Default::default()); 116 .set((), Default::default());
113 db 117 db
114 } 118 }
@@ -158,9 +162,11 @@ salsa::database_storage! {
158 pub(crate) struct MockDatabaseStorage for MockDatabase { 162 pub(crate) struct MockDatabaseStorage for MockDatabase {
159 impl ra_db::FilesDatabase { 163 impl ra_db::FilesDatabase {
160 fn file_text() for ra_db::FileTextQuery; 164 fn file_text() for ra_db::FileTextQuery;
165 fn file_relative_path() for ra_db::FileRelativePathQuery;
161 fn file_source_root() for ra_db::FileSourceRootQuery; 166 fn file_source_root() for ra_db::FileSourceRootQuery;
162 fn source_root() for ra_db::SourceRootQuery; 167 fn source_root() for ra_db::SourceRootQuery;
163 fn libraries() for ra_db::LibrariesQuery; 168 fn local_roots() for ra_db::LocalRootsQuery;
169 fn library_roots() for ra_db::LibraryRootsQuery;
164 fn crate_graph() for ra_db::CrateGraphQuery; 170 fn crate_graph() for ra_db::CrateGraphQuery;
165 } 171 }
166 impl ra_db::SyntaxDatabase { 172 impl ra_db::SyntaxDatabase {
diff --git a/crates/ra_hir/src/module/imp.rs b/crates/ra_hir/src/module/imp.rs
index 4a19842c4..f3a346152 100644
--- a/crates/ra_hir/src/module/imp.rs
+++ b/crates/ra_hir/src/module/imp.rs
@@ -4,9 +4,10 @@ use ra_syntax::{
4 ast::{self, NameOwner}, 4 ast::{self, NameOwner},
5 SmolStr, 5 SmolStr,
6}; 6};
7use relative_path::RelativePathBuf; 7use relative_path::{RelativePathBuf, RelativePath};
8use rustc_hash::{FxHashMap, FxHashSet}; 8use rustc_hash::{FxHashMap, FxHashSet};
9use ra_db::{SourceRoot, SourceRootId, FileResolverImp, Cancelable, FileId,}; 9use arrayvec::ArrayVec;
10use ra_db::{SourceRoot, SourceRootId, Cancelable, FileId};
10 11
11use crate::{ 12use crate::{
12 HirDatabase, 13 HirDatabase,
@@ -65,7 +66,7 @@ fn create_module_tree<'a>(
65 let mut visited = FxHashSet::default(); 66 let mut visited = FxHashSet::default();
66 67
67 let source_root = db.source_root(source_root); 68 let source_root = db.source_root(source_root);
68 for &file_id in source_root.files.iter() { 69 for &file_id in source_root.files.values() {
69 let source = ModuleSource::new_file(file_id); 70 let source = ModuleSource::new_file(file_id);
70 if visited.contains(&source) { 71 if visited.contains(&source) {
71 continue; // TODO: use explicit crate_roots here 72 continue; // TODO: use explicit crate_roots here
@@ -110,8 +111,7 @@ fn build_subtree(
110 111
111 let (points_to, problem) = match sub { 112 let (points_to, problem) = match sub {
112 Submodule::Declaration(name) => { 113 Submodule::Declaration(name) => {
113 let (points_to, problem) = 114 let (points_to, problem) = resolve_submodule(db, source, &name);
114 resolve_submodule(source, &name, &source_root.file_resolver);
115 let points_to = points_to 115 let points_to = points_to
116 .into_iter() 116 .into_iter()
117 .map(|file_id| match roots.remove(&file_id) { 117 .map(|file_id| match roots.remove(&file_id) {
@@ -153,34 +153,42 @@ fn build_subtree(
153} 153}
154 154
155fn resolve_submodule( 155fn resolve_submodule(
156 db: &impl HirDatabase,
156 source: ModuleSource, 157 source: ModuleSource,
157 name: &SmolStr, 158 name: &SmolStr,
158 file_resolver: &FileResolverImp,
159) -> (Vec<FileId>, Option<Problem>) { 159) -> (Vec<FileId>, Option<Problem>) {
160 // TODO: handle submodules of inline modules properly 160 // FIXME: handle submodules of inline modules properly
161 let file_id = source.file_id(); 161 let file_id = source.file_id();
162 let mod_name = file_resolver.file_stem(file_id); 162 let source_root_id = db.file_source_root(file_id);
163 let path = db.file_relative_path(file_id);
164 let root = RelativePathBuf::default();
165 let dir_path = path.parent().unwrap_or(&root);
166 let mod_name = path.file_stem().unwrap_or("unknown");
163 let is_dir_owner = mod_name == "mod" || mod_name == "lib" || mod_name == "main"; 167 let is_dir_owner = mod_name == "mod" || mod_name == "lib" || mod_name == "main";
164 168
165 let file_mod = RelativePathBuf::from(format!("../{}.rs", name)); 169 let file_mod = dir_path.join(format!("{}.rs", name));
166 let dir_mod = RelativePathBuf::from(format!("../{}/mod.rs", name)); 170 let dir_mod = dir_path.join(format!("{}/mod.rs", name));
167 let file_dir_mod = RelativePathBuf::from(format!("../{}/{}.rs", mod_name, name)); 171 let file_dir_mod = dir_path.join(format!("{}/{}.rs", mod_name, name));
168 let tmp1; 172 let mut candidates = ArrayVec::<[_; 2]>::new();
169 let tmp2; 173 if is_dir_owner {
170 let candidates = if is_dir_owner { 174 candidates.push(file_mod.clone());
171 tmp1 = [&file_mod, &dir_mod]; 175 candidates.push(dir_mod);
172 tmp1.iter()
173 } else { 176 } else {
174 tmp2 = [&file_dir_mod]; 177 candidates.push(file_dir_mod.clone());
175 tmp2.iter()
176 }; 178 };
177 179 let sr = db.source_root(source_root_id);
178 let points_to = candidates 180 let points_to = candidates
179 .filter_map(|path| file_resolver.resolve(file_id, path)) 181 .into_iter()
182 .filter_map(|path| sr.files.get(&path))
183 .map(|&it| it)
180 .collect::<Vec<_>>(); 184 .collect::<Vec<_>>();
181 let problem = if points_to.is_empty() { 185 let problem = if points_to.is_empty() {
182 Some(Problem::UnresolvedModule { 186 Some(Problem::UnresolvedModule {
183 candidate: if is_dir_owner { file_mod } else { file_dir_mod }, 187 candidate: RelativePath::new("../").join(&if is_dir_owner {
188 file_mod
189 } else {
190 file_dir_mod
191 }),
184 }) 192 })
185 } else { 193 } else {
186 None 194 None
diff --git a/crates/ra_hir/src/module/nameres.rs b/crates/ra_hir/src/module/nameres.rs
index 5540b827f..f44abc730 100644
--- a/crates/ra_hir/src/module/nameres.rs
+++ b/crates/ra_hir/src/module/nameres.rs
@@ -32,11 +32,12 @@ use crate::{
32 SourceItemId, SourceFileItemId, SourceFileItems, 32 SourceItemId, SourceFileItemId, SourceFileItems,
33 Path, PathKind, 33 Path, PathKind,
34 HirDatabase, Crate, 34 HirDatabase, Crate,
35 module::{ModuleId, ModuleTree}, 35 module::{Module, ModuleId, ModuleTree},
36}; 36};
37 37
38/// Item map is the result of the name resolution. Item map contains, for each 38/// Item map is the result of the name resolution. Item map contains, for each
39/// module, the set of visible items. 39/// module, the set of visible items.
40// FIXME: currenty we compute item map per source-root. We should do it per crate instead.
40#[derive(Default, Debug, PartialEq, Eq)] 41#[derive(Default, Debug, PartialEq, Eq)]
41pub struct ItemMap { 42pub struct ItemMap {
42 pub per_module: FxHashMap<ModuleId, ModuleScope>, 43 pub per_module: FxHashMap<ModuleId, ModuleScope>,
@@ -252,7 +253,8 @@ where
252 let krate = Crate::new(crate_id); 253 let krate = Crate::new(crate_id);
253 for dep in krate.dependencies(self.db) { 254 for dep in krate.dependencies(self.db) {
254 if let Some(module) = dep.krate.root_module(self.db)? { 255 if let Some(module) = dep.krate.root_module(self.db)? {
255 self.add_module_item(&mut module_items, dep.name, module.module_id); 256 let def_id = module.def_id(self.db);
257 self.add_module_item(&mut module_items, dep.name, def_id);
256 } 258 }
257 } 259 }
258 }; 260 };
@@ -294,21 +296,21 @@ where
294 296
295 // Populate modules 297 // Populate modules
296 for (name, module_id) in module_id.children(&self.module_tree) { 298 for (name, module_id) in module_id.children(&self.module_tree) {
297 self.add_module_item(&mut module_items, name, module_id); 299 let def_loc = DefLoc {
300 kind: DefKind::Module,
301 source_root_id: self.source_root,
302 module_id,
303 source_item_id: module_id.source(&self.module_tree).0,
304 };
305 let def_id = def_loc.id(self.db);
306 self.add_module_item(&mut module_items, name, def_id);
298 } 307 }
299 308
300 self.result.per_module.insert(module_id, module_items); 309 self.result.per_module.insert(module_id, module_items);
301 Ok(()) 310 Ok(())
302 } 311 }
303 312
304 fn add_module_item(&self, module_items: &mut ModuleScope, name: SmolStr, module_id: ModuleId) { 313 fn add_module_item(&self, module_items: &mut ModuleScope, name: SmolStr, def_id: DefId) {
305 let def_loc = DefLoc {
306 kind: DefKind::Module,
307 source_root_id: self.source_root,
308 module_id,
309 source_item_id: module_id.source(&self.module_tree).0,
310 };
311 let def_id = def_loc.id(self.db);
312 let resolution = Resolution { 314 let resolution = Resolution {
313 def_id: Some(def_id), 315 def_id: Some(def_id),
314 import: None, 316 import: None,
@@ -329,7 +331,7 @@ where
329 ImportKind::Named(ptr) => ptr, 331 ImportKind::Named(ptr) => ptr,
330 }; 332 };
331 333
332 let mut curr = match import.path.kind { 334 let mut curr: ModuleId = match import.path.kind {
333 PathKind::Plain | PathKind::Self_ => module_id, 335 PathKind::Plain | PathKind::Self_ => module_id,
334 PathKind::Super => { 336 PathKind::Super => {
335 match module_id.parent(&self.module_tree) { 337 match module_id.parent(&self.module_tree) {
@@ -356,9 +358,30 @@ where
356 curr = match def_id.loc(self.db) { 358 curr = match def_id.loc(self.db) {
357 DefLoc { 359 DefLoc {
358 kind: DefKind::Module, 360 kind: DefKind::Module,
359 module_id, 361 module_id: target_module_id,
362 source_root_id,
360 .. 363 ..
361 } => module_id, 364 } => {
365 if source_root_id == self.source_root {
366 target_module_id
367 } else {
368 let module = Module::new(self.db, source_root_id, target_module_id)?;
369 let path = Path {
370 segments: import.path.segments[i + 1..].iter().cloned().collect(),
371 kind: PathKind::Crate,
372 };
373 if let Some(def_id) = module.resolve_path(self.db, path)? {
374 self.update(module_id, |items| {
375 let res = Resolution {
376 def_id: Some(def_id),
377 import: Some(ptr),
378 };
379 items.items.insert(name.clone(), res);
380 })
381 }
382 return Ok(());
383 }
384 }
362 _ => return Ok(()), 385 _ => return Ok(()),
363 } 386 }
364 } else { 387 } else {
diff --git a/crates/ra_hir/src/module/nameres/tests.rs b/crates/ra_hir/src/module/nameres/tests.rs
index 9ddc32dcd..9fa9146e3 100644
--- a/crates/ra_hir/src/module/nameres/tests.rs
+++ b/crates/ra_hir/src/module/nameres/tests.rs
@@ -3,6 +3,7 @@ use std::sync::Arc;
3use salsa::Database; 3use salsa::Database;
4use ra_db::{FilesDatabase, CrateGraph}; 4use ra_db::{FilesDatabase, CrateGraph};
5use ra_syntax::SmolStr; 5use ra_syntax::SmolStr;
6use relative_path::RelativePath;
6 7
7use crate::{ 8use crate::{
8 self as hir, 9 self as hir,
@@ -44,7 +45,7 @@ fn item_map_smoke_test() {
44 45
45#[test] 46#[test]
46fn item_map_across_crates() { 47fn item_map_across_crates() {
47 let (mut db, files) = MockDatabase::with_files( 48 let (mut db, sr) = MockDatabase::with_files(
48 " 49 "
49 //- /main.rs 50 //- /main.rs
50 use test_crate::Baz; 51 use test_crate::Baz;
@@ -53,8 +54,8 @@ fn item_map_across_crates() {
53 pub struct Baz; 54 pub struct Baz;
54 ", 55 ",
55 ); 56 );
56 let main_id = files.file_id("/main.rs"); 57 let main_id = sr.files[RelativePath::new("/main.rs")];
57 let lib_id = files.file_id("/lib.rs"); 58 let lib_id = sr.files[RelativePath::new("/lib.rs")];
58 59
59 let mut crate_graph = CrateGraph::default(); 60 let mut crate_graph = CrateGraph::default();
60 let main_crate = crate_graph.add_crate_root(main_id); 61 let main_crate = crate_graph.add_crate_root(main_id);
diff --git a/crates/ra_lsp_server/Cargo.toml b/crates/ra_lsp_server/Cargo.toml
index ce4f79d46..fc10096e5 100644
--- a/crates/ra_lsp_server/Cargo.toml
+++ b/crates/ra_lsp_server/Cargo.toml
@@ -19,12 +19,13 @@ flexi_logger = "0.10.0"
19log = "0.4.3" 19log = "0.4.3"
20url_serde = "0.2.0" 20url_serde = "0.2.0"
21languageserver-types = "0.53.0" 21languageserver-types = "0.53.0"
22walkdir = "2.2.0" 22walkdir = "2.2.7"
23im = "12.0.0" 23im = "12.0.0"
24cargo_metadata = "0.6.0" 24cargo_metadata = "0.6.0"
25text_unit = { version = "0.1.2", features = ["serde"] } 25text_unit = { version = "0.1.2", features = ["serde"] }
26smol_str = { version = "0.1.5", features = ["serde"] } 26smol_str = { version = "0.1.5", features = ["serde"] }
27rustc-hash = "1.0" 27rustc-hash = "1.0"
28parking_lot = "0.7.0"
28 29
29thread_worker = { path = "../thread_worker" } 30thread_worker = { path = "../thread_worker" }
30ra_syntax = { path = "../ra_syntax" } 31ra_syntax = { path = "../ra_syntax" }
@@ -32,6 +33,7 @@ ra_editor = { path = "../ra_editor" }
32ra_text_edit = { path = "../ra_text_edit" } 33ra_text_edit = { path = "../ra_text_edit" }
33ra_analysis = { path = "../ra_analysis" } 34ra_analysis = { path = "../ra_analysis" }
34gen_lsp_server = { path = "../gen_lsp_server" } 35gen_lsp_server = { path = "../gen_lsp_server" }
36ra_vfs = { path = "../ra_vfs" }
35 37
36[dev-dependencies] 38[dev-dependencies]
37tempdir = "0.3.7" 39tempdir = "0.3.7"
diff --git a/crates/ra_lsp_server/src/lib.rs b/crates/ra_lsp_server/src/lib.rs
index 1d7258c35..725b1258a 100644
--- a/crates/ra_lsp_server/src/lib.rs
+++ b/crates/ra_lsp_server/src/lib.rs
@@ -1,11 +1,9 @@
1mod caps; 1mod caps;
2mod conv; 2mod conv;
3mod main_loop; 3mod main_loop;
4mod path_map;
5mod project_model; 4mod project_model;
6pub mod req; 5pub mod req;
7mod server_world; 6mod server_world;
8mod vfs;
9 7
10pub type Result<T> = ::std::result::Result<T, ::failure::Error>; 8pub type Result<T> = ::std::result::Result<T, ::failure::Error>;
11pub use crate::{caps::server_capabilities, main_loop::main_loop, main_loop::LspError}; 9pub use crate::{caps::server_capabilities, main_loop::main_loop, main_loop::LspError};
diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs
index eab82ee85..d2f16ea97 100644
--- a/crates/ra_lsp_server/src/main_loop.rs
+++ b/crates/ra_lsp_server/src/main_loop.rs
@@ -1,7 +1,10 @@
1mod handlers; 1mod handlers;
2mod subscriptions; 2mod subscriptions;
3 3
4use std::path::PathBuf; 4use std::{
5 path::PathBuf,
6 sync::Arc,
7};
5 8
6use crossbeam_channel::{unbounded, select, Receiver, Sender}; 9use crossbeam_channel::{unbounded, select, Receiver, Sender};
7use gen_lsp_server::{ 10use gen_lsp_server::{
@@ -9,8 +12,8 @@ use gen_lsp_server::{
9}; 12};
10use languageserver_types::NumberOrString; 13use languageserver_types::NumberOrString;
11use ra_analysis::{Canceled, FileId, LibraryData}; 14use ra_analysis::{Canceled, FileId, LibraryData};
15use ra_vfs::{VfsTask};
12use rayon; 16use rayon;
13use thread_worker::Worker;
14use threadpool::ThreadPool; 17use threadpool::ThreadPool;
15use rustc_hash::FxHashSet; 18use rustc_hash::FxHashSet;
16use serde::{de::DeserializeOwned, Serialize}; 19use serde::{de::DeserializeOwned, Serialize};
@@ -19,10 +22,9 @@ use failure_derive::Fail;
19 22
20use crate::{ 23use crate::{
21 main_loop::subscriptions::Subscriptions, 24 main_loop::subscriptions::Subscriptions,
22 project_model::{workspace_loader, CargoWorkspace}, 25 project_model::{workspace_loader},
23 req, 26 req,
24 server_world::{ServerWorld, ServerWorldState}, 27 server_world::{ServerWorld, ServerWorldState},
25 vfs::{self, FileEvent},
26 Result, 28 Result,
27}; 29};
28 30
@@ -50,32 +52,42 @@ enum Task {
50 52
51pub fn main_loop( 53pub fn main_loop(
52 internal_mode: bool, 54 internal_mode: bool,
53 root: PathBuf, 55 ws_root: PathBuf,
54 publish_decorations: bool, 56 publish_decorations: bool,
55 msg_receiver: &Receiver<RawMessage>, 57 msg_receiver: &Receiver<RawMessage>,
56 msg_sender: &Sender<RawMessage>, 58 msg_sender: &Sender<RawMessage>,
57) -> Result<()> { 59) -> Result<()> {
58 let pool = ThreadPool::new(8); 60 let pool = ThreadPool::new(8);
59 let (task_sender, task_receiver) = unbounded::<Task>(); 61 let (task_sender, task_receiver) = unbounded::<Task>();
60 let (fs_worker, fs_watcher) = vfs::roots_loader();
61 let (ws_worker, ws_watcher) = workspace_loader(); 62 let (ws_worker, ws_watcher) = workspace_loader();
62 63
64 ws_worker.send(ws_root.clone());
65 // FIXME: support dynamic workspace loading.
66 let workspaces = match ws_worker.recv().unwrap() {
67 Ok(ws) => vec![ws],
68 Err(e) => {
69 log::warn!("loading workspace failed: {}", e);
70 Vec::new()
71 }
72 };
73 ws_worker.shutdown();
74 ws_watcher
75 .shutdown()
76 .map_err(|_| format_err!("ws watcher died"))?;
77 let mut state = ServerWorldState::new(ws_root.clone(), workspaces);
78
63 log::info!("server initialized, serving requests"); 79 log::info!("server initialized, serving requests");
64 let mut state = ServerWorldState::default();
65 80
66 let mut pending_requests = FxHashSet::default(); 81 let mut pending_requests = FxHashSet::default();
67 let mut subs = Subscriptions::new(); 82 let mut subs = Subscriptions::new();
68 let main_res = main_loop_inner( 83 let main_res = main_loop_inner(
69 internal_mode, 84 internal_mode,
70 publish_decorations, 85 publish_decorations,
71 root,
72 &pool, 86 &pool,
73 msg_sender, 87 msg_sender,
74 msg_receiver, 88 msg_receiver,
75 task_sender, 89 task_sender,
76 task_receiver.clone(), 90 task_receiver.clone(),
77 fs_worker,
78 ws_worker,
79 &mut state, 91 &mut state,
80 &mut pending_requests, 92 &mut pending_requests,
81 &mut subs, 93 &mut subs,
@@ -88,12 +100,11 @@ pub fn main_loop(
88 drop(pool); 100 drop(pool);
89 log::info!("...threadpool has finished"); 101 log::info!("...threadpool has finished");
90 102
91 let fs_res = fs_watcher.stop(); 103 let vfs = Arc::try_unwrap(state.vfs).expect("all snapshots should be dead");
92 let ws_res = ws_watcher.stop(); 104 let vfs_res = vfs.into_inner().shutdown();
93 105
94 main_res?; 106 main_res?;
95 fs_res.map_err(|_| format_err!("fs watcher died"))?; 107 vfs_res.map_err(|_| format_err!("fs watcher died"))?;
96 ws_res.map_err(|_| format_err!("ws watcher died"))?;
97 108
98 Ok(()) 109 Ok(())
99} 110}
@@ -101,28 +112,22 @@ pub fn main_loop(
101fn main_loop_inner( 112fn main_loop_inner(
102 internal_mode: bool, 113 internal_mode: bool,
103 publish_decorations: bool, 114 publish_decorations: bool,
104 ws_root: PathBuf,
105 pool: &ThreadPool, 115 pool: &ThreadPool,
106 msg_sender: &Sender<RawMessage>, 116 msg_sender: &Sender<RawMessage>,
107 msg_receiver: &Receiver<RawMessage>, 117 msg_receiver: &Receiver<RawMessage>,
108 task_sender: Sender<Task>, 118 task_sender: Sender<Task>,
109 task_receiver: Receiver<Task>, 119 task_receiver: Receiver<Task>,
110 fs_worker: Worker<PathBuf, (PathBuf, Vec<FileEvent>)>,
111 ws_worker: Worker<PathBuf, Result<CargoWorkspace>>,
112 state: &mut ServerWorldState, 120 state: &mut ServerWorldState,
113 pending_requests: &mut FxHashSet<u64>, 121 pending_requests: &mut FxHashSet<u64>,
114 subs: &mut Subscriptions, 122 subs: &mut Subscriptions,
115) -> Result<()> { 123) -> Result<()> {
116 let (libdata_sender, libdata_receiver) = unbounded(); 124 let (libdata_sender, libdata_receiver) = unbounded();
117 ws_worker.send(ws_root.clone());
118 fs_worker.send(ws_root.clone());
119 loop { 125 loop {
120 #[derive(Debug)] 126 #[derive(Debug)]
121 enum Event { 127 enum Event {
122 Msg(RawMessage), 128 Msg(RawMessage),
123 Task(Task), 129 Task(Task),
124 Fs(PathBuf, Vec<FileEvent>), 130 Vfs(VfsTask),
125 Ws(Result<CargoWorkspace>),
126 Lib(LibraryData), 131 Lib(LibraryData),
127 } 132 }
128 log::trace!("selecting"); 133 log::trace!("selecting");
@@ -132,77 +137,20 @@ fn main_loop_inner(
132 None => bail!("client exited without shutdown"), 137 None => bail!("client exited without shutdown"),
133 }, 138 },
134 recv(task_receiver, task) => Event::Task(task.unwrap()), 139 recv(task_receiver, task) => Event::Task(task.unwrap()),
135 recv(fs_worker.out, events) => match events { 140 recv(state.vfs.read().task_receiver(), task) => match task {
136 None => bail!("roots watcher died"), 141 None => bail!("vfs died"),
137 Some((pb, events)) => Event::Fs(pb, events), 142 Some(task) => Event::Vfs(task),
138 }
139 recv(ws_worker.out, ws) => match ws {
140 None => bail!("workspace watcher died"),
141 Some(ws) => Event::Ws(ws),
142 } 143 }
143 recv(libdata_receiver, data) => Event::Lib(data.unwrap()) 144 recv(libdata_receiver, data) => Event::Lib(data.unwrap())
144 }; 145 };
146 log::info!("{:?}", event);
145 let mut state_changed = false; 147 let mut state_changed = false;
146 match event { 148 match event {
147 Event::Task(task) => on_task(task, msg_sender, pending_requests), 149 Event::Task(task) => on_task(task, msg_sender, pending_requests),
148 Event::Fs(root, events) => { 150 Event::Vfs(task) => {
149 log::info!("fs change, {}, {} events", root.display(), events.len()); 151 state.vfs.write().handle_task(task);
150 if root == ws_root {
151 state.apply_fs_changes(events);
152 } else {
153 let (files, resolver) = state.events_to_files(events);
154 let sender = libdata_sender.clone();
155 pool.execute(move || {
156 let start = ::std::time::Instant::now();
157 log::info!("indexing {} ... ", root.display());
158 let data = LibraryData::prepare(files, resolver);
159 log::info!("indexed {:?} {}", start.elapsed(), root.display());
160 sender.send(data);
161 });
162 }
163 state_changed = true; 152 state_changed = true;
164 } 153 }
165 Event::Ws(ws) => match ws {
166 Ok(ws) => {
167 let workspaces = vec![ws];
168 feedback(internal_mode, "workspace loaded", msg_sender);
169 for ws in workspaces.iter() {
170 // Add each library as constant input. If library is
171 // within the workspace, don't treat it as a library.
172 //
173 // HACK: If source roots are nested, pick the outer one.
174
175 let mut roots = ws
176 .packages()
177 .filter(|pkg| !pkg.is_member(ws))
178 .filter_map(|pkg| {
179 let root = pkg.root(ws).to_path_buf();
180 if root.starts_with(&ws_root) {
181 None
182 } else {
183 Some(root)
184 }
185 })
186 .collect::<Vec<_>>();
187 roots.sort_by_key(|it| it.as_os_str().len());
188 let unique = roots
189 .iter()
190 .enumerate()
191 .filter(|&(idx, long)| {
192 !roots[..idx].iter().any(|short| long.starts_with(short))
193 })
194 .map(|(_idx, root)| root);
195
196 for root in unique {
197 log::debug!("sending root, {}", root.display());
198 fs_worker.send(root.to_owned());
199 }
200 }
201 state.set_workspaces(workspaces);
202 state_changed = true;
203 }
204 Err(e) => log::warn!("loading workspace failed: {}", e),
205 },
206 Event::Lib(lib) => { 154 Event::Lib(lib) => {
207 feedback(internal_mode, "library loaded", msg_sender); 155 feedback(internal_mode, "library loaded", msg_sender);
208 state.add_lib(lib); 156 state.add_lib(lib);
@@ -234,6 +182,21 @@ fn main_loop_inner(
234 }, 182 },
235 }; 183 };
236 184
185 for lib in state.process_changes() {
186 let (root, files) = lib;
187 let sender = libdata_sender.clone();
188 pool.execute(move || {
189 let start = ::std::time::Instant::now();
190 log::info!("indexing {:?} ... ", root);
191 let data = LibraryData::prepare(root, files);
192 log::info!("indexed {:?} {:?}", start.elapsed(), root);
193 sender.send(data);
194 });
195 }
196 if state.roots_to_scan == 0 {
197 feedback(internal_mode, "workspace loaded", msg_sender);
198 }
199
237 if state_changed { 200 if state_changed {
238 update_file_notifications_on_threadpool( 201 update_file_notifications_on_threadpool(
239 pool, 202 pool,
@@ -336,8 +299,13 @@ fn on_notification(
336 let path = uri 299 let path = uri
337 .to_file_path() 300 .to_file_path()
338 .map_err(|()| format_err!("invalid uri: {}", uri))?; 301 .map_err(|()| format_err!("invalid uri: {}", uri))?;
339 let file_id = state.add_mem_file(path, params.text_document.text); 302 if let Some(file_id) = state
340 subs.add_sub(file_id); 303 .vfs
304 .write()
305 .add_file_overlay(&path, params.text_document.text)
306 {
307 subs.add_sub(FileId(file_id.0));
308 }
341 return Ok(()); 309 return Ok(());
342 } 310 }
343 Err(not) => not, 311 Err(not) => not,
@@ -353,7 +321,7 @@ fn on_notification(
353 .pop() 321 .pop()
354 .ok_or_else(|| format_err!("empty changes"))? 322 .ok_or_else(|| format_err!("empty changes"))?
355 .text; 323 .text;
356 state.change_mem_file(path.as_path(), text)?; 324 state.vfs.write().change_file_overlay(path.as_path(), text);
357 return Ok(()); 325 return Ok(());
358 } 326 }
359 Err(not) => not, 327 Err(not) => not,
@@ -364,8 +332,9 @@ fn on_notification(
364 let path = uri 332 let path = uri
365 .to_file_path() 333 .to_file_path()
366 .map_err(|()| format_err!("invalid uri: {}", uri))?; 334 .map_err(|()| format_err!("invalid uri: {}", uri))?;
367 let file_id = state.remove_mem_file(path.as_path())?; 335 if let Some(file_id) = state.vfs.write().remove_file_overlay(path.as_path()) {
368 subs.remove_sub(file_id); 336 subs.remove_sub(FileId(file_id.0));
337 }
369 let params = req::PublishDiagnosticsParams { 338 let params = req::PublishDiagnosticsParams {
370 uri, 339 uri,
371 diagnostics: Vec::new(), 340 diagnostics: Vec::new(),
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs
index acca480c7..572ae7fb5 100644
--- a/crates/ra_lsp_server/src/main_loop/handlers.rs
+++ b/crates/ra_lsp_server/src/main_loop/handlers.rs
@@ -326,9 +326,9 @@ pub fn handle_runnables(
326 None => return Ok(None), 326 None => return Ok(None),
327 }; 327 };
328 let file_id = world.analysis().crate_root(crate_id)?; 328 let file_id = world.analysis().crate_root(crate_id)?;
329 let path = world.path_map.get_path(file_id); 329 let path = world.vfs.read().file2path(ra_vfs::VfsFile(file_id.0));
330 let res = world.workspaces.iter().find_map(|ws| { 330 let res = world.workspaces.iter().find_map(|ws| {
331 let tgt = ws.target_by_root(path)?; 331 let tgt = ws.target_by_root(&path)?;
332 let res = CargoTargetSpec { 332 let res = CargoTargetSpec {
333 package: tgt.package(ws).name(ws).to_string(), 333 package: tgt.package(ws).name(ws).to_string(),
334 target: tgt.name(ws).to_string(), 334 target: tgt.name(ws).to_string(),
diff --git a/crates/ra_lsp_server/src/path_map.rs b/crates/ra_lsp_server/src/path_map.rs
deleted file mode 100644
index 02e54629c..000000000
--- a/crates/ra_lsp_server/src/path_map.rs
+++ /dev/null
@@ -1,126 +0,0 @@
1use std::{
2 fmt,
3 path::{Component, Path, PathBuf},
4};
5
6use im;
7use ra_analysis::{FileId, FileResolver};
8use relative_path::RelativePath;
9
10#[derive(Debug, Clone, Copy, PartialEq, Eq)]
11pub enum Root {
12 Workspace,
13 Lib,
14}
15
16#[derive(Default, Clone)]
17pub struct PathMap {
18 next_id: u32,
19 path2id: im::HashMap<PathBuf, FileId>,
20 id2path: im::HashMap<FileId, PathBuf>,
21 id2root: im::HashMap<FileId, Root>,
22}
23
24impl fmt::Debug for PathMap {
25 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
26 f.write_str("PathMap { ... }")
27 }
28}
29
30impl PathMap {
31 pub fn get_or_insert(&mut self, path: PathBuf, root: Root) -> (bool, FileId) {
32 let mut inserted = false;
33 let file_id = self
34 .path2id
35 .get(path.as_path())
36 .map(|&id| id)
37 .unwrap_or_else(|| {
38 inserted = true;
39 let id = self.new_file_id();
40 self.insert(path, id, root);
41 id
42 });
43 (inserted, file_id)
44 }
45 pub fn get_id(&self, path: &Path) -> Option<FileId> {
46 self.path2id.get(path).cloned()
47 }
48 pub fn get_path(&self, file_id: FileId) -> &Path {
49 self.id2path.get(&file_id).unwrap().as_path()
50 }
51 pub fn get_root(&self, file_id: FileId) -> Root {
52 self.id2root[&file_id]
53 }
54 fn insert(&mut self, path: PathBuf, file_id: FileId, root: Root) {
55 self.path2id.insert(path.clone(), file_id);
56 self.id2path.insert(file_id, path.clone());
57 self.id2root.insert(file_id, root);
58 }
59
60 fn new_file_id(&mut self) -> FileId {
61 let id = FileId(self.next_id);
62 self.next_id += 1;
63 id
64 }
65}
66
67impl FileResolver for PathMap {
68 fn file_stem(&self, file_id: FileId) -> String {
69 self.get_path(file_id)
70 .file_stem()
71 .unwrap()
72 .to_str()
73 .unwrap()
74 .to_string()
75 }
76
77 fn resolve(&self, file_id: FileId, path: &RelativePath) -> Option<FileId> {
78 let path = path.to_path(&self.get_path(file_id));
79 let path = normalize(&path);
80 self.get_id(&path)
81 }
82
83 fn debug_path(&self, file_id: FileId) -> Option<PathBuf> {
84 Some(self.get_path(file_id).to_owned())
85 }
86}
87
88fn normalize(path: &Path) -> PathBuf {
89 let mut components = path.components().peekable();
90 let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek().cloned() {
91 components.next();
92 PathBuf::from(c.as_os_str())
93 } else {
94 PathBuf::new()
95 };
96
97 for component in components {
98 match component {
99 Component::Prefix(..) => unreachable!(),
100 Component::RootDir => {
101 ret.push(component.as_os_str());
102 }
103 Component::CurDir => {}
104 Component::ParentDir => {
105 ret.pop();
106 }
107 Component::Normal(c) => {
108 ret.push(c);
109 }
110 }
111 }
112 ret
113}
114
115#[cfg(test)]
116mod test {
117 use super::*;
118
119 #[test]
120 fn test_resolve() {
121 let mut m = PathMap::default();
122 let (_, id1) = m.get_or_insert(PathBuf::from("/foo"), Root::Workspace);
123 let (_, id2) = m.get_or_insert(PathBuf::from("/foo/bar.rs"), Root::Workspace);
124 assert_eq!(m.resolve(id1, &RelativePath::new("bar.rs")), Some(id2),)
125 }
126}
diff --git a/crates/ra_lsp_server/src/project_model.rs b/crates/ra_lsp_server/src/project_model.rs
index b881f8b6f..5852a157d 100644
--- a/crates/ra_lsp_server/src/project_model.rs
+++ b/crates/ra_lsp_server/src/project_model.rs
@@ -69,6 +69,7 @@ impl Package {
69 pub fn targets<'a>(self, ws: &'a CargoWorkspace) -> impl Iterator<Item = Target> + 'a { 69 pub fn targets<'a>(self, ws: &'a CargoWorkspace) -> impl Iterator<Item = Target> + 'a {
70 ws.pkg(self).targets.iter().cloned() 70 ws.pkg(self).targets.iter().cloned()
71 } 71 }
72 #[allow(unused)]
72 pub fn is_member(self, ws: &CargoWorkspace) -> bool { 73 pub fn is_member(self, ws: &CargoWorkspace) -> bool {
73 ws.pkg(self).is_member 74 ws.pkg(self).is_member
74 } 75 }
diff --git a/crates/ra_lsp_server/src/server_world.rs b/crates/ra_lsp_server/src/server_world.rs
index ab4c2c8aa..785877c4b 100644
--- a/crates/ra_lsp_server/src/server_world.rs
+++ b/crates/ra_lsp_server/src/server_world.rs
@@ -1,154 +1,66 @@
1use std::{ 1use std::{
2 fs, 2 path::{PathBuf},
3 path::{Path, PathBuf},
4 sync::Arc, 3 sync::Arc,
5}; 4};
6 5
7use languageserver_types::Url; 6use languageserver_types::Url;
8use ra_analysis::{ 7use ra_analysis::{
9 Analysis, AnalysisChange, AnalysisHost, CrateGraph, FileId, FileResolver, LibraryData, 8 Analysis, AnalysisChange, AnalysisHost, CrateGraph, FileId, LibraryData,
9 SourceRootId
10}; 10};
11use ra_vfs::{Vfs, VfsChange, VfsFile};
11use rustc_hash::FxHashMap; 12use rustc_hash::FxHashMap;
12use failure::{bail, format_err}; 13use relative_path::RelativePathBuf;
14use parking_lot::RwLock;
15use failure::{format_err};
13 16
14use crate::{ 17use crate::{
15 path_map::{PathMap, Root},
16 project_model::{CargoWorkspace, TargetKind}, 18 project_model::{CargoWorkspace, TargetKind},
17 vfs::{FileEvent, FileEventKind},
18 Result, 19 Result,
19}; 20};
20 21
21#[derive(Debug, Default)] 22#[derive(Debug)]
22pub struct ServerWorldState { 23pub struct ServerWorldState {
24 pub roots_to_scan: usize,
25 pub root: PathBuf,
23 pub workspaces: Arc<Vec<CargoWorkspace>>, 26 pub workspaces: Arc<Vec<CargoWorkspace>>,
24 pub analysis_host: AnalysisHost, 27 pub analysis_host: AnalysisHost,
25 pub path_map: PathMap, 28 pub vfs: Arc<RwLock<Vfs>>,
26 pub mem_map: FxHashMap<FileId, Option<String>>,
27} 29}
28 30
29pub struct ServerWorld { 31pub struct ServerWorld {
30 pub workspaces: Arc<Vec<CargoWorkspace>>, 32 pub workspaces: Arc<Vec<CargoWorkspace>>,
31 pub analysis: Analysis, 33 pub analysis: Analysis,
32 pub path_map: PathMap, 34 pub vfs: Arc<RwLock<Vfs>>,
33} 35}
34 36
35impl ServerWorldState { 37impl ServerWorldState {
36 pub fn apply_fs_changes(&mut self, events: Vec<FileEvent>) { 38 pub fn new(root: PathBuf, workspaces: Vec<CargoWorkspace>) -> ServerWorldState {
37 let mut change = AnalysisChange::new(); 39 let mut change = AnalysisChange::new();
38 let mut inserted = false;
39 {
40 let pm = &mut self.path_map;
41 let mm = &mut self.mem_map;
42 events
43 .into_iter()
44 .map(|event| {
45 let text = match event.kind {
46 FileEventKind::Add(text) => text,
47 };
48 (event.path, text)
49 })
50 .map(|(path, text)| {
51 let (ins, file_id) = pm.get_or_insert(path, Root::Workspace);
52 inserted |= ins;
53 (file_id, text)
54 })
55 .filter_map(|(file_id, text)| {
56 if mm.contains_key(&file_id) {
57 mm.insert(file_id, Some(text));
58 None
59 } else {
60 Some((file_id, text))
61 }
62 })
63 .for_each(|(file_id, text)| change.add_file(file_id, text));
64 }
65 if inserted {
66 change.set_file_resolver(Arc::new(self.path_map.clone()))
67 }
68 self.analysis_host.apply_change(change);
69 }
70 pub fn events_to_files(
71 &mut self,
72 events: Vec<FileEvent>,
73 ) -> (Vec<(FileId, String)>, Arc<FileResolver>) {
74 let files = {
75 let pm = &mut self.path_map;
76 events
77 .into_iter()
78 .map(|event| {
79 let FileEventKind::Add(text) = event.kind;
80 (event.path, text)
81 })
82 .map(|(path, text)| (pm.get_or_insert(path, Root::Lib).1, text))
83 .collect()
84 };
85 let resolver = Arc::new(self.path_map.clone());
86 (files, resolver)
87 }
88 pub fn add_lib(&mut self, data: LibraryData) {
89 let mut change = AnalysisChange::new();
90 change.add_library(data);
91 self.analysis_host.apply_change(change);
92 }
93 40
94 pub fn add_mem_file(&mut self, path: PathBuf, text: String) -> FileId { 41 let mut roots = Vec::new();
95 let (inserted, file_id) = self.path_map.get_or_insert(path, Root::Workspace); 42 roots.push(root.clone());
96 if self.path_map.get_root(file_id) != Root::Lib { 43 for ws in workspaces.iter() {
97 let mut change = AnalysisChange::new(); 44 for pkg in ws.packages() {
98 if inserted { 45 roots.push(pkg.root(&ws).to_path_buf());
99 change.add_file(file_id, text);
100 change.set_file_resolver(Arc::new(self.path_map.clone()));
101 } else {
102 change.change_file(file_id, text);
103 } 46 }
104 self.analysis_host.apply_change(change);
105 } 47 }
106 self.mem_map.insert(file_id, None); 48 let roots_to_scan = roots.len();
107 file_id 49 let (mut vfs, roots) = Vfs::new(roots);
108 } 50 for r in roots {
109 51 let is_local = vfs.root2path(r).starts_with(&root);
110 pub fn change_mem_file(&mut self, path: &Path, text: String) -> Result<()> { 52 change.add_root(SourceRootId(r.0), is_local);
111 let file_id = self
112 .path_map
113 .get_id(path)
114 .ok_or_else(|| format_err!("change to unknown file: {}", path.display()))?;
115 if self.path_map.get_root(file_id) != Root::Lib {
116 let mut change = AnalysisChange::new();
117 change.change_file(file_id, text);
118 self.analysis_host.apply_change(change);
119 } 53 }
120 Ok(())
121 }
122 54
123 pub fn remove_mem_file(&mut self, path: &Path) -> Result<FileId> {
124 let file_id = self
125 .path_map
126 .get_id(path)
127 .ok_or_else(|| format_err!("change to unknown file: {}", path.display()))?;
128 match self.mem_map.remove(&file_id) {
129 Some(_) => (),
130 None => bail!("unmatched close notification"),
131 };
132 // Do this via file watcher ideally.
133 let text = fs::read_to_string(path).ok();
134 if self.path_map.get_root(file_id) != Root::Lib {
135 let mut change = AnalysisChange::new();
136 if let Some(text) = text {
137 change.change_file(file_id, text);
138 }
139 self.analysis_host.apply_change(change);
140 }
141 Ok(file_id)
142 }
143 pub fn set_workspaces(&mut self, ws: Vec<CargoWorkspace>) {
144 let mut crate_graph = CrateGraph::default(); 55 let mut crate_graph = CrateGraph::default();
145 let mut pkg_to_lib_crate = FxHashMap::default(); 56 let mut pkg_to_lib_crate = FxHashMap::default();
146 let mut pkg_crates = FxHashMap::default(); 57 let mut pkg_crates = FxHashMap::default();
147 for ws in ws.iter() { 58 for ws in workspaces.iter() {
148 for pkg in ws.packages() { 59 for pkg in ws.packages() {
149 for tgt in pkg.targets(ws) { 60 for tgt in pkg.targets(ws) {
150 let root = tgt.root(ws); 61 let root = tgt.root(ws);
151 if let Some(file_id) = self.path_map.get_id(root) { 62 if let Some(file_id) = vfs.load(root) {
63 let file_id = FileId(file_id.0);
152 let crate_id = crate_graph.add_crate_root(file_id); 64 let crate_id = crate_graph.add_crate_root(file_id);
153 if tgt.kind(ws) == TargetKind::Lib { 65 if tgt.kind(ws) == TargetKind::Lib {
154 pkg_to_lib_crate.insert(pkg, crate_id); 66 pkg_to_lib_crate.insert(pkg, crate_id);
@@ -170,16 +82,80 @@ impl ServerWorldState {
170 } 82 }
171 } 83 }
172 } 84 }
173 self.workspaces = Arc::new(ws);
174 let mut change = AnalysisChange::new();
175 change.set_crate_graph(crate_graph); 85 change.set_crate_graph(crate_graph);
86
87 let mut analysis_host = AnalysisHost::default();
88 analysis_host.apply_change(change);
89 ServerWorldState {
90 roots_to_scan,
91 root,
92 workspaces: Arc::new(workspaces),
93 analysis_host,
94 vfs: Arc::new(RwLock::new(vfs)),
95 }
96 }
97
98 /// Returns a vec of libraries
99 /// FIXME: better API here
100 pub fn process_changes(
101 &mut self,
102 ) -> Vec<(SourceRootId, Vec<(FileId, RelativePathBuf, Arc<String>)>)> {
103 let changes = self.vfs.write().commit_changes();
104 if changes.is_empty() {
105 return Vec::new();
106 }
107 let mut libs = Vec::new();
108 let mut change = AnalysisChange::new();
109 for c in changes {
110 log::info!("vfs change {:?}", c);
111 match c {
112 VfsChange::AddRoot { root, files } => {
113 let root_path = self.vfs.read().root2path(root);
114 if root_path.starts_with(&self.root) {
115 self.roots_to_scan -= 1;
116 for (file, path, text) in files {
117 change.add_file(SourceRootId(root.0), FileId(file.0), path, text);
118 }
119 } else {
120 let files = files
121 .into_iter()
122 .map(|(vfsfile, path, text)| (FileId(vfsfile.0), path, text))
123 .collect();
124 libs.push((SourceRootId(root.0), files));
125 }
126 }
127 VfsChange::AddFile {
128 root,
129 file,
130 path,
131 text,
132 } => {
133 change.add_file(SourceRootId(root.0), FileId(file.0), path, text);
134 }
135 VfsChange::RemoveFile { root, file, path } => {
136 change.remove_file(SourceRootId(root.0), FileId(file.0), path)
137 }
138 VfsChange::ChangeFile { file, text } => {
139 change.change_file(FileId(file.0), text);
140 }
141 }
142 }
176 self.analysis_host.apply_change(change); 143 self.analysis_host.apply_change(change);
144 libs
177 } 145 }
146
147 pub fn add_lib(&mut self, data: LibraryData) {
148 self.roots_to_scan -= 1;
149 let mut change = AnalysisChange::new();
150 change.add_library(data);
151 self.analysis_host.apply_change(change);
152 }
153
178 pub fn snapshot(&self) -> ServerWorld { 154 pub fn snapshot(&self) -> ServerWorld {
179 ServerWorld { 155 ServerWorld {
180 workspaces: Arc::clone(&self.workspaces), 156 workspaces: Arc::clone(&self.workspaces),
181 analysis: self.analysis_host.analysis(), 157 analysis: self.analysis_host.analysis(),
182 path_map: self.path_map.clone(), 158 vfs: Arc::clone(&self.vfs),
183 } 159 }
184 } 160 }
185} 161}
@@ -193,15 +169,18 @@ impl ServerWorld {
193 let path = uri 169 let path = uri
194 .to_file_path() 170 .to_file_path()
195 .map_err(|()| format_err!("invalid uri: {}", uri))?; 171 .map_err(|()| format_err!("invalid uri: {}", uri))?;
196 self.path_map 172 let file = self
197 .get_id(&path) 173 .vfs
198 .ok_or_else(|| format_err!("unknown file: {}", path.display())) 174 .read()
175 .path2file(&path)
176 .ok_or_else(|| format_err!("unknown file: {}", path.display()))?;
177 Ok(FileId(file.0))
199 } 178 }
200 179
201 pub fn file_id_to_uri(&self, id: FileId) -> Result<Url> { 180 pub fn file_id_to_uri(&self, id: FileId) -> Result<Url> {
202 let path = self.path_map.get_path(id); 181 let path = self.vfs.read().file2path(VfsFile(id.0));
203 let url = Url::from_file_path(path) 182 let url = Url::from_file_path(&path)
204 .map_err(|()| format_err!("can't convert path to url: {}", path.display()))?; 183 .map_err(|_| format_err!("can't convert path to url: {}", path.display()))?;
205 Ok(url) 184 Ok(url)
206 } 185 }
207} 186}
diff --git a/crates/ra_lsp_server/src/vfs.rs b/crates/ra_lsp_server/src/vfs.rs
deleted file mode 100644
index fcf7693d8..000000000
--- a/crates/ra_lsp_server/src/vfs.rs
+++ /dev/null
@@ -1,67 +0,0 @@
1use std::{
2 fs,
3 path::{Path, PathBuf},
4};
5
6use walkdir::WalkDir;
7use thread_worker::{WorkerHandle, Worker};
8
9#[derive(Debug)]
10pub struct FileEvent {
11 pub path: PathBuf,
12 pub kind: FileEventKind,
13}
14
15#[derive(Debug)]
16pub enum FileEventKind {
17 Add(String),
18}
19
20pub fn roots_loader() -> (Worker<PathBuf, (PathBuf, Vec<FileEvent>)>, WorkerHandle) {
21 thread_worker::spawn::<PathBuf, (PathBuf, Vec<FileEvent>), _>(
22 "roots loader",
23 128,
24 |input_receiver, output_sender| {
25 input_receiver
26 .map(|path| {
27 log::debug!("loading {} ...", path.as_path().display());
28 let events = load_root(path.as_path());
29 log::debug!("... loaded {}", path.as_path().display());
30 (path, events)
31 })
32 .for_each(|it| output_sender.send(it))
33 },
34 )
35}
36
37fn load_root(path: &Path) -> Vec<FileEvent> {
38 let mut res = Vec::new();
39 for entry in WalkDir::new(path) {
40 let entry = match entry {
41 Ok(entry) => entry,
42 Err(e) => {
43 log::warn!("watcher error: {}", e);
44 continue;
45 }
46 };
47 if !entry.file_type().is_file() {
48 continue;
49 }
50 let path = entry.path();
51 if path.extension().and_then(|os| os.to_str()) != Some("rs") {
52 continue;
53 }
54 let text = match fs::read_to_string(path) {
55 Ok(text) => text,
56 Err(e) => {
57 log::warn!("watcher error: {}", e);
58 continue;
59 }
60 };
61 res.push(FileEvent {
62 path: path.to_owned(),
63 kind: FileEventKind::Add(text),
64 })
65 }
66 res
67}
diff --git a/crates/ra_lsp_server/tests/heavy_tests/main.rs b/crates/ra_lsp_server/tests/heavy_tests/main.rs
index 26f5e3f20..029a55d40 100644
--- a/crates/ra_lsp_server/tests/heavy_tests/main.rs
+++ b/crates/ra_lsp_server/tests/heavy_tests/main.rs
@@ -1,9 +1,7 @@
1mod support; 1mod support;
2 2
3use serde_json::json; 3use serde_json::json;
4
5use ra_lsp_server::req::{Runnables, RunnablesParams, CodeActionRequest, CodeActionParams}; 4use ra_lsp_server::req::{Runnables, RunnablesParams, CodeActionRequest, CodeActionParams};
6
7use languageserver_types::{Position, Range, CodeActionContext}; 5use languageserver_types::{Position, Range, CodeActionContext};
8 6
9use crate::support::project; 7use crate::support::project;
@@ -20,6 +18,7 @@ fn foo() {
20} 18}
21", 19",
22 ); 20 );
21 server.wait_for_feedback("workspace loaded");
23 server.request::<Runnables>( 22 server.request::<Runnables>(
24 RunnablesParams { 23 RunnablesParams {
25 text_document: server.doc_id("lib.rs"), 24 text_document: server.doc_id("lib.rs"),
diff --git a/crates/ra_lsp_server/tests/heavy_tests/support.rs b/crates/ra_lsp_server/tests/heavy_tests/support.rs
index 07a878a26..c14d287ca 100644
--- a/crates/ra_lsp_server/tests/heavy_tests/support.rs
+++ b/crates/ra_lsp_server/tests/heavy_tests/support.rs
@@ -174,11 +174,11 @@ impl Server {
174impl Drop for Server { 174impl Drop for Server {
175 fn drop(&mut self) { 175 fn drop(&mut self) {
176 self.send_request::<Shutdown>(666, ()); 176 self.send_request::<Shutdown>(666, ());
177 let receiver = self.worker.take().unwrap().stop(); 177 let receiver = self.worker.take().unwrap().shutdown();
178 while let Some(msg) = recv_timeout(&receiver) { 178 while let Some(msg) = recv_timeout(&receiver) {
179 drop(msg); 179 drop(msg);
180 } 180 }
181 self.watcher.take().unwrap().stop().unwrap(); 181 self.watcher.take().unwrap().shutdown().unwrap();
182 } 182 }
183} 183}
184 184
diff --git a/crates/ra_vfs/Cargo.toml b/crates/ra_vfs/Cargo.toml
new file mode 100644
index 000000000..ccea8a866
--- /dev/null
+++ b/crates/ra_vfs/Cargo.toml
@@ -0,0 +1,17 @@
1[package]
2edition = "2018"
3name = "ra_vfs"
4version = "0.1.0"
5authors = ["Aleksey Kladov <[email protected]>"]
6
7[dependencies]
8walkdir = "2.2.7"
9relative-path = "0.4.0"
10rustc-hash = "1.0"
11crossbeam-channel = "0.2.4"
12log = "0.4.6"
13
14thread_worker = { path = "../thread_worker" }
15
16[dev-dependencies]
17tempfile = "3"
diff --git a/crates/ra_vfs/src/arena.rs b/crates/ra_vfs/src/arena.rs
new file mode 100644
index 000000000..6b42ae26d
--- /dev/null
+++ b/crates/ra_vfs/src/arena.rs
@@ -0,0 +1,53 @@
1use std::{
2 marker::PhantomData,
3 ops::{Index, IndexMut},
4};
5
6#[derive(Clone, Debug)]
7pub(crate) struct Arena<ID: ArenaId, T> {
8 data: Vec<T>,
9 _ty: PhantomData<ID>,
10}
11
12pub(crate) trait ArenaId {
13 fn from_u32(id: u32) -> Self;
14 fn to_u32(self) -> u32;
15}
16
17impl<ID: ArenaId, T> Arena<ID, T> {
18 pub fn alloc(&mut self, value: T) -> ID {
19 let id = self.data.len() as u32;
20 self.data.push(value);
21 ID::from_u32(id)
22 }
23 pub fn iter<'a>(&'a self) -> impl Iterator<Item = (ID, &'a T)> {
24 self.data
25 .iter()
26 .enumerate()
27 .map(|(idx, value)| (ID::from_u32(idx as u32), value))
28 }
29}
30
31impl<ID: ArenaId, T> Default for Arena<ID, T> {
32 fn default() -> Arena<ID, T> {
33 Arena {
34 data: Vec::new(),
35 _ty: PhantomData,
36 }
37 }
38}
39
40impl<ID: ArenaId, T> Index<ID> for Arena<ID, T> {
41 type Output = T;
42 fn index(&self, idx: ID) -> &T {
43 let idx = idx.to_u32() as usize;
44 &self.data[idx]
45 }
46}
47
48impl<ID: ArenaId, T> IndexMut<ID> for Arena<ID, T> {
49 fn index_mut(&mut self, idx: ID) -> &mut T {
50 let idx = idx.to_u32() as usize;
51 &mut self.data[idx]
52 }
53}
diff --git a/crates/ra_vfs/src/io.rs b/crates/ra_vfs/src/io.rs
new file mode 100644
index 000000000..be400bae9
--- /dev/null
+++ b/crates/ra_vfs/src/io.rs
@@ -0,0 +1,76 @@
1use std::{
2 fmt,
3 fs,
4 path::{Path, PathBuf},
5};
6
7use walkdir::{DirEntry, WalkDir};
8use thread_worker::{WorkerHandle};
9use relative_path::RelativePathBuf;
10
11use crate::VfsRoot;
12
13pub(crate) struct Task {
14 pub(crate) root: VfsRoot,
15 pub(crate) path: PathBuf,
16 pub(crate) filter: Box<Fn(&DirEntry) -> bool + Send>,
17}
18
19pub struct TaskResult {
20 pub(crate) root: VfsRoot,
21 pub(crate) files: Vec<(RelativePathBuf, String)>,
22}
23
24impl fmt::Debug for TaskResult {
25 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
26 f.write_str("TaskResult { ... }")
27 }
28}
29
30pub(crate) type Worker = thread_worker::Worker<Task, TaskResult>;
31
32pub(crate) fn start() -> (Worker, WorkerHandle) {
33 thread_worker::spawn("vfs", 128, |input_receiver, output_sender| {
34 input_receiver
35 .map(handle_task)
36 .for_each(|it| output_sender.send(it))
37 })
38}
39
40fn handle_task(task: Task) -> TaskResult {
41 let Task { root, path, filter } = task;
42 log::debug!("loading {} ...", path.as_path().display());
43 let files = load_root(path.as_path(), &*filter);
44 log::debug!("... loaded {}", path.as_path().display());
45 TaskResult { root, files }
46}
47
48fn load_root(root: &Path, filter: &dyn Fn(&DirEntry) -> bool) -> Vec<(RelativePathBuf, String)> {
49 let mut res = Vec::new();
50 for entry in WalkDir::new(root).into_iter().filter_entry(filter) {
51 let entry = match entry {
52 Ok(entry) => entry,
53 Err(e) => {
54 log::warn!("watcher error: {}", e);
55 continue;
56 }
57 };
58 if !entry.file_type().is_file() {
59 continue;
60 }
61 let path = entry.path();
62 if path.extension().and_then(|os| os.to_str()) != Some("rs") {
63 continue;
64 }
65 let text = match fs::read_to_string(path) {
66 Ok(text) => text,
67 Err(e) => {
68 log::warn!("watcher error: {}", e);
69 continue;
70 }
71 };
72 let path = RelativePathBuf::from_path(path.strip_prefix(root).unwrap()).unwrap();
73 res.push((path.to_owned(), text))
74 }
75 res
76}
diff --git a/crates/ra_vfs/src/lib.rs b/crates/ra_vfs/src/lib.rs
new file mode 100644
index 000000000..4de07b093
--- /dev/null
+++ b/crates/ra_vfs/src/lib.rs
@@ -0,0 +1,350 @@
1//! VFS stands for Virtual File System.
2//!
3//! When doing analysis, we don't want to do any IO, we want to keep all source
4//! code in memory. However, the actual source code is stored on disk, so you
5//! component which does this.
6//! need to get it into the memory in the first place somehow. VFS is the
7//!
8//! It also is responsible for watching the disk for changes, and for merging
9//! editor state (modified, unsaved files) with disk state.
10//!
11//! VFS is based on a concept of roots: a set of directories on the file system
12//! whihc are watched for changes. Typically, there will be a root for each
13//! Cargo package.
14mod arena;
15mod io;
16
17use std::{
18 fmt,
19 mem,
20 thread,
21 cmp::Reverse,
22 path::{Path, PathBuf},
23 ffi::OsStr,
24 sync::Arc,
25 fs,
26};
27
28use rustc_hash::{FxHashMap, FxHashSet};
29use relative_path::RelativePathBuf;
30use crossbeam_channel::Receiver;
31use walkdir::DirEntry;
32use thread_worker::{WorkerHandle};
33
34use crate::{
35 arena::{ArenaId, Arena},
36};
37
38pub use crate::io::TaskResult as VfsTask;
39
40/// `RootFilter` is a predicate that checks if a file can belong to a root. If
41/// several filters match a file (nested dirs), the most nested one wins.
42struct RootFilter {
43 root: PathBuf,
44 file_filter: fn(&Path) -> bool,
45}
46
47impl RootFilter {
48 fn new(root: PathBuf) -> RootFilter {
49 RootFilter {
50 root,
51 file_filter: has_rs_extension,
52 }
53 }
54 /// Check if this root can contain `path`. NB: even if this returns
55 /// true, the `path` might actually be conained in some nested root.
56 fn can_contain(&self, path: &Path) -> Option<RelativePathBuf> {
57 if !(self.file_filter)(path) {
58 return None;
59 }
60 if !(path.starts_with(&self.root)) {
61 return None;
62 }
63 let path = path.strip_prefix(&self.root).unwrap();
64 let path = RelativePathBuf::from_path(path).unwrap();
65 Some(path)
66 }
67}
68
69fn has_rs_extension(p: &Path) -> bool {
70 p.extension() == Some(OsStr::new("rs"))
71}
72
73#[derive(Clone, Copy, PartialEq, Eq, Debug, Hash)]
74pub struct VfsRoot(pub u32);
75
76impl ArenaId for VfsRoot {
77 fn from_u32(idx: u32) -> VfsRoot {
78 VfsRoot(idx)
79 }
80 fn to_u32(self) -> u32 {
81 self.0
82 }
83}
84
85#[derive(Clone, Copy, PartialEq, Eq, Debug, Hash)]
86pub struct VfsFile(pub u32);
87
88impl ArenaId for VfsFile {
89 fn from_u32(idx: u32) -> VfsFile {
90 VfsFile(idx)
91 }
92 fn to_u32(self) -> u32 {
93 self.0
94 }
95}
96
97struct VfsFileData {
98 root: VfsRoot,
99 path: RelativePathBuf,
100 text: Arc<String>,
101}
102
103pub struct Vfs {
104 roots: Arena<VfsRoot, RootFilter>,
105 files: Arena<VfsFile, VfsFileData>,
106 root2files: FxHashMap<VfsRoot, FxHashSet<VfsFile>>,
107 pending_changes: Vec<VfsChange>,
108 worker: io::Worker,
109 worker_handle: WorkerHandle,
110}
111
112impl fmt::Debug for Vfs {
113 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
114 f.write_str("Vfs { ... }")
115 }
116}
117
118impl Vfs {
119 pub fn new(mut roots: Vec<PathBuf>) -> (Vfs, Vec<VfsRoot>) {
120 let (worker, worker_handle) = io::start();
121
122 let mut res = Vfs {
123 roots: Arena::default(),
124 files: Arena::default(),
125 root2files: FxHashMap::default(),
126 worker,
127 worker_handle,
128 pending_changes: Vec::new(),
129 };
130
131 // A hack to make nesting work.
132 roots.sort_by_key(|it| Reverse(it.as_os_str().len()));
133 for (i, path) in roots.iter().enumerate() {
134 let root = res.roots.alloc(RootFilter::new(path.clone()));
135 res.root2files.insert(root, Default::default());
136 let nested = roots[..i]
137 .iter()
138 .filter(|it| it.starts_with(path))
139 .map(|it| it.clone())
140 .collect::<Vec<_>>();
141 let filter = move |entry: &DirEntry| {
142 if entry.file_type().is_file() {
143 has_rs_extension(entry.path())
144 } else {
145 nested.iter().all(|it| it != entry.path())
146 }
147 };
148 let task = io::Task {
149 root,
150 path: path.clone(),
151 filter: Box::new(filter),
152 };
153 res.worker.inp.send(task);
154 }
155 let roots = res.roots.iter().map(|(id, _)| id).collect();
156 (res, roots)
157 }
158
159 pub fn root2path(&self, root: VfsRoot) -> PathBuf {
160 self.roots[root].root.clone()
161 }
162
163 pub fn path2file(&self, path: &Path) -> Option<VfsFile> {
164 if let Some((_root, _path, Some(file))) = self.find_root(path) {
165 return Some(file);
166 }
167 None
168 }
169
170 pub fn file2path(&self, file: VfsFile) -> PathBuf {
171 let rel_path = &self.files[file].path;
172 let root_path = &self.roots[self.files[file].root].root;
173 rel_path.to_path(root_path)
174 }
175
176 pub fn file_for_path(&self, path: &Path) -> Option<VfsFile> {
177 if let Some((_root, _path, Some(file))) = self.find_root(path) {
178 return Some(file);
179 }
180 None
181 }
182
183 pub fn load(&mut self, path: &Path) -> Option<VfsFile> {
184 if let Some((root, rel_path, file)) = self.find_root(path) {
185 return if let Some(file) = file {
186 Some(file)
187 } else {
188 let text = fs::read_to_string(path).unwrap_or_default();
189 let text = Arc::new(text);
190 let file = self.add_file(root, rel_path.clone(), Arc::clone(&text));
191 let change = VfsChange::AddFile {
192 file,
193 text,
194 root,
195 path: rel_path,
196 };
197 self.pending_changes.push(change);
198 Some(file)
199 };
200 }
201 None
202 }
203
204 pub fn task_receiver(&self) -> &Receiver<io::TaskResult> {
205 &self.worker.out
206 }
207
208 pub fn handle_task(&mut self, task: io::TaskResult) {
209 let mut files = Vec::new();
210 // While we were scanning the root in the backgound, a file might have
211 // been open in the editor, so we need to account for that.
212 let exising = self.root2files[&task.root]
213 .iter()
214 .map(|&file| (self.files[file].path.clone(), file))
215 .collect::<FxHashMap<_, _>>();
216 for (path, text) in task.files {
217 if let Some(&file) = exising.get(&path) {
218 let text = Arc::clone(&self.files[file].text);
219 files.push((file, path, text));
220 continue;
221 }
222 let text = Arc::new(text);
223 let file = self.add_file(task.root, path.clone(), Arc::clone(&text));
224 files.push((file, path, text));
225 }
226
227 let change = VfsChange::AddRoot {
228 root: task.root,
229 files,
230 };
231 self.pending_changes.push(change);
232 }
233
234 pub fn add_file_overlay(&mut self, path: &Path, text: String) -> Option<VfsFile> {
235 let mut res = None;
236 if let Some((root, path, file)) = self.find_root(path) {
237 let text = Arc::new(text);
238 let change = if let Some(file) = file {
239 res = Some(file);
240 self.change_file(file, Arc::clone(&text));
241 VfsChange::ChangeFile { file, text }
242 } else {
243 let file = self.add_file(root, path.clone(), Arc::clone(&text));
244 res = Some(file);
245 VfsChange::AddFile {
246 file,
247 text,
248 root,
249 path,
250 }
251 };
252 self.pending_changes.push(change);
253 }
254 res
255 }
256
257 pub fn change_file_overlay(&mut self, path: &Path, new_text: String) {
258 if let Some((_root, _path, file)) = self.find_root(path) {
259 let file = file.expect("can't change a file which wasn't added");
260 let text = Arc::new(new_text);
261 self.change_file(file, Arc::clone(&text));
262 let change = VfsChange::ChangeFile { file, text };
263 self.pending_changes.push(change);
264 }
265 }
266
267 pub fn remove_file_overlay(&mut self, path: &Path) -> Option<VfsFile> {
268 let mut res = None;
269 if let Some((root, path, file)) = self.find_root(path) {
270 let file = file.expect("can't remove a file which wasn't added");
271 res = Some(file);
272 let full_path = path.to_path(&self.roots[root].root);
273 let change = if let Ok(text) = fs::read_to_string(&full_path) {
274 let text = Arc::new(text);
275 self.change_file(file, Arc::clone(&text));
276 VfsChange::ChangeFile { file, text }
277 } else {
278 self.remove_file(file);
279 VfsChange::RemoveFile { root, file, path }
280 };
281 self.pending_changes.push(change);
282 }
283 res
284 }
285
286 pub fn commit_changes(&mut self) -> Vec<VfsChange> {
287 mem::replace(&mut self.pending_changes, Vec::new())
288 }
289
290 /// Sutdown the VFS and terminate the background watching thread.
291 pub fn shutdown(self) -> thread::Result<()> {
292 let _ = self.worker.shutdown();
293 self.worker_handle.shutdown()
294 }
295
296 fn add_file(&mut self, root: VfsRoot, path: RelativePathBuf, text: Arc<String>) -> VfsFile {
297 let data = VfsFileData { root, path, text };
298 let file = self.files.alloc(data);
299 self.root2files.get_mut(&root).unwrap().insert(file);
300 file
301 }
302
303 fn change_file(&mut self, file: VfsFile, new_text: Arc<String>) {
304 self.files[file].text = new_text;
305 }
306
307 fn remove_file(&mut self, file: VfsFile) {
308 //FIXME: use arena with removal
309 self.files[file].text = Default::default();
310 self.files[file].path = Default::default();
311 let root = self.files[file].root;
312 let removed = self.root2files.get_mut(&root).unwrap().remove(&file);
313 assert!(removed);
314 }
315
316 fn find_root(&self, path: &Path) -> Option<(VfsRoot, RelativePathBuf, Option<VfsFile>)> {
317 let (root, path) = self
318 .roots
319 .iter()
320 .find_map(|(root, data)| data.can_contain(path).map(|it| (root, it)))?;
321 let file = self.root2files[&root]
322 .iter()
323 .map(|&it| it)
324 .find(|&file| self.files[file].path == path);
325 Some((root, path, file))
326 }
327}
328
329#[derive(Debug, Clone)]
330pub enum VfsChange {
331 AddRoot {
332 root: VfsRoot,
333 files: Vec<(VfsFile, RelativePathBuf, Arc<String>)>,
334 },
335 AddFile {
336 root: VfsRoot,
337 file: VfsFile,
338 path: RelativePathBuf,
339 text: Arc<String>,
340 },
341 RemoveFile {
342 root: VfsRoot,
343 file: VfsFile,
344 path: RelativePathBuf,
345 },
346 ChangeFile {
347 file: VfsFile,
348 text: Arc<String>,
349 },
350}
diff --git a/crates/ra_vfs/tests/vfs.rs b/crates/ra_vfs/tests/vfs.rs
new file mode 100644
index 000000000..f56fc4603
--- /dev/null
+++ b/crates/ra_vfs/tests/vfs.rs
@@ -0,0 +1,101 @@
1use std::{
2 fs,
3 collections::HashSet,
4};
5
6use tempfile::tempdir;
7
8use ra_vfs::{Vfs, VfsChange};
9
10#[test]
11fn test_vfs_works() -> std::io::Result<()> {
12 let files = [
13 ("a/foo.rs", "hello"),
14 ("a/bar.rs", "world"),
15 ("a/b/baz.rs", "nested hello"),
16 ];
17
18 let dir = tempdir()?;
19 for (path, text) in files.iter() {
20 let file_path = dir.path().join(path);
21 fs::create_dir_all(file_path.parent().unwrap())?;
22 fs::write(file_path, text)?
23 }
24
25 let a_root = dir.path().join("a");
26 let b_root = dir.path().join("a/b");
27
28 let (mut vfs, _) = Vfs::new(vec![a_root, b_root]);
29 for _ in 0..2 {
30 let task = vfs.task_receiver().recv().unwrap();
31 vfs.handle_task(task);
32 }
33 {
34 let files = vfs
35 .commit_changes()
36 .into_iter()
37 .flat_map(|change| {
38 let files = match change {
39 VfsChange::AddRoot { files, .. } => files,
40 _ => panic!("unexpected change"),
41 };
42 files.into_iter().map(|(_id, path, text)| {
43 let text: String = (&*text).clone();
44 (format!("{}", path.display()), text)
45 })
46 })
47 .collect::<HashSet<_>>();
48
49 let expected_files = [
50 ("foo.rs", "hello"),
51 ("bar.rs", "world"),
52 ("baz.rs", "nested hello"),
53 ]
54 .iter()
55 .map(|(path, text)| (path.to_string(), text.to_string()))
56 .collect::<HashSet<_>>();
57
58 assert_eq!(files, expected_files);
59 }
60
61 vfs.add_file_overlay(&dir.path().join("a/b/baz.rs"), "quux".to_string());
62 let change = vfs.commit_changes().pop().unwrap();
63 match change {
64 VfsChange::ChangeFile { text, .. } => assert_eq!(&*text, "quux"),
65 _ => panic!("unexpected change"),
66 }
67
68 vfs.change_file_overlay(&dir.path().join("a/b/baz.rs"), "m".to_string());
69 let change = vfs.commit_changes().pop().unwrap();
70 match change {
71 VfsChange::ChangeFile { text, .. } => assert_eq!(&*text, "m"),
72 _ => panic!("unexpected change"),
73 }
74
75 vfs.remove_file_overlay(&dir.path().join("a/b/baz.rs"));
76 let change = vfs.commit_changes().pop().unwrap();
77 match change {
78 VfsChange::ChangeFile { text, .. } => assert_eq!(&*text, "nested hello"),
79 _ => panic!("unexpected change"),
80 }
81
82 vfs.add_file_overlay(&dir.path().join("a/b/spam.rs"), "spam".to_string());
83 let change = vfs.commit_changes().pop().unwrap();
84 match change {
85 VfsChange::AddFile { text, path, .. } => {
86 assert_eq!(&*text, "spam");
87 assert_eq!(path, "spam.rs");
88 }
89 _ => panic!("unexpected change"),
90 }
91
92 vfs.remove_file_overlay(&dir.path().join("a/b/spam.rs"));
93 let change = vfs.commit_changes().pop().unwrap();
94 match change {
95 VfsChange::RemoveFile { .. } => (),
96 _ => panic!("unexpected change"),
97 }
98
99 vfs.shutdown().unwrap();
100 Ok(())
101}
diff --git a/crates/thread_worker/src/lib.rs b/crates/thread_worker/src/lib.rs
index e558559ef..12e8bf17e 100644
--- a/crates/thread_worker/src/lib.rs
+++ b/crates/thread_worker/src/lib.rs
@@ -30,13 +30,16 @@ where
30impl<I, O> Worker<I, O> { 30impl<I, O> Worker<I, O> {
31 /// Stops the worker. Returns the message receiver to fetch results which 31 /// Stops the worker. Returns the message receiver to fetch results which
32 /// have become ready before the worker is stopped. 32 /// have become ready before the worker is stopped.
33 pub fn stop(self) -> Receiver<O> { 33 pub fn shutdown(self) -> Receiver<O> {
34 self.out 34 self.out
35 } 35 }
36 36
37 pub fn send(&self, item: I) { 37 pub fn send(&self, item: I) {
38 self.inp.send(item) 38 self.inp.send(item)
39 } 39 }
40 pub fn recv(&self) -> Option<O> {
41 self.out.recv()
42 }
40} 43}
41 44
42impl WorkerHandle { 45impl WorkerHandle {
@@ -45,11 +48,11 @@ impl WorkerHandle {
45 WorkerHandle { 48 WorkerHandle {
46 name, 49 name,
47 thread, 50 thread,
48 bomb: DropBomb::new(format!("WorkerHandle {} was not stopped", name)), 51 bomb: DropBomb::new(format!("WorkerHandle {} was not shutdown", name)),
49 } 52 }
50 } 53 }
51 54
52 pub fn stop(mut self) -> thread::Result<()> { 55 pub fn shutdown(mut self) -> thread::Result<()> {
53 log::info!("waiting for {} to finish ...", self.name); 56 log::info!("waiting for {} to finish ...", self.name);
54 let name = self.name; 57 let name = self.name;
55 self.bomb.defuse(); 58 self.bomb.defuse();