diff options
author | Kirill Bulatov <[email protected]> | 2020-11-13 23:07:03 +0000 |
---|---|---|
committer | Kirill Bulatov <[email protected]> | 2020-11-16 19:19:06 +0000 |
commit | 3b0fc4d7f2b922a1b7d8d32fc0b065e4023d749b (patch) | |
tree | 316856a272dc85450c1d95725dbbd8a0150de2c1 | |
parent | 46514448b740b82e4f5f9cf742c6f8c6caec1d38 (diff) |
Omit modules during autocompletion
-rw-r--r-- | Cargo.lock | 159 | ||||
-rw-r--r-- | crates/completion/src/completions/magic.rs | 26 |
2 files changed, 118 insertions, 67 deletions
diff --git a/Cargo.lock b/Cargo.lock index eb4e43ad9..d51610e4c 100644 --- a/Cargo.lock +++ b/Cargo.lock | |||
@@ -2,9 +2,9 @@ | |||
2 | # It is not intended for manual editing. | 2 | # It is not intended for manual editing. |
3 | [[package]] | 3 | [[package]] |
4 | name = "addr2line" | 4 | name = "addr2line" |
5 | version = "0.13.0" | 5 | version = "0.14.0" |
6 | source = "registry+https://github.com/rust-lang/crates.io-index" | 6 | source = "registry+https://github.com/rust-lang/crates.io-index" |
7 | checksum = "1b6a2d3371669ab3ca9797670853d61402b03d0b4b9ebf33d677dfa720203072" | 7 | checksum = "7c0929d69e78dd9bf5408269919fcbcaeb2e35e5d43e5815517cdc6a8e11a423" |
8 | dependencies = [ | 8 | dependencies = [ |
9 | "gimli", | 9 | "gimli", |
10 | ] | 10 | ] |
@@ -26,9 +26,9 @@ dependencies = [ | |||
26 | 26 | ||
27 | [[package]] | 27 | [[package]] |
28 | name = "anyhow" | 28 | name = "anyhow" |
29 | version = "1.0.33" | 29 | version = "1.0.34" |
30 | source = "registry+https://github.com/rust-lang/crates.io-index" | 30 | source = "registry+https://github.com/rust-lang/crates.io-index" |
31 | checksum = "a1fd36ffbb1fb7c834eac128ea8d0e310c5aeb635548f9d58861e1308d46e71c" | 31 | checksum = "bf8dcb5b4bbaa28653b647d8c77bd4ed40183b48882e130c1f1ffb73de069fd7" |
32 | 32 | ||
33 | [[package]] | 33 | [[package]] |
34 | name = "anymap" | 34 | name = "anymap" |
@@ -42,9 +42,9 @@ version = "0.0.0" | |||
42 | 42 | ||
43 | [[package]] | 43 | [[package]] |
44 | name = "arrayvec" | 44 | name = "arrayvec" |
45 | version = "0.5.1" | 45 | version = "0.5.2" |
46 | source = "registry+https://github.com/rust-lang/crates.io-index" | 46 | source = "registry+https://github.com/rust-lang/crates.io-index" |
47 | checksum = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" | 47 | checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" |
48 | 48 | ||
49 | [[package]] | 49 | [[package]] |
50 | name = "assists" | 50 | name = "assists" |
@@ -81,9 +81,9 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" | |||
81 | 81 | ||
82 | [[package]] | 82 | [[package]] |
83 | name = "backtrace" | 83 | name = "backtrace" |
84 | version = "0.3.53" | 84 | version = "0.3.54" |
85 | source = "registry+https://github.com/rust-lang/crates.io-index" | 85 | source = "registry+https://github.com/rust-lang/crates.io-index" |
86 | checksum = "707b586e0e2f247cbde68cdd2c3ce69ea7b7be43e1c5b426e37c9319c4b9838e" | 86 | checksum = "2baad346b2d4e94a24347adeee9c7a93f412ee94b9cc26e5b59dea23848e9f28" |
87 | dependencies = [ | 87 | dependencies = [ |
88 | "addr2line", | 88 | "addr2line", |
89 | "cfg-if 1.0.0", | 89 | "cfg-if 1.0.0", |
@@ -132,7 +132,7 @@ version = "0.12.0" | |||
132 | source = "registry+https://github.com/rust-lang/crates.io-index" | 132 | source = "registry+https://github.com/rust-lang/crates.io-index" |
133 | checksum = "d5a5f7b42f606b7f23674f6f4d877628350682bc40687d3fae65679a58d55345" | 133 | checksum = "d5a5f7b42f606b7f23674f6f4d877628350682bc40687d3fae65679a58d55345" |
134 | dependencies = [ | 134 | dependencies = [ |
135 | "semver", | 135 | "semver 0.11.0", |
136 | "serde", | 136 | "serde", |
137 | "serde_json", | 137 | "serde_json", |
138 | ] | 138 | ] |
@@ -271,17 +271,17 @@ dependencies = [ | |||
271 | 271 | ||
272 | [[package]] | 272 | [[package]] |
273 | name = "const_fn" | 273 | name = "const_fn" |
274 | version = "0.4.2" | 274 | version = "0.4.3" |
275 | source = "registry+https://github.com/rust-lang/crates.io-index" | 275 | source = "registry+https://github.com/rust-lang/crates.io-index" |
276 | checksum = "ce90df4c658c62f12d78f7508cf92f9173e5184a539c10bfe54a3107b3ffd0f2" | 276 | checksum = "c478836e029dcef17fb47c89023448c64f781a046e0300e257ad8225ae59afab" |
277 | 277 | ||
278 | [[package]] | 278 | [[package]] |
279 | name = "crc32fast" | 279 | name = "crc32fast" |
280 | version = "1.2.0" | 280 | version = "1.2.1" |
281 | source = "registry+https://github.com/rust-lang/crates.io-index" | 281 | source = "registry+https://github.com/rust-lang/crates.io-index" |
282 | checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" | 282 | checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" |
283 | dependencies = [ | 283 | dependencies = [ |
284 | "cfg-if 0.1.10", | 284 | "cfg-if 1.0.0", |
285 | ] | 285 | ] |
286 | 286 | ||
287 | [[package]] | 287 | [[package]] |
@@ -418,11 +418,11 @@ checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" | |||
418 | 418 | ||
419 | [[package]] | 419 | [[package]] |
420 | name = "flate2" | 420 | name = "flate2" |
421 | version = "1.0.18" | 421 | version = "1.0.19" |
422 | source = "registry+https://github.com/rust-lang/crates.io-index" | 422 | source = "registry+https://github.com/rust-lang/crates.io-index" |
423 | checksum = "da80be589a72651dcda34d8b35bcdc9b7254ad06325611074d9cc0fbb19f60ee" | 423 | checksum = "7411863d55df97a419aa64cb4d2f167103ea9d767e2c54a1868b7ac3f6b47129" |
424 | dependencies = [ | 424 | dependencies = [ |
425 | "cfg-if 0.1.10", | 425 | "cfg-if 1.0.0", |
426 | "crc32fast", | 426 | "crc32fast", |
427 | "libc", | 427 | "libc", |
428 | "miniz_oxide", | 428 | "miniz_oxide", |
@@ -471,9 +471,9 @@ dependencies = [ | |||
471 | 471 | ||
472 | [[package]] | 472 | [[package]] |
473 | name = "fst" | 473 | name = "fst" |
474 | version = "0.4.4" | 474 | version = "0.4.5" |
475 | source = "registry+https://github.com/rust-lang/crates.io-index" | 475 | source = "registry+https://github.com/rust-lang/crates.io-index" |
476 | checksum = "a7293de202dbfe786c0b3fe6110a027836c5438ed06db7b715c9955ff4bfea51" | 476 | checksum = "d79238883cf0307100b90aba4a755d8051a3182305dfe7f649a1e9dc0517006f" |
477 | 477 | ||
478 | [[package]] | 478 | [[package]] |
479 | name = "fuchsia-zircon" | 479 | name = "fuchsia-zircon" |
@@ -492,10 +492,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
492 | checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" | 492 | checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" |
493 | 493 | ||
494 | [[package]] | 494 | [[package]] |
495 | name = "generator" | ||
496 | version = "0.6.23" | ||
497 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
498 | checksum = "8cdc09201b2e8ca1b19290cf7e65de2246b8e91fb6874279722189c4de7b94dc" | ||
499 | dependencies = [ | ||
500 | "cc", | ||
501 | "libc", | ||
502 | "log", | ||
503 | "rustc_version", | ||
504 | "winapi 0.3.9", | ||
505 | ] | ||
506 | |||
507 | [[package]] | ||
495 | name = "gimli" | 508 | name = "gimli" |
496 | version = "0.22.0" | 509 | version = "0.23.0" |
497 | source = "registry+https://github.com/rust-lang/crates.io-index" | 510 | source = "registry+https://github.com/rust-lang/crates.io-index" |
498 | checksum = "aaf91faf136cb47367fa430cd46e37a788775e7fa104f8b4bcb3861dc389b724" | 511 | checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" |
499 | 512 | ||
500 | [[package]] | 513 | [[package]] |
501 | name = "goblin" | 514 | name = "goblin" |
@@ -723,11 +736,11 @@ dependencies = [ | |||
723 | 736 | ||
724 | [[package]] | 737 | [[package]] |
725 | name = "instant" | 738 | name = "instant" |
726 | version = "0.1.7" | 739 | version = "0.1.8" |
727 | source = "registry+https://github.com/rust-lang/crates.io-index" | 740 | source = "registry+https://github.com/rust-lang/crates.io-index" |
728 | checksum = "63312a18f7ea8760cdd0a7c5aac1a619752a246b833545e3e36d1f81f7cd9e66" | 741 | checksum = "cb1fc4429a33e1f80d41dc9fea4d108a88bec1de8053878898ae448a0b52f613" |
729 | dependencies = [ | 742 | dependencies = [ |
730 | "cfg-if 0.1.10", | 743 | "cfg-if 1.0.0", |
731 | ] | 744 | ] |
732 | 745 | ||
733 | [[package]] | 746 | [[package]] |
@@ -784,17 +797,17 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" | |||
784 | 797 | ||
785 | [[package]] | 798 | [[package]] |
786 | name = "libc" | 799 | name = "libc" |
787 | version = "0.2.79" | 800 | version = "0.2.80" |
788 | source = "registry+https://github.com/rust-lang/crates.io-index" | 801 | source = "registry+https://github.com/rust-lang/crates.io-index" |
789 | checksum = "2448f6066e80e3bfc792e9c98bf705b4b0fc6e8ef5b43e5889aff0eaa9c58743" | 802 | checksum = "4d58d1b70b004888f764dfbf6a26a3b0342a1632d33968e4a179d8011c760614" |
790 | 803 | ||
791 | [[package]] | 804 | [[package]] |
792 | name = "libloading" | 805 | name = "libloading" |
793 | version = "0.6.4" | 806 | version = "0.6.5" |
794 | source = "registry+https://github.com/rust-lang/crates.io-index" | 807 | source = "registry+https://github.com/rust-lang/crates.io-index" |
795 | checksum = "3557c9384f7f757f6d139cd3a4c62ef4e850696c16bf27924a5538c8a09717a1" | 808 | checksum = "1090080fe06ec2648d0da3881d9453d97e71a45f00eb179af7fdd7e3f686fdb0" |
796 | dependencies = [ | 809 | dependencies = [ |
797 | "cfg-if 0.1.10", | 810 | "cfg-if 1.0.0", |
798 | "winapi 0.3.9", | 811 | "winapi 0.3.9", |
799 | ] | 812 | ] |
800 | 813 | ||
@@ -826,6 +839,19 @@ dependencies = [ | |||
826 | ] | 839 | ] |
827 | 840 | ||
828 | [[package]] | 841 | [[package]] |
842 | name = "loom" | ||
843 | version = "0.3.6" | ||
844 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
845 | checksum = "a0e8460f2f2121162705187214720353c517b97bdfb3494c0b1e33d83ebe4bed" | ||
846 | dependencies = [ | ||
847 | "cfg-if 0.1.10", | ||
848 | "generator", | ||
849 | "scoped-tls", | ||
850 | "serde", | ||
851 | "serde_json", | ||
852 | ] | ||
853 | |||
854 | [[package]] | ||
829 | name = "lsp-server" | 855 | name = "lsp-server" |
830 | version = "0.4.1" | 856 | version = "0.4.1" |
831 | source = "registry+https://github.com/rust-lang/crates.io-index" | 857 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -887,9 +913,9 @@ dependencies = [ | |||
887 | 913 | ||
888 | [[package]] | 914 | [[package]] |
889 | name = "memchr" | 915 | name = "memchr" |
890 | version = "2.3.3" | 916 | version = "2.3.4" |
891 | source = "registry+https://github.com/rust-lang/crates.io-index" | 917 | source = "registry+https://github.com/rust-lang/crates.io-index" |
892 | checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" | 918 | checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" |
893 | 919 | ||
894 | [[package]] | 920 | [[package]] |
895 | name = "memmap" | 921 | name = "memmap" |
@@ -985,9 +1011,9 @@ dependencies = [ | |||
985 | 1011 | ||
986 | [[package]] | 1012 | [[package]] |
987 | name = "notify" | 1013 | name = "notify" |
988 | version = "5.0.0-pre.3" | 1014 | version = "5.0.0-pre.4" |
989 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1015 | source = "registry+https://github.com/rust-lang/crates.io-index" |
990 | checksum = "77d03607cf88b4b160ba0e9ed425fff3cee3b55ac813f0c685b3a3772da37d0e" | 1016 | checksum = "a8b946889dfdad884379cd56367d93b6d0ce8889cc027d26a69a3a31c0a03bb5" |
991 | dependencies = [ | 1017 | dependencies = [ |
992 | "anymap", | 1018 | "anymap", |
993 | "bitflags", | 1019 | "bitflags", |
@@ -1005,9 +1031,9 @@ dependencies = [ | |||
1005 | 1031 | ||
1006 | [[package]] | 1032 | [[package]] |
1007 | name = "num-integer" | 1033 | name = "num-integer" |
1008 | version = "0.1.43" | 1034 | version = "0.1.44" |
1009 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1035 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1010 | checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b" | 1036 | checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" |
1011 | dependencies = [ | 1037 | dependencies = [ |
1012 | "autocfg", | 1038 | "autocfg", |
1013 | "num-traits", | 1039 | "num-traits", |
@@ -1015,9 +1041,9 @@ dependencies = [ | |||
1015 | 1041 | ||
1016 | [[package]] | 1042 | [[package]] |
1017 | name = "num-traits" | 1043 | name = "num-traits" |
1018 | version = "0.2.12" | 1044 | version = "0.2.14" |
1019 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1045 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1020 | checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611" | 1046 | checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" |
1021 | dependencies = [ | 1047 | dependencies = [ |
1022 | "autocfg", | 1048 | "autocfg", |
1023 | ] | 1049 | ] |
@@ -1034,9 +1060,9 @@ dependencies = [ | |||
1034 | 1060 | ||
1035 | [[package]] | 1061 | [[package]] |
1036 | name = "object" | 1062 | name = "object" |
1037 | version = "0.21.1" | 1063 | version = "0.22.0" |
1038 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1064 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1039 | checksum = "37fd5004feb2ce328a52b0b3d01dbf4ffff72583493900ed15f22d4111c51693" | 1065 | checksum = "8d3b63360ec3cb337817c2dbd47ab4a0f170d285d8e5a2064600f3def1402397" |
1040 | 1066 | ||
1041 | [[package]] | 1067 | [[package]] |
1042 | name = "once_cell" | 1068 | name = "once_cell" |
@@ -1285,9 +1311,9 @@ checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" | |||
1285 | 1311 | ||
1286 | [[package]] | 1312 | [[package]] |
1287 | name = "regex" | 1313 | name = "regex" |
1288 | version = "1.4.1" | 1314 | version = "1.4.2" |
1289 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1315 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1290 | checksum = "8963b85b8ce3074fecffde43b4b0dded83ce2f367dc8d363afc56679f3ee820b" | 1316 | checksum = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c" |
1291 | dependencies = [ | 1317 | dependencies = [ |
1292 | "regex-syntax", | 1318 | "regex-syntax", |
1293 | ] | 1319 | ] |
@@ -1304,9 +1330,9 @@ dependencies = [ | |||
1304 | 1330 | ||
1305 | [[package]] | 1331 | [[package]] |
1306 | name = "regex-syntax" | 1332 | name = "regex-syntax" |
1307 | version = "0.6.20" | 1333 | version = "0.6.21" |
1308 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1334 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1309 | checksum = "8cab7a364d15cde1e505267766a2d3c4e22a843e1a601f0fa7564c0f82ced11c" | 1335 | checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189" |
1310 | 1336 | ||
1311 | [[package]] | 1337 | [[package]] |
1312 | name = "rowan" | 1338 | name = "rowan" |
@@ -1379,9 +1405,9 @@ dependencies = [ | |||
1379 | 1405 | ||
1380 | [[package]] | 1406 | [[package]] |
1381 | name = "rustc-demangle" | 1407 | name = "rustc-demangle" |
1382 | version = "0.1.17" | 1408 | version = "0.1.18" |
1383 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1409 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1384 | checksum = "b2610b7f643d18c87dff3b489950269617e6601a51f1f05aa5daefee36f64f0b" | 1410 | checksum = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232" |
1385 | 1411 | ||
1386 | [[package]] | 1412 | [[package]] |
1387 | name = "rustc-hash" | 1413 | name = "rustc-hash" |
@@ -1390,6 +1416,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
1390 | checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" | 1416 | checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" |
1391 | 1417 | ||
1392 | [[package]] | 1418 | [[package]] |
1419 | name = "rustc_version" | ||
1420 | version = "0.2.3" | ||
1421 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1422 | checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" | ||
1423 | dependencies = [ | ||
1424 | "semver 0.9.0", | ||
1425 | ] | ||
1426 | |||
1427 | [[package]] | ||
1393 | name = "ryu" | 1428 | name = "ryu" |
1394 | version = "1.0.5" | 1429 | version = "1.0.5" |
1395 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1430 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -1456,9 +1491,9 @@ dependencies = [ | |||
1456 | 1491 | ||
1457 | [[package]] | 1492 | [[package]] |
1458 | name = "scroll_derive" | 1493 | name = "scroll_derive" |
1459 | version = "0.10.3" | 1494 | version = "0.10.4" |
1460 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1495 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1461 | checksum = "6dfde5d1531034db129e95c76ac857e2baecea3443579d493d02224950b0fb6d" | 1496 | checksum = "b12bd20b94c7cdfda8c7ba9b92ad0d9a56e3fa018c25fca83b51aa664c9b4c0d" |
1462 | dependencies = [ | 1497 | dependencies = [ |
1463 | "proc-macro2", | 1498 | "proc-macro2", |
1464 | "quote", | 1499 | "quote", |
@@ -1467,16 +1502,31 @@ dependencies = [ | |||
1467 | 1502 | ||
1468 | [[package]] | 1503 | [[package]] |
1469 | name = "semver" | 1504 | name = "semver" |
1505 | version = "0.9.0" | ||
1506 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1507 | checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" | ||
1508 | dependencies = [ | ||
1509 | "semver-parser 0.7.0", | ||
1510 | ] | ||
1511 | |||
1512 | [[package]] | ||
1513 | name = "semver" | ||
1470 | version = "0.11.0" | 1514 | version = "0.11.0" |
1471 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1515 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1472 | checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" | 1516 | checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" |
1473 | dependencies = [ | 1517 | dependencies = [ |
1474 | "semver-parser", | 1518 | "semver-parser 0.10.1", |
1475 | "serde", | 1519 | "serde", |
1476 | ] | 1520 | ] |
1477 | 1521 | ||
1478 | [[package]] | 1522 | [[package]] |
1479 | name = "semver-parser" | 1523 | name = "semver-parser" |
1524 | version = "0.7.0" | ||
1525 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1526 | checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" | ||
1527 | |||
1528 | [[package]] | ||
1529 | name = "semver-parser" | ||
1480 | version = "0.10.1" | 1530 | version = "0.10.1" |
1481 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1531 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1482 | checksum = "42ef146c2ad5e5f4b037cd6ce2ebb775401729b19a82040c1beac9d36c7d1428" | 1532 | checksum = "42ef146c2ad5e5f4b037cd6ce2ebb775401729b19a82040c1beac9d36c7d1428" |
@@ -1528,11 +1578,12 @@ dependencies = [ | |||
1528 | 1578 | ||
1529 | [[package]] | 1579 | [[package]] |
1530 | name = "sharded-slab" | 1580 | name = "sharded-slab" |
1531 | version = "0.0.9" | 1581 | version = "0.1.0" |
1532 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1582 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1533 | checksum = "06d5a3f5166fb5b42a5439f2eee8b9de149e235961e3eb21c5808fc3ea17ff3e" | 1583 | checksum = "7b4921be914e16899a80adefb821f8ddb7974e3f1250223575a44ed994882127" |
1534 | dependencies = [ | 1584 | dependencies = [ |
1535 | "lazy_static", | 1585 | "lazy_static", |
1586 | "loom", | ||
1536 | ] | 1587 | ] |
1537 | 1588 | ||
1538 | [[package]] | 1589 | [[package]] |
@@ -1576,9 +1627,9 @@ version = "0.0.0" | |||
1576 | 1627 | ||
1577 | [[package]] | 1628 | [[package]] |
1578 | name = "syn" | 1629 | name = "syn" |
1579 | version = "1.0.45" | 1630 | version = "1.0.48" |
1580 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1631 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1581 | checksum = "ea9c5432ff16d6152371f808fb5a871cd67368171b09bb21b43df8e4a47a3556" | 1632 | checksum = "cc371affeffc477f42a221a1e4297aedcea33d47d19b61455588bd9d8f6b19ac" |
1582 | dependencies = [ | 1633 | dependencies = [ |
1583 | "proc-macro2", | 1634 | "proc-macro2", |
1584 | "quote", | 1635 | "quote", |
@@ -1755,9 +1806,9 @@ dependencies = [ | |||
1755 | 1806 | ||
1756 | [[package]] | 1807 | [[package]] |
1757 | name = "tracing-subscriber" | 1808 | name = "tracing-subscriber" |
1758 | version = "0.2.13" | 1809 | version = "0.2.15" |
1759 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1810 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1760 | checksum = "4ef0a5e15477aa303afbfac3a44cba9b6430fdaad52423b1e6c0dbbe28c3eedd" | 1811 | checksum = "a1fa8f0c8f4c594e4fc9debc1990deab13238077271ba84dd853d54902ee3401" |
1761 | dependencies = [ | 1812 | dependencies = [ |
1762 | "ansi_term", | 1813 | "ansi_term", |
1763 | "chrono", | 1814 | "chrono", |
diff --git a/crates/completion/src/completions/magic.rs b/crates/completion/src/completions/magic.rs index 2ac6f94a9..0c4db0199 100644 --- a/crates/completion/src/completions/magic.rs +++ b/crates/completion/src/completions/magic.rs | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | use assists::utils::{insert_use, mod_path_to_ast, ImportScope}; | 3 | use assists::utils::{insert_use, mod_path_to_ast, ImportScope}; |
4 | use either::Either; | 4 | use either::Either; |
5 | use hir::ScopeDef; | 5 | use hir::{ModuleDef, ScopeDef}; |
6 | use ide_db::imports_locator; | 6 | use ide_db::imports_locator; |
7 | use syntax::{algo, AstNode}; | 7 | use syntax::{algo, AstNode}; |
8 | 8 | ||
@@ -13,7 +13,6 @@ use crate::{ | |||
13 | 13 | ||
14 | use super::Completions; | 14 | use super::Completions; |
15 | 15 | ||
16 | // TODO kb reuse auto_import assist approach to add trait completion | ||
17 | // TODO kb add a setting toggle for this feature? | 16 | // TODO kb add a setting toggle for this feature? |
18 | pub(crate) fn complete_magic(acc: &mut Completions, ctx: &CompletionContext) -> Option<()> { | 17 | pub(crate) fn complete_magic(acc: &mut Completions, ctx: &CompletionContext) -> Option<()> { |
19 | if !(ctx.is_trivial_path || ctx.is_pat_binding_or_const) { | 18 | if !(ctx.is_trivial_path || ctx.is_pat_binding_or_const) { |
@@ -28,17 +27,18 @@ pub(crate) fn complete_magic(acc: &mut Completions, ctx: &CompletionContext) -> | |||
28 | 27 | ||
29 | let possible_imports = | 28 | let possible_imports = |
30 | imports_locator::find_similar_imports(&ctx.sema, ctx.krate?, &potential_import_name, 400) | 29 | imports_locator::find_similar_imports(&ctx.sema, ctx.krate?, &potential_import_name, 400) |
31 | .filter_map(|import_candidate| { | 30 | .filter_map(|import_candidate| match import_candidate { |
32 | Some(match import_candidate { | 31 | // when completing outside the use declaration, modules are pretty useless |
33 | Either::Left(module_def) => ( | 32 | // and tend to bloat the completion suggestions a lot |
34 | current_module.find_use_path(ctx.db, module_def)?, | 33 | Either::Left(ModuleDef::Module(_)) => None, |
35 | ScopeDef::ModuleDef(module_def), | 34 | Either::Left(module_def) => Some(( |
36 | ), | 35 | current_module.find_use_path(ctx.db, module_def)?, |
37 | Either::Right(macro_def) => ( | 36 | ScopeDef::ModuleDef(module_def), |
38 | current_module.find_use_path(ctx.db, macro_def)?, | 37 | )), |
39 | ScopeDef::MacroDef(macro_def), | 38 | Either::Right(macro_def) => Some(( |
40 | ), | 39 | current_module.find_use_path(ctx.db, macro_def)?, |
41 | }) | 40 | ScopeDef::MacroDef(macro_def), |
41 | )), | ||
42 | }) | 42 | }) |
43 | .filter_map(|(mod_path, definition)| { | 43 | .filter_map(|(mod_path, definition)| { |
44 | let mut resolution_with_missing_import = render_resolution( | 44 | let mut resolution_with_missing_import = render_resolution( |