Commit Graph

21725 Commits

Author SHA1 Message Date
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
bors[bot]
24cf957627
Merge #11951
11951: minor: Simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-04-10 18:21:54 +00:00
Lukas Wirth
7f3572fa0d Simplify 2022-04-10 20:02:06 +02:00
bors[bot]
55d7415ba4
Merge #11955
11955: Fix typo in the manual r=lnicola a=okuramasafumi

The -> There

Co-authored-by: OKURA Masafumi <masafumi.o1988@gmail.com>
2022-04-10 16:28:40 +00:00
OKURA Masafumi
afe1155e64
Fix typo in the manual
The -> There
2022-04-11 01:17:39 +09:00
bors[bot]
7720f163ae
Merge #11954
11954: Parse `for<'a>` closure syntax r=Veykril a=Veykril

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

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-04-10 15:59:38 +00:00
Lukas Wirth
d8341c5b92 Parse for<'a> closure syntax 2022-04-10 17:50:14 +02:00
bors[bot]
3b40230a32
Merge #11953
11953: fix: `extract_module` is too eager r=Veykril a=iDawer

Refactored `extract_module`.
Searching for usages and import resolving are done lazily.

Close #11944 

Co-authored-by: iDawer <ilnur.iskhakov.oss@outlook.com>
2022-04-10 13:31:33 +00:00
iDawer
6fff2c1798 extract_module: Refactor loops 2022-04-09 22:07:44 +05:00
iDawer
1e71ac286b extract_module: Resolve imports lazily 2022-04-09 16:52:53 +05:00
iDawer
031bdf2472 Refactor extract_module 2022-04-09 16:52:53 +05:00
iDawer
c2d12906b0 Clean up extract_module 2022-04-09 16:52:40 +05:00
bors[bot]
e691ae0ab2
Merge #11946
11946: internal: Revert #11912 as it parses all visited files r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-04-09 11:41:47 +00:00
Lukas Wirth
295f0c57a5 Revert #11912 as it parses all visited files 2022-04-09 13:41:06 +02:00
bors[bot]
9093941ed0
Merge #11943
11943: fix: Don't create `hir::Local`s from const path patterns r=Veykril a=Veykril

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

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-04-08 23:09:18 +00:00
Lukas Wirth
9050db2e80 fix: Don't create hir::Locals from const path patterns 2022-04-09 01:08:13 +02:00
bors[bot]
e11959a82b
Merge #11942
11942: fix: Check whether a parameter can be converted to a local r=Veykril a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11941
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-04-08 22:56:57 +00:00
Lukas Wirth
15e7112da3 fix: Check whether a parameter can be converted to a local 2022-04-09 00:55:45 +02:00
bors[bot]
399559e597
Merge #11940
11940: minor: bump lsp-server version r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-04-08 22:14:48 +00:00
Lukas Wirth
2d445de170 minor: bump lsp-server version 2022-04-09 00:13:47 +02:00
bors[bot]
63acf724fa
Merge #11938
11938: feat: improve assoc. item completion in trait impls r=jonas-schievink a=jonas-schievink

Account for macro-generated items, increase the score of these completions since they're very relevant, and allow them to trigger when the cursor is directly in the assoc. item list without requiring further input.

![screenshot-2022-04-08-18:12:06](https://user-images.githubusercontent.com/1786438/162481277-2a0d2f21-dc20-4452-804d-6370766216b6.png)

Part of https://github.com/rust-analyzer/rust-analyzer/issues/11860

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2022-04-08 18:00:41 +00:00
Jonas Schievink
22b13c8bff Make trait item completions work in a bare impl and score them 2022-04-08 19:56:41 +02:00
Jonas Schievink
cdeb6140bf Account for macros in get_missing_assoc_items 2022-04-08 18:05:34 +02:00
bors[bot]
847c552ab3
Merge #11936
11936: Ignore `Drop` and `Destruct` bounds for now r=flodiebold a=flodiebold

- `T: ~const Drop` has a special meaning in Rust 1.61 that we don't implement. (So ideally, we'd only ignore `~const Drop`, but this should be fine for now.)
- `Destruct` impls are built-in in 1.62 (current nightlies), so until the builtin impls are supported by Chalk, we ignore them as well. Since `Destruct` is implemented for everything in non-const contexts IIUC, this should also work fine.

Fixes #11932.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2022-04-08 12:34:12 +00:00
Florian Diebold
340f0fc333 Ignore Drop and Destruct bounds for now
- `T: ~const Drop` has a special meaning in Rust 1.61 that we don't implement.
  (So ideally, we'd only ignore `~const Drop`, but this should be fine
  for now.)
- `Destruct` impls are built-in in 1.62 (current nightlies as of 08-04-2022), so until
  the builtin impls are supported by Chalk, we ignore them as well.
  Since `Destruct` is implemented for everything in non-const contexts
  IIUC, this should also work fine.

Fixes #11932.
2022-04-08 14:29:43 +02:00
Laurențiu Nicola
bfa2a08da1 Update for languageclient API changes 2022-04-08 14:24:28 +03:00
Laurențiu Nicola
d3d6267112 Switch to LSP inlay hints 2022-04-08 14:10:24 +03:00