Commit Graph

23772 Commits

Author SHA1 Message Date
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
yue4u
f26d5484d8 fix: filter unnecessary completions after colon 2022-11-12 22:33:40 +09: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
Alexis (Poliorcetics) Bourget
0d4737adb6 feat: Support passing multiple targets to cargo (for Rust 1.64.0+) 2022-11-11 14:36:07 +01:00
Alexis (Poliorcetics) Bourget
c6c932d3f3 chore: Align config property 2022-11-11 14:36:07 +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
Michael Goulet
61c744d4fd Rollup merge of #104211 - lnicola:rust-analyzer-2022-11-09, r=lnicola
⬆️ rust-analyzer

r? ``@ghost``
2022-11-09 21:53:38 -08: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
Laurențiu Nicola
79923c382a ⬆️ rust-analyzer 2022-11-09 21:49:10 +02:00
Dylan DPC
a65ca91b84 Rollup merge of #103919 - nnethercote:unescaping-cleanups, r=matklad
Unescaping cleanups

Some code improvements, and some error message improvements.

Best reviewed one commit at a time.

r? ````@matklad````
2022-11-09 19:21:22 +05:30
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
Noritada Kobayashi
bdf8547013 Clarify the intent
Thanks to Lukas Wirth for a suggestion.
2022-11-07 22:51:29 +09:00
Lukas Wirth
ffd7bf8bf9 Bump Cargo rust-version fields to latest stable 2022-11-07 12:59:51 +01:00
Lukas Wirth
ee2dd934ca Don't trigger adjustment hints in all inlay hint tests 2022-11-07 12:49:52 +01:00