Commit graph

21601 commits

Author SHA1 Message Date
Lukas Wirth
4b4a34327e Remove duplicated crate id field from hir::Type 2022-04-15 20:14:35 +02:00
bors
7ce3ca5aab Auto merge of #11993 - jonas-schievink:adt-completions-in-block, r=jonas-schievink
fix: enable ADT keyword completions in block expressions

fixes https://github.com/rust-lang/rust-analyzer/issues/11576
2022-04-14 16:40:15 +00:00
Jonas Schievink
1fd232cd69 Enable ADT keyword completions in block expression 2022-04-14 18:39:27 +02:00
bors
ae68b68d39 Auto merge of #11992 - jonas-schievink:unresolved-primitive-module-fallback, r=jonas-schievink
fix: resolve `uN::method` even when `use std::uN;` is present

Closes https://github.com/rust-analyzer/rust-analyzer/issues/6082
2022-04-14 13:53:18 +00:00
Jonas Schievink
d764e134d5 Fallback to primitive when path doesn't resolve 2022-04-14 15:51:38 +02:00
bors
63573d47aa Auto merge of #11971 - jonas-schievink:on-type-fmt-assignments, r=jonas-schievink
feat: Add trailing `;` when typing `=` in assignment

![Peek 2022-04-12 19-41](https://user-images.githubusercontent.com/1786438/163022079-1ed114ef-7c75-490f-a8ed-731a13f0b44d.gif)

This does have a false positive to keep in mind, it will add a trailing `;` in the following snippet too, which is probably not desired:

```rust
fn is_zero(i: i32) -> bool {
    i $0 0
}
```

However, that function is unlikely to be written from the "inside out" like that, so it might be acceptable. Typically `=` is only inserted last when the author realizes that an existing expression should be assigned to some variable.
2022-04-14 12:36:17 +00:00
bors
1b15638b4d Auto merge of #11990 - jonas-schievink:improve-itemtree-prettyprint, r=jonas-schievink
internal: Improve ItemTree pretty print output

Expand `FnFlags` into what they actually mean and omit `AttrId`s, since those are sequential numbers in the item tree
2022-04-14 12:28:01 +00:00
Jonas Schievink
fbded178fa Improve ItemTree pretty print output 2022-04-14 14:24:27 +02:00
Jonas Schievink
f96fd40104 add docs 2022-04-14 13:23:19 +02:00
bors
4cee507d28 Auto merge of #11988 - jonas-schievink:expand-glob, r=jonas-schievink
minor: reenable simplify glob import test
2022-04-14 11:03:02 +00:00
Jonas Schievink
72dcfe6cc6 reenable test 2022-04-14 13:02:20 +02:00
Jonas Schievink
f5403aef96 simplify 2022-04-14 13:00:08 +02:00
bors
5620d25972 Auto merge of #11985 - Veykril:config-valid, r=Veykril
minor: Simplify config.rs a bit
2022-04-14 10:16:58 +00:00
Lukas Wirth
d7785a8fab minor: Cleanup config.rs a bit 2022-04-14 12:16:38 +02:00
bors
13f36e7397 Auto merge of #11960 - Veykril:config-valid, r=Veykril
internal: Show more project building errors to the user

Should help out with https://github.com/rust-analyzer/rust-analyzer/issues/9720
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11223
2022-04-14 09:36:08 +00:00
Lukas Wirth
b23b276310 internal: Show more project building errors to the user 2022-04-14 11:31:01 +02:00
bors
c3e757fe4b Auto merge of #11980 - atouchet:repo, r=Veykril
Update repo URL
2022-04-14 09:26:24 +00:00
bors
cf9c825c9e Auto merge of #11979 - Veykril:ci, r=lnicola
minor: Don't run CI on master branch
2022-04-14 06:36:09 +00:00
Alex Touchet
940ec0967a Update repo URL 2022-04-13 16:54:24 -07:00
bors
15844bf48c Auto merge of #11956 - fee1-dead:master, r=flodiebold
feat: allow customizing the command for running build scripts

I have tested this locally and it fixed #9201 with some small changes on the compiler side with suggestions from https://github.com/rust-analyzer/rust-analyzer/issues/9201#issuecomment-1019554086.

I have also added an environment variable `IS_RA_BUILDSCRIPT_CHECK` for crates to detect that it is a check for buildscripts, and allows defaulting to bogus values for expected environment variables.
2022-04-13 22:53:31 +00:00
Lukas Wirth
baaf18b1e1 minor: Don't run CI on master branch 2022-04-14 00:42:51 +02:00
bors
8ab26f6abc Auto merge of #11976 - Veykril:rust-lang-test, r=Veykril
minor: fix ide docs link

Let's test if bors listens to me here
bors r+
2022-04-13 17:24:18 +00:00
Deadbeef
8b60bf6764 Update CI for Rust bors 2022-04-13 16:55:10 +02:00
Jonas Schievink
99e9e52fbc Remove trailing ; when turning assignment into == comparison 2022-04-13 16:01:09 +02:00
Jonas Schievink
b9dd7db817 Add more no-op tests 2022-04-13 15:47:33 +02:00
Deadbeef
73a033e77c
feat: allow customizing the command for running build scripts 2022-04-13 23:45:51 +10:00
Lukas Wirth
62bf18cba2 minor: fix ide docs link 2022-04-13 13:22:45 +02:00
bors[bot]
ac736dc667
Merge #11974
11974: minor: prepare CI for rust-lang move r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-04-13 10:28:45 +00:00
Lukas Wirth
be34896433 minor: prepare CI for rust-lang move 2022-04-13 12:26:24 +02:00
Jonas Schievink
cde2a1de36 Add trailing ; when typing = in assignment 2022-04-12 19:39:19 +02:00
bors[bot]
14c86d5d3c
Merge #11970
11970: Bump chalk r=lnicola a=lnicola

Closes #9990, but not #6418, #10653

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2022-04-12 17:14:16 +00:00
Laurențiu Nicola
5901eddb02 Bump chalk 2022-04-12 20:10:10 +03:00
bors[bot]
7ce2df4b0a
Merge #11969
11969: fix: Add trailing `;` when completing assoc const/type in trait impl r=jonas-schievink a=jonas-schievink

Final item of https://github.com/rust-analyzer/rust-analyzer/issues/11860, thus closes https://github.com/rust-analyzer/rust-analyzer/issues/11860 🎉 

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2022-04-12 16:29:48 +00:00
Jonas Schievink
a182156517 Add trailing ; when completing assoc const/type 2022-04-12 18:28:43 +02:00
bors[bot]
a64a70ebff
Merge #11967
11967: fix: Fix trait impl completions not triggering after `fn`/`const`/`type` r=jonas-schievink a=jonas-schievink

![screenshot-2022-04-12-17:13:01](https://user-images.githubusercontent.com/1786438/162996087-56540f5e-a6be-4111-a4a5-8de21f483a5e.png)

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11467
cc https://github.com/rust-analyzer/rust-analyzer/issues/11860

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2022-04-12 16:03:12 +00:00
Jonas Schievink
3328a0a11b Fix trait impl completions' lookup_by text 2022-04-12 17:17:31 +02:00
bors[bot]
49847a25ae
Merge #11883
11883: fix(ide): move moudle directory when rename r=rainy-me a=rainy-me

fix: #10992

Added `FileSystemEdit::MoveDir` variant for move dirs. Original implemented as recursively move child mod files but had many issues like

1. left empty dir after rename file
2. only affect rust file
3. not performant

so changed to current version

Co-authored-by: rainy-me <github@yue.coffee>
2022-04-12 15:17:00 +00:00
rainy-me
3dd581b97d fix: move dir on rename mod 2022-04-12 23:01:53 +09:00
bors[bot]
12fb8ab3b2
Merge #11966
11966: minor: simplify r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2022-04-12 13:34:52 +00:00
Jonas Schievink
e66037f139 simplify 2022-04-12 15:34:12 +02:00
bors[bot]
faaec86ff0
Merge #11964
11964: internal: Show more project building errors to the user r=Veykril a=Veykril

Something very fishy is going on with the `rustc_workspace` handling, which caused this bug to only manifest in the `std` library but not other library crate... So there is either a bug there or just the fact that we seem to add duplicate dependencies (I think this is what we are doing with this right?) might be tripping something up somewhere.

cc https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/Rust-analyzer.20use.20inside.20stdlib

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-04-11 22:21:57 +00:00
Lukas Wirth
24af94b474 fix: Unset test feature in rustc source crates 2022-04-12 00:19:40 +02:00
bors[bot]
5d25d24d27
Merge #11961
11961: feature: deprioritize already-imported names in `use` items r=jonas-schievink a=jonas-schievink

![screenshot-2022-04-11-18:48:46](https://user-images.githubusercontent.com/1786438/162790376-6b133925-7cf9-46c5-b0e2-d8c3cba61d47.png)

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

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2022-04-11 16:50:00 +00:00
Jonas Schievink
63f87ff047 Deprioritize already-imported names 2022-04-11 18:48:27 +02:00
bors[bot]
b1854ceecf
Merge #11958
11958: Show config deseralization failures on start up r=Veykril a=Veykril

We now also show deserialization errors to the user when starting the server.
This PR also adds a small validation "pass" on the config that we will probably populate over time with more checks.

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

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-04-11 11:12:55 +00:00
Lukas Wirth
b90df7997d Add simplistic config validation 2022-04-11 13:10:43 +02:00
Lukas Wirth
6d7055e322 Show config deseralization failures on start up 2022-04-11 13:05:34 +02:00
bors[bot]
7a564af989
Merge #11935
11935: feat: Switch to LSP inlay hints r=lnicola a=lnicola



Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2022-04-11 09:29:15 +00:00
bors[bot]
b1c9a6ba64
Merge #11957
11957: fix panic on GAT r=flodiebold a=skyzh

Signed-off-by: Alex Chi <iskyzh@gmail.com>

This is still a workaround on GAT panic, and didn't solve the full problem. But at least we won't panic now. False positive is better than panicking and letting VSCode constantly pop out the warning 🤣

This PR is simple -- only apply the https://github.com/rust-analyzer/rust-analyzer/pull/11878 fix on const generics. For normal GATs, just follow the previous approach.

This PR fixes https://github.com/rust-analyzer/rust-analyzer/issues/11939, I've added it as a test case.

This PR didn't fully fix / https://github.com/rust-analyzer/rust-analyzer/issues/11923. But at least it won't panic now -- will only give a type mismatch error.

Not sure if it fixes / https://github.com/rust-analyzer/rust-analyzer/issues/11921, I'll test it later.

cc `@flodiebold` for review, thanks!

Co-authored-by: Alex Chi <iskyzh@gmail.com>
2022-04-11 08:03:50 +00:00
Alex Chi
51d66714ac fix panic on GAT
Signed-off-by: Alex Chi <iskyzh@gmail.com>
2022-04-11 13:52:02 +08:00