Commit Graph

23470 Commits

Author SHA1 Message Date
bors
0468d84564 Auto merge of #12384 - fasterthanlime:gh-12372, r=Veykril
Generate variant: insert code in file with enum definition

Closes #12372
2022-05-25 14:49:51 +00:00
Amos Wenger
89e27ed0b9 Generate variant: insert code in file with enum definition
Closes #12372
2022-05-25 16:43:15 +02:00
bors
c13f04dcaa Auto merge of #12383 - Veykril:diag, r=Veykril
fix: Clear native diagnostics for files when they are deleted

Fixes https://github.com/rust-lang/rust-analyzer/issues/7004
2022-05-25 13:48:14 +00:00
Lukas Wirth
5410ace1fe fix: Clear native diagnostics for files when they are deleted 2022-05-25 15:47:41 +02:00
bors
3fe137a5b5 Auto merge of #12382 - Veykril:ontype, r=lnicola
internal: Make autoclosing angle brackets configurable, disabled by default

cc https://github.com/rust-lang/rust-analyzer/issues/12379
2022-05-25 11:29:50 +00:00
Lukas Wirth
f02c915eb5 internal: Make autoclosing angle brackets configurable, disabled by default 2022-05-25 12:42:07 +02:00
bors
d7c147406e Auto merge of #12377 - Veykril:logs, r=Veykril
minor: log build script invocations
2022-05-24 21:10:32 +00:00
bors
161ab76008 Auto merge of #12376 - Veykril:completion, r=Veykril
fix: Insert whitespace into trait-impl completions when coming from macros

Fixes https://github.com/rust-lang/rust-analyzer/issues/12278
2022-05-24 20:57:05 +00:00
Lukas Wirth
7274a48657 minor: log build script invocations 2022-05-24 22:56:49 +02:00
Lukas Wirth
86d1d9067e fix: Insert whitespace into trait-impl completions when coming from macros 2022-05-24 22:56:33 +02:00
Lukas Wirth
6f006b7524 Simplify 2022-05-24 21:58:47 +02:00
bors
4ca47b3432 Auto merge of #12373 - Veykril:completion, r=Veykril
internal: Refactor our record pat/expr handling in completion context
2022-05-24 11:26:04 +00:00
Lukas Wirth
6a8b8a6039 internal: Refactor our record pat/expr handling in completion context 2022-05-24 13:24:36 +02:00
bors
7a4994d948 Auto merge of #12361 - Veykril:completion, r=Veykril
internal: Simplify DotAccess representation in completions

`@bors` r+
2022-05-24 09:55:13 +00:00
Lukas Wirth
697ade6f8d internal: Simplify DotAccess representation in completions 2022-05-24 11:54:50 +02:00
bors
d5965aa871 Auto merge of #12370 - andylizi:macro-expand-underscore, r=lnicola
ide: insert whitespaces surrounding `_` in macro expansion

#### Before

```rust
for_in 0..10 {
  foo();
}
```

#### After

```rust
for _ in 0..10 {
  foo();
}
```
2022-05-24 06:52:00 +00:00
andylizi
e34ae760f0
add test for macro expand formatting 2022-05-24 12:45:58 +08:00
bors
cc8140a7c7 Auto merge of #12371 - jhgg:fix/extra-env-non-string-value-handling, r=lnicola
vscode: fix extraEnv handling numeric values

fixes #12363 by bringing the types more inline with the reality, and making `Env` not a lie.
2022-05-24 04:11:19 +00:00
Jake Heinz
b8ee992b57 prettier 2022-05-24 03:11:30 +00:00
Jake Heinz
d1aa6d3216 vscode: fix extraEnv handling numeric values 2022-05-24 03:00:29 +00:00
andylizi
ebf8b1a96e
ide: insert whitespaces surrounding _ in macro expansion 2022-05-24 07:54:43 +08:00
bors
81805d4cfc Auto merge of #12366 - rust-lang:revert-12349-universal-vsix, r=lnicola
Revert "internal: Publish universal VSIX to make VS happy"

Reverts rust-lang/rust-analyzer#12349
2022-05-23 20:55:29 +00:00
Laurențiu Nicola
0ab4a5f90b
Revert "internal: Publish universal VSIX to make VS happy" 2022-05-23 23:45:46 +03:00
bors
ac69da8db7 Auto merge of #12365 - rust-lang:revert-12359-universal-vsix-part-2, r=lnicola
Revert "internal: Try to publish the universal VSIX before the other ones"

Reverts rust-lang/rust-analyzer#12359
2022-05-23 20:45:03 +00:00
Laurențiu Nicola
04587b4b1a
Revert "internal: Try to publish the universal VSIX before the other ones" 2022-05-23 23:44:08 +03:00
bors
7be85a5b4a Auto merge of #12359 - lnicola:universal-vsix-part-2, r=lnicola
internal: Try to publish the universal VSIX before the other ones

CC https://github.com/microsoft/vscode/issues/149518#issuecomment-1134782535
2022-05-23 15:43:19 +00:00
bors
402dba8d04 Auto merge of #12360 - Veykril:completion, r=Veykril
fix: Fix completions not working after attributes

Closes https://github.com/rust-lang/rust-analyzer/issues/12259
2022-05-23 15:24:10 +00:00
Lukas Wirth
2aa22730f1 fix: Fix completions not working after attributes 2022-05-23 17:22:48 +02:00
Laurențiu Nicola
abc541e496 Try to publish the universal VSIX before the other ones 2022-05-23 18:11:17 +03:00
bors
8e8aa7bb26 Auto merge of #12358 - Veykril:hl-mac, r=Veykril
minor: Simplify syntax-highlighting macro checks
2022-05-23 15:04:12 +00:00
Lukas Wirth
9f6d99c6bd minor: Simplify syntax-highlighting macro checks 2022-05-23 17:03:19 +02:00
bors
db9930b986 Auto merge of #12357 - Veykril:find-ref-macro, r=Veykril
fix: When reference searching macro inputs, don't search everything that was downmapped

Fixes https://github.com/rust-lang/rust-analyzer/issues/11668
2022-05-23 14:12:35 +00:00
Lukas Wirth
377c9247e6 fix: When hovering macro inputs, don't show everything that was downmapped 2022-05-23 16:11:36 +02:00
Lukas Wirth
ad537be194 fix: When reference searching macro inputs, don't search everything that was downmapped 2022-05-23 16:09:56 +02:00
bors
238253c22d Auto merge of #12355 - ruabmbua:fix-inference-pattern-wildcards, r=flodiebold
Fix inference when pattern matching a tuple field with a wildcard

This should fix the following issue:  https://github.com/rust-lang/rust-analyzer/issues/12331

* Replaced the `err_ty` in `infer_pat()` with a new type variable.
* Had to change the iterator code a bit, to get around multiple mutable borrows of `self` in `infer_pat()`.
Also added a test
* Also added a test
2022-05-23 10:38:19 +00:00
Roland Ruckerbauer
86bb27f1a4 Fix inference when pattern matching a tuple field with a wildcard. 2022-05-23 12:24:54 +02:00
bors
c626034f11 Auto merge of #12354 - domenicquirl:reload-docs-typo, r=domenicquirl
Fix typo in new `reload.rs` docs

Just skimmed today's changelog and came across the repetition
2022-05-23 08:33:32 +00:00
DQ
f3a5475082
Keep the other is in reload.rs docs 2022-05-23 10:29:03 +02:00
DQ
914ff6a395
Fix typo in new reload.rs docs
Just skimmed today's changelog and came across the repetition
2022-05-23 09:35:32 +02:00
bors
e68c9f83d8 Auto merge of #12350 - umanwizard:fix_bsd, r=lnicola
Fix build on OpenBSD (and probably other BSDs too)

notify-5.0.0-pre.14 does not build on these systems; this was fixed in
41a74f0e98 , which landed in pre.15.
2022-05-23 06:16:56 +00:00
Brennan Vincent
364dd5ff89 Fix build on OpenBSD (and probably other BSDs too)
notify-5.0.0-pre.14 does not build on these systems; this was fixed in
41a74f0e98 , which landed in pre.15.
2022-05-22 17:04:57 -04:00
bors
84be2eaf99 Auto merge of #12349 - lnicola:universal-vsix, r=lnicola
internal: Publish universal VSIX to make VS happy
2022-05-22 18:16:57 +00:00
Laurențiu Nicola
f50afe1b39 Publish universal VSIX to make VS happy 2022-05-22 21:13:14 +03:00
bors
4b0f9c588d Auto merge of #12334 - fasterthanlime:gh-11635, r=Veykril
Generate enum variant assist

So, this is kind of a weird PR!

I'm a complete newcomer to the `rust-analyzer` codebase, and so I browsed the "good first issue" tag, and found #11635. Then I found two separate folks had taken stabs at it, most recently `@maartenflippo` — and there had been a review 3 days ago, but no activity in a little while, and the PR needed to be rebased since the crates were renamed from `snake_case` to `kebab-case`.

So to get acquainted with the codebase I typed this PR by hand, looking at the diff in #11995, and I also added a doc-test (that passes).

I haven't taken into account the comments `@Veykril` left in #11995, but I don't want to steal any of `@maartenflippo's` thunder! Closing this PR is perfectly fine. Or Maarten could use it as a "restart point"? Or I could finish it up, whichever feels best to everyone.

I think what remains to be done in this PR, at least, is:

  * [x] Only disable the "generate function" assist if the name is `PascalCase`
  * [x] Only enable the "generate variant" assistant if the name is `PascalCase`
  * [x] Simplify with `adt.source()` as mentioned here: https://github.com/rust-lang/rust-analyzer/pull/11995#discussion_r875134175
  * [ ] Add more tests for edge cases? Are there cases where simply adding one more indent level than the enum's indent level is not good enough? Some nested trickery I'm not thinking of right now?

Anyway. This PR can go in any direction. You can tell me "no, tackle your own issue!" And I'll go do that and still be happy I got to take a look at rust-analyzer some by doing this. Or you can tell me "okay, now _you_ finish it", and I guess I'll try and finish it :)

Closes #11635
2022-05-22 17:01:26 +00:00
Amos Wenger
ae2c0db67f Pull text creation into the closure 2022-05-22 18:38:14 +02:00
Amos Wenger
796c4d8a10 Better lowercase/uppercase checks 2022-05-22 18:31:12 +02:00
bors
65a213c9fa Auto merge of #12281 - lnicola:increase-overflow-depth, r=lnicola
Increase defalt chalk overflow depth to match max solver size

TBC:

 - #12279: ok above 480
 - ~~#12182~~
 - ~~#12095~~
 - #11902: ok above 350
 - ~~#11668~~
 - #11370: ok above 450
 - #9754: probably ok above 250 (!), and the code in cause and branch are gone

Closes #12279
Closes #11902
Closes #11370
Closes #9754
2022-05-22 15:14:26 +00:00
Laurențiu Nicola
8b56d42db9 Increase defalt chalk overflow depth to match max solver size 2022-05-22 18:10:38 +03:00
feniljain
89f449b75d fix(extract_module): import resolution for items of submodules 2022-05-22 17:11:15 +05:30
bors
038a71a201 Auto merge of #12345 - bvanjoi:escape_format_spcifier, r=Veykril
feat: escape format specifier(close: #12258)

solve https://github.com/rust-lang/rust-analyzer/issues/12258
2022-05-22 10:41:31 +00:00