Commit graph

23500 commits

Author SHA1 Message Date
Lukas Wirth
52bc15fc1f fix: Fix proc-macro-srv search paths for Arch Linux 2022-11-18 23:32:26 +01:00
bors
e162d5800a Auto merge of #13629 - jonas-schievink:remove-dbg-selection, r=jonas-schievink
feat: Make "Remove dbg!()" assist work on selections

Fixes https://github.com/rust-lang/rust-analyzer/issues/12114
2022-11-17 16:41:51 +00:00
Jonas Schievink
cd6459e7b3 Make "Remove dbg!()" assist work on selections 2022-11-17 17:39:31 +01:00
bors
9cf5c2230d Auto merge of #13625 - lowr:fix/proc-macro-src-test, r=lnicola
internal: Update proc-macro-srv tests

Should have been included in #13548, but I didn't notice as those tests aren't run in our CI.

cc rust-lang/rust#104454
2022-11-16 17:10:59 +00:00
Ryo Yoshida
7577c44c65
Update proc-macro-srv tests 2022-11-17 01:42:56 +09:00
bors
92e393cc40 Auto merge of #13624 - lowr:fix/unsize-array-inference-variable, r=lnicola
fix: resolve inference variable before applying adjustments

Fixes #13619
2022-11-16 11:07:18 +00:00
Ryo Yoshida
1ad11b5366
fix: resolve inference variable before applying adjustments 2022-11-16 20:01:55 +09:00
bors
0dd0dfb7df Auto merge of #13615 - mati865:miow-update, r=jonas-schievink
Update several crates to bring support for the new Tier 3 Windows tar…

`cargo t` has passed on Windows 11 with both `x86_64-pc-windows-gnu` and `x86_64-pc-windows-gnullvm` targets.
2022-11-15 11:59:27 +00:00
bors
8292dd8026 Auto merge of #13623 - jonas-schievink:strip-trait-item-completions, r=jonas-schievink
fix: Strip comments and attributes off of all trait item completions

Previously, this was done in several places redundantly, but not for all items. It was also untested. This PR fixes that.
2022-11-15 11:45:02 +00:00
Jonas Schievink
7e77d4e310 Strip comments and attributes off of all trait item completions 2022-11-15 12:41:39 +01:00
bors
a516b90dee Auto merge of #13622 - jonas-schievink:fix-gat-completions, r=jonas-schievink
fix: include generic parameter in GAT completions

Fixes https://github.com/rust-lang/rust-analyzer/issues/13586
2022-11-15 11:10:34 +00:00
Jonas Schievink
15dfeabb96 Fix GAT completion not including generic parameters 2022-11-15 12:05:11 +01:00
Mateusz Mikuła
46417add8d Update several crates to bring support for the new Tier 3 Windows targets 2022-11-13 22:45:09 +01:00
bors
45ec315e01 Auto merge of #13607 - Veykril:proc-macro-error, r=Veykril
internal: Add version info to unsupported proc macro abi error

cc https://github.com/rust-lang/rust-analyzer/issues/13589#issuecomment-1311824473
2022-11-11 15:57:30 +00:00
Lukas Wirth
6b4b7d81e4 internal: Add version info to unsupported proc macro abi error 2022-11-11 16:57:05 +01:00
bors
2656303c83 Auto merge of #13606 - Veykril:trait-alias, r=Veykril
fix: Add trait alias grammar to rust.ungram

We already parse them, but the grammar was never updated to reflect that
2022-11-11 14:26:15 +00:00
Lukas Wirth
6674bd898e fix: Add trait alias grammar to rust.ungram 2022-11-11 15:25:15 +01:00
bors
d3531e8ce6 Auto merge of #13605 - Veykril:empty-ws-error, r=Veykril
fix: Fix r-a eagerly showing no discovered workspace errors
2022-11-11 13:37:27 +00:00
Lukas Wirth
a143ff0248 fix: Fix r-a eagerly showing no discovered workspace errors 2022-11-11 14:36:27 +01:00
bors
add85397ae Auto merge of #13604 - Veykril:hover-attr, r=Veykril
fix: Fix hover in attributed items not preferring similar kinded tokens
2022-11-11 12:48:48 +00:00
Lukas Wirth
e50712cf2c fix: Fix hover in attributed items not preferring similar kinded tokens 2022-11-11 13:38:07 +01:00
bors
57cc2a6e27 Auto merge of #13602 - lowr:fix/nameres-transitive-visibility, r=Veykril
fix: check visibility of each path segment

Upon path resolution, we have not been checking if every def pointed to by each segment of the path is visible from the original module. This leads to incorrect import resolutions, in particular when one uses glob imports and names collide.

There is decent amount of changes in this PR because:
- some of our tests were not correct in terms of visibility
  - I left several basic nameres tests as-is (with expect test updated) since I thought it would be nice to ensure we don't resolve defs that are not visible.
- `fix_visibility` assist relied on `Semantics::resolve_path()`, which uses the name resolution procedure I'm fixing and wouldn't be able to "see through" the items with strict visibility with this patch

The first commit is the gist of the fix itself.

Fixes #10991
Fixes #11473
Fixes #13252
2022-11-11 12:32:21 +00:00
bors
6f313cef8e Auto merge of #13548 - lowr:fix/tt-punct-spacing, r=Veykril
Fix `tt::Punct`'s spacing calculation

Fixes #13499

We currently set a `tt::Punct`'s spacing to `Spacing::Joint` unless its next token is a trivia (i.e. whitespaces or comment). As I understand it, rustc only [sets `Spacing::Joint` if the next token is an operator](5b3e909075/compiler/rustc_parse/src/lexer/tokentrees.rs (L77-L78)) and we should follow it to guarantee the consistent behavior of proc macros.
2022-11-11 12:19:30 +00:00
bors
ff78d24e21 Auto merge of #13603 - Veykril:no-workspaces, r=Veykril
fix: Send status notification if there are no found workspaces

Closes https://github.com/rust-lang/rust-analyzer/issues/5829
2022-11-11 12:01:52 +00:00
Lukas Wirth
e35836eb81 Send status notification if there are no found workspaces 2022-11-11 13:00:22 +01:00
Ryo Yoshida
19306c070d
Fix tests that depended on loose visibility restriction 2022-11-11 20:31:46 +09:00
Ryo Yoshida
e75afebeb2
Resolve invisible defs in fix_visibility assist 2022-11-11 20:31:44 +09:00
Ryo Yoshida
dea49d0826
fix: check visibility of each segment in path resolution 2022-11-11 20:31:37 +09:00
Ryo Yoshida
5b07061011
Test TokenTrees' equality modulo Puncts' spacing 2022-11-10 19:40:40 +09:00
Ryo Yoshida
4f415fc348
Ignore outermost non-delimited Subtree when reversing fixups 2022-11-10 19:22:20 +09:00
bors
599142c34a Auto merge of #13590 - Veykril:proc-macro-rustc-src, r=Veykril
internal: Add proc-macro dependency to rustc_private crates
2022-11-09 19:51:20 +00:00
Lukas Wirth
3c35d44f55 Add proc-macro dependency to rustc_private crates 2022-11-09 20:50:18 +01:00
bors
392784ad17 Auto merge of #13584 - jonas-schievink:fix-signature-panic, r=jonas-schievink
fix: fix panic when computing signature of generic `FnOnce` callable

Fixes https://github.com/rust-lang/rust-analyzer/issues/13579
2022-11-08 17:27:13 +00:00
Jonas Schievink
9be0615bde Don't canonicalize self type when querying FnOnce signature 2022-11-08 18:05:07 +01:00
bors
977a029c1e Auto merge of #13582 - lnicola:nest-cargo-toml, r=lnicola
feat: Nest Cargo.lock under Cargo.toml in Code

Closes #13580
2022-11-08 08:44:43 +00:00
Laurențiu Nicola
4403dde711 Nest Cargo.lock under Cargo.toml in Code 2022-11-08 09:57:05 +02:00
bors
236c1167cc Auto merge of #13581 - Veykril:unit-struct-compl, r=Veykril
fix: Fix item completions not working properly after unit structs and outline modules

Fixes https://github.com/rust-lang/rust-analyzer/issues/13578
2022-11-08 07:38:13 +00:00
Lukas Wirth
90e2db8126 fix: Fix item completions not working properly after unit structs and outline modules 2022-11-08 08:37:45 +01:00
bors
b8b1951ee8 Auto merge of #13573 - Veykril:invalid-file-range, r=Veykril
internal: error instead of panic on invalid file range

Fixes the panic in https://github.com/rust-lang/rust-analyzer/issues/13170
2022-11-07 16:45:26 +00:00
Lukas Wirth
1cb6ab89ee internal: error instead of panic on invalid file range 2022-11-07 17:45:12 +01:00
bors
0aa0da9dda Auto merge of #13572 - Veykril:cancellable, r=Veykril
internal: Use Cancellable in favor of Result for clarity
2022-11-07 16:22:33 +00:00
Lukas Wirth
fa70b0a86e internal: Use Cancellable in favor of Result for clarity 2022-11-07 17:21:37 +01:00
bors
a27e4dad37 Auto merge of #13571 - Veykril:unique-references, r=Veykril
minor: Deduplicate reference search results

Fixes https://github.com/rust-lang/rust-analyzer/issues/13407
2022-11-07 15:49:54 +00:00
Lukas Wirth
6a06f6f724 Deduplicate reference search results 2022-11-07 16:48:50 +01:00
bors
d1c9775171 Auto merge of #13568 - noritada:fix/len-of-byte-string-with-escaped-newlines, r=Veykril
Fix the length displayed for byte string literals with escaped newlines

This is a fix for the problem I reported earlier: "the length of byte strings containing escaped newlines is displayed two bytes longer when the first escaped character is a newline".

I would appreciate it if you could review the fix.
Many thanks.

Closes #13567
2022-11-07 15:04:40 +00:00
bors
8a633fe986 Auto merge of #13570 - Veykril:dedup-crates-for, r=Veykril
minor: Remove code duplication
2022-11-07 14:52:05 +00:00
Lukas Wirth
b169e1e5de Remove code duplication 2022-11-07 15:49:26 +01:00
Noritada Kobayashi
2340d7059e Add test code for unescaping byte strings 2022-11-07 23:39:02 +09:00
bors
b0e56ef5e8 Auto merge of #13545 - Veykril:adjustment-hints, r=Veykril
Generalize reborrow hints as adjustment hints

Like reborrow hints, these are still mainly useful for teaching/learning

![image](https://user-images.githubusercontent.com/3757771/200073606-b5cd3b95-a9ad-454d-a3c4-d4d89bf45928.png)
2022-11-07 14:38:59 +00:00
bors
3a839ea22e Auto merge of #13569 - Veykril:rust-version, r=Veykril
Bump Cargo rust-version fields to latest stable

We already depend on `let ... else` now anyways

Closes https://github.com/rust-lang/rust-analyzer/issues/13562
2022-11-07 14:21:31 +00:00