Commit graph

6822 commits

Author SHA1 Message Date
bors[bot]
36353bb182
Merge #4833
4833: Separating parsing of `for` in predicates and types r=matklad a=matthewjasper

We now correctly accept `for<'a> (&'a F): Fn(&'a str)` in a where clause and correctly reject `for<'a> &'a u32` as a type.

Co-authored-by: Matthew Jasper <mjjasper1@gmail.com>
2020-06-11 17:33:20 +00:00
Matthew Jasper
8622e4cc1b Add example of old trait object syntax 2020-06-11 18:15:03 +01:00
Matthew Jasper
879693e63c Move complex inline test to own file 2020-06-11 18:14:57 +01:00
bors[bot]
bd61ad756c
Merge #4849
4849: Make known paths use `core` instead of `std` r=matklad a=jonas-schievink

I'm not sure if this causes problems today, but it seems like it easily could, if rust-analyzer processes the libstd sources for the right `--target` and that target is a `#![no_std]`-only target.

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2020-06-11 15:30:05 +00:00
Jonas Schievink
215e229dd1 Update wrap return tests
Update "no diagnostic" tests, use `()` instead of `String`
2020-06-11 17:28:32 +02:00
bors[bot]
7c617000b8
Merge #4850
4850: Indent chain `.` even if there's more stuff afterwards r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-06-11 15:20:24 +00:00
Aleksey Kladov
279a1ae564 Indent chain . even if there's more stuff afterwards 2020-06-11 17:13:24 +02:00
Jonas Schievink
90331ea035 Make known paths use core instead of std 2020-06-11 16:23:20 +02:00
Aleksey Kladov
663ce0e99d Remove dead code 2020-06-11 13:34:09 +02:00
bors[bot]
32157d48f4
Merge #4843
4843: Don't guess macro expansion crate r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-06-11 10:18:53 +00:00
Aleksey Kladov
fac7b0e252 Don't guess macro expansion crate 2020-06-11 12:13:14 +02:00
bors[bot]
f320c38aec
Merge #4819
4819: Add an FST index to `ImportMap` and use it to speed up auto import r=matklad a=jonas-schievink

For the importing crate, we still use the symbol index, but I've modified it to only look at files that comprise that crate (instead of the whole workspace).

Oh, and since now the symbol query limit is respected correctly, it's possible that some results from the local crate now disappear if there are many matches.

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/4763

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2020-06-11 10:07:52 +00:00
Jonas Schievink
6766a6b0e1 Add symbol index FIXME 2020-06-11 12:03:08 +02:00
Aleksey Kladov
d8a5d39c2d Make relevant_crates return a Set 2020-06-11 11:30:06 +02:00
Jonas Schievink
dd22657407 ImportMap: use IndexMap internally
It iterates in insertion order, which makes the ordering more
predictable.
2020-06-10 16:15:49 +02:00
Jonas Schievink
7e83ed99a8 Respect casing when searching for imports 2020-06-10 16:04:55 +02:00
Jonas Schievink
ed2817e599 Move limit check down 2020-06-10 12:40:33 +02:00
Jonas Schievink
56c7145993 Limit import map queries 2020-06-10 12:40:33 +02:00
Jonas Schievink
bcf875f46a Clean up import_map.rs 2020-06-10 12:38:58 +02:00
Jonas Schievink
781b514e58 Add test for macro generated items 2020-06-10 12:38:58 +02:00
Jonas Schievink
a70a0ca73c ImportsLocator: use ImportMap for non-local crates 2020-06-10 12:38:58 +02:00
Jonas Schievink
b01fb22494 ra_hir: expose import_map::search_dependencies 2020-06-10 12:38:58 +02:00
Jonas Schievink
6463d3ac63 symbol_index: allow querying a single crate 2020-06-10 12:38:58 +02:00
Jonas Schievink
4bcf8c8c68 Add an FST index to ImportMap 2020-06-10 12:38:58 +02:00
Jonas Schievink
54936e8aa2 Fix the symbol query limit 2020-06-10 12:38:58 +02:00
Jonas Schievink
d50a1a0fe9 Profile world_symbols 2020-06-10 12:38:58 +02:00
bors[bot]
f632727b2a
Merge #4834
4834: In field patterns, don't highlight local binding as a field r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-06-10 10:37:27 +00:00
Aleksey Kladov
db1cadd444 In field patterns, don't highlight local binding as a field 2020-06-10 12:34:23 +02:00
Matthew Jasper
506e1ddbfa Separating parsing of for in predicates and types 2020-06-10 11:30:58 +01:00
Aleksey Kladov
27ebe5d33e Reduce OUT_DIR special casing 2020-06-10 12:08:35 +02:00
bors[bot]
560b98bc50
Merge #4822
4822: Let checkOnSafe default to some of the options of cargo r=matklad a=clemenswasser

This will fix #4631
The implementation works (as far as I have tested) but is suboptimal because I am copying the "cargo.features".

Co-authored-by: Clemens Wasser <clemens.wasser@gmail.com>
2020-06-10 07:39:44 +00:00
Clemens Wasser
fe21fc2d25 checkOnSafe.features and checkOnSafe.allFeatures now work identically. 2020-06-10 09:37:26 +02:00
Clemens Wasser
33b9058838 Most of the checkOnSafe options now default to the cargo equivalent. 2020-06-10 09:27:25 +02:00
Clemens Wasser
47ef544fa5 Added the rust-analyzer.checkOnSave.features option. 2020-06-10 08:51:11 +02:00
bors[bot]
c9fc7251ca
Merge #4824
4824: Correct "debug_assertion" to "debug_assertions" to match the cfg that the rust debug assert macros use. r=matklad a=woody77

This is for #4823.

Co-authored-by: Aaron Wood <aaronwood@google.com>
2020-06-10 05:24:18 +00:00
Aaron Wood
f4ed2da966 Correct "debug_assertion" to "debug_assertions" to match the cfg
option that the rust debug assert macros use.
2020-06-09 19:58:39 -07:00
Clemens Wasser
684b6fa1b8 flycheck now uses the configured features 2020-06-09 21:47:54 +02:00
Aleksey Kladov
e8d50578ab Correctly parse <_> paths in patterns
closes #3659
2020-06-09 13:45:18 +02:00
Aleksey Kladov
16943e533c Minor, use T! 2020-06-09 13:45:11 +02:00
bors[bot]
d4d384e4c8
Merge #4813
4813: Simplify r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-06-09 11:22:38 +00:00
Aleksey Kladov
d8571e076c Simplify 2020-06-09 13:17:22 +02:00
bors[bot]
eb53f5a9e5
Merge #4812
4812: Use correct indent when replacing with match r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-06-09 11:14:30 +00:00
Aleksey Kladov
8cad7d1a2b Use correct indent when replacing with match 2020-06-09 12:38:47 +02:00
bors[bot]
382d10ea60
Merge #4811
4811: Unwrap block works with match arms r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-06-09 10:12:50 +00:00
Aleksey Kladov
53cc2c16e7 Unwrap block works with match arms 2020-06-09 11:52:45 +02:00
bors[bot]
4cacedd3de
Merge #4810
4810: Simplify unwrapping of blocks r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-06-09 09:33:56 +00:00
Aleksey Kladov
5233766ce5 Simplify unwrapping of blocks 2020-06-09 11:33:28 +02:00
bors[bot]
6f0cc91c88
Merge #4803
4803: Parse default unsafe fn r=matklad a=Avi-D-coder



Co-authored-by: Avi Dessauer <avi.the.coder@gmail.com>
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-06-09 08:56:28 +00:00
Aleksey Kladov
2785362a1f
Update crates/ra_parser/src/grammar/items.rs 2020-06-09 10:50:25 +02:00
Aaron Wood
055b9b64bc Finish transition to cfgs from the separate atoms and features. 2020-06-08 16:19:39 -07:00