]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoAuto merge of #12399 - Joehoel:patch-1, r=lnicola
bors [Thu, 26 May 2022 18:15:54 +0000 (18:15 +0000)]
Auto merge of #12399 - Joehoel:patch-1, r=lnicola

typo: missing comma

2 years agotypo: missing comma
Joël Kuijper [Thu, 26 May 2022 18:12:43 +0000 (20:12 +0200)]
typo: missing comma

2 years agoAuto merge of #12397 - Hofer-Julian:patch-1, r=lnicola
bors [Thu, 26 May 2022 17:14:55 +0000 (17:14 +0000)]
Auto merge of #12397 - Hofer-Julian:patch-1, r=lnicola

Fix typo

2 years agoFix typo
Hofer-Julian [Thu, 26 May 2022 17:12:49 +0000 (19:12 +0200)]
Fix typo

2 years agoAuto merge of #12393 - Veykril:hir-def, r=Veykril
bors [Thu, 26 May 2022 11:01:08 +0000 (11:01 +0000)]
Auto merge of #12393 - Veykril:hir-def, r=Veykril

internal: Remove `Interned` usage from nameres collector

2 years agointernal: Remove `Interned` usage from nameres collector
Lukas Wirth [Thu, 26 May 2022 10:59:57 +0000 (12:59 +0200)]
internal: Remove `Interned` usage from nameres collector

2 years agoAuto merge of #12388 - Veykril:statusitem, r=Veykril
bors [Thu, 26 May 2022 10:31:23 +0000 (10:31 +0000)]
Auto merge of #12388 - Veykril:statusitem, r=Veykril

internal: Make use of the statusBarItem colors in VSCode

Fixes https://github.com/rust-lang/rust-analyzer/issues/7736

2 years agointernal: Use statusBarItem colors for status item in VSCode
Lukas Wirth [Thu, 26 May 2022 10:31:07 +0000 (12:31 +0200)]
internal: Use statusBarItem colors for status item in VSCode

2 years agoAuto merge of #12386 - fasterthanlime:gh-12372-test, r=Veykril
bors [Wed, 25 May 2022 16:42:29 +0000 (16:42 +0000)]
Auto merge of #12386 - fasterthanlime:gh-12372-test, r=Veykril

Add test for #12372 (generate enum variant in different file)

The test currently fails but I'm not sure why.

The "Right" output seems to contain only the contents of `foo.rs`, without the magic comments:

<img width="967" alt="image" src="https://user-images.githubusercontent.com/7998310/170310707-e69b21eb-d4f8-46c1-8a0a-9b4071289e26.png">

cc `@Veykril`

2 years agoMake test pass
Amos Wenger [Wed, 25 May 2022 16:31:08 +0000 (18:31 +0200)]
Make test pass

2 years agoAdd test for #12372 (generate enum variant in different file)
Amos Wenger [Wed, 25 May 2022 16:18:08 +0000 (18:18 +0200)]
Add test for #12372 (generate enum variant in different file)

2 years agoAuto merge of #12384 - fasterthanlime:gh-12372, r=Veykril
bors [Wed, 25 May 2022 14:49:51 +0000 (14:49 +0000)]
Auto merge of #12384 - fasterthanlime:gh-12372, r=Veykril

Generate variant: insert code in file with enum definition

Closes #12372

2 years agoGenerate variant: insert code in file with enum definition
Amos Wenger [Wed, 25 May 2022 14:43:14 +0000 (16:43 +0200)]
Generate variant: insert code in file with enum definition

Closes #12372

2 years agoAuto merge of #12383 - Veykril:diag, r=Veykril
bors [Wed, 25 May 2022 13:48:14 +0000 (13:48 +0000)]
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

2 years agofix: Clear native diagnostics for files when they are deleted
Lukas Wirth [Wed, 25 May 2022 13:47:41 +0000 (15:47 +0200)]
fix: Clear native diagnostics for files when they are deleted

2 years agoAuto merge of #12382 - Veykril:ontype, r=lnicola
bors [Wed, 25 May 2022 11:29:50 +0000 (11:29 +0000)]
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

2 years agointernal: Make autoclosing angle brackets configurable, disabled by default
Lukas Wirth [Wed, 25 May 2022 10:15:36 +0000 (12:15 +0200)]
internal: Make autoclosing angle brackets configurable, disabled by default

2 years agoAuto merge of #12377 - Veykril:logs, r=Veykril
bors [Tue, 24 May 2022 21:10:32 +0000 (21:10 +0000)]
Auto merge of #12377 - Veykril:logs, r=Veykril

minor: log build script invocations

2 years agoAuto merge of #12376 - Veykril:completion, r=Veykril
bors [Tue, 24 May 2022 20:57:05 +0000 (20:57 +0000)]
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

2 years agominor: log build script invocations
Lukas Wirth [Tue, 24 May 2022 20:52:30 +0000 (22:52 +0200)]
minor: log build script invocations

2 years agofix: Insert whitespace into trait-impl completions when coming from macros
Lukas Wirth [Tue, 24 May 2022 20:33:42 +0000 (22:33 +0200)]
fix: Insert whitespace into trait-impl completions when coming from macros

2 years agoSimplify
Lukas Wirth [Tue, 24 May 2022 19:58:47 +0000 (21:58 +0200)]
Simplify

2 years agoAuto merge of #12373 - Veykril:completion, r=Veykril
bors [Tue, 24 May 2022 11:26:04 +0000 (11:26 +0000)]
Auto merge of #12373 - Veykril:completion, r=Veykril

internal: Refactor our record pat/expr handling in completion context

2 years agointernal: Refactor our record pat/expr handling in completion context
Lukas Wirth [Tue, 24 May 2022 11:24:36 +0000 (13:24 +0200)]
internal: Refactor our record pat/expr handling in completion context

2 years agoAuto merge of #12361 - Veykril:completion, r=Veykril
bors [Tue, 24 May 2022 09:55:13 +0000 (09:55 +0000)]
Auto merge of #12361 - Veykril:completion, r=Veykril

internal: Simplify DotAccess representation in completions

`@bors` r+

2 years agointernal: Simplify DotAccess representation in completions
Lukas Wirth [Mon, 23 May 2022 15:40:41 +0000 (17:40 +0200)]
internal: Simplify DotAccess representation in completions

2 years agoAuto merge of #12370 - andylizi:macro-expand-underscore, r=lnicola
bors [Tue, 24 May 2022 06:52:00 +0000 (06:52 +0000)]
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();
}
```

2 years agoadd test for macro expand formatting
andylizi [Tue, 24 May 2022 04:45:58 +0000 (12:45 +0800)]
add test for macro expand formatting

2 years agoAuto merge of #12371 - jhgg:fix/extra-env-non-string-value-handling, r=lnicola
bors [Tue, 24 May 2022 04:11:19 +0000 (04:11 +0000)]
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.

2 years agoprettier
Jake Heinz [Tue, 24 May 2022 03:08:59 +0000 (03:08 +0000)]
prettier

2 years agovscode: fix extraEnv handling numeric values
Jake Heinz [Tue, 24 May 2022 02:59:19 +0000 (02:59 +0000)]
vscode: fix extraEnv handling numeric values

2 years agoide: insert whitespaces surrounding `_` in macro expansion
andylizi [Mon, 23 May 2022 23:35:47 +0000 (07:35 +0800)]
ide: insert whitespaces surrounding `_` in macro expansion

2 years agoAuto merge of #12366 - rust-lang:revert-12349-universal-vsix, r=lnicola
bors [Mon, 23 May 2022 20:55:29 +0000 (20:55 +0000)]
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

2 years agoRevert "internal: Publish universal VSIX to make VS happy"
Laurențiu Nicola [Mon, 23 May 2022 20:45:46 +0000 (23:45 +0300)]
Revert "internal: Publish universal VSIX to make VS happy"

2 years agoAuto merge of #12365 - rust-lang:revert-12359-universal-vsix-part-2, r=lnicola
bors [Mon, 23 May 2022 20:45:03 +0000 (20:45 +0000)]
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

2 years agoRevert "internal: Try to publish the universal VSIX before the other ones"
Laurențiu Nicola [Mon, 23 May 2022 20:44:08 +0000 (23:44 +0300)]
Revert "internal: Try to publish the universal VSIX before the other ones"

2 years agoAuto merge of #12359 - lnicola:universal-vsix-part-2, r=lnicola
bors [Mon, 23 May 2022 15:43:19 +0000 (15:43 +0000)]
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

2 years agoAuto merge of #12360 - Veykril:completion, r=Veykril
bors [Mon, 23 May 2022 15:24:10 +0000 (15:24 +0000)]
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

2 years agofix: Fix completions not working after attributes
Lukas Wirth [Mon, 23 May 2022 15:20:42 +0000 (17:20 +0200)]
fix: Fix completions not working after attributes

2 years agoTry to publish the universal VSIX before the other ones
Laurențiu Nicola [Mon, 23 May 2022 15:04:43 +0000 (18:04 +0300)]
Try to publish the universal VSIX before the other ones

2 years agoAuto merge of #12358 - Veykril:hl-mac, r=Veykril
bors [Mon, 23 May 2022 15:04:12 +0000 (15:04 +0000)]
Auto merge of #12358 - Veykril:hl-mac, r=Veykril

minor: Simplify syntax-highlighting macro checks

2 years agominor: Simplify syntax-highlighting macro checks
Lukas Wirth [Mon, 23 May 2022 15:03:19 +0000 (17:03 +0200)]
minor: Simplify syntax-highlighting macro checks

2 years agoAuto merge of #12357 - Veykril:find-ref-macro, r=Veykril
bors [Mon, 23 May 2022 14:12:35 +0000 (14:12 +0000)]
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

2 years agofix: When hovering macro inputs, don't show everything that was downmapped
Lukas Wirth [Mon, 23 May 2022 14:11:36 +0000 (16:11 +0200)]
fix: When hovering macro inputs, don't show everything that was downmapped

2 years agofix: When reference searching macro inputs, don't search everything that was downmapped
Lukas Wirth [Mon, 23 May 2022 14:09:56 +0000 (16:09 +0200)]
fix: When reference searching macro inputs, don't search everything that was downmapped

2 years agoAuto merge of #12355 - ruabmbua:fix-inference-pattern-wildcards, r=flodiebold
bors [Mon, 23 May 2022 10:38:19 +0000 (10:38 +0000)]
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

2 years agoFix inference when pattern matching a tuple field with a wildcard.
Roland Ruckerbauer [Sun, 22 May 2022 23:03:08 +0000 (01:03 +0200)]
Fix inference when pattern matching a tuple field with a wildcard.

2 years agoAuto merge of #12354 - domenicquirl:reload-docs-typo, r=domenicquirl
bors [Mon, 23 May 2022 08:33:32 +0000 (08:33 +0000)]
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

2 years agoKeep the other `is` in `reload.rs` docs
DQ [Mon, 23 May 2022 08:29:03 +0000 (10:29 +0200)]
Keep the other `is` in `reload.rs` docs

2 years agoFix typo in new `reload.rs` docs
DQ [Mon, 23 May 2022 07:35:32 +0000 (09:35 +0200)]
Fix typo in new `reload.rs` docs

Just skimmed today's changelog and came across the repetition

2 years agoAuto merge of #12350 - umanwizard:fix_bsd, r=lnicola
bors [Mon, 23 May 2022 06:16:56 +0000 (06:16 +0000)]
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
https://github.com/notify-rs/notify/commit/41a74f0e98a1af386749ad3be4a197865054f17f , which landed in pre.15.

2 years agoFix build on OpenBSD (and probably other BSDs too)
Brennan Vincent [Sun, 22 May 2022 21:04:57 +0000 (17:04 -0400)]
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
https://github.com/notify-rs/notify/commit/41a74f0e98a1af386749ad3be4a197865054f17f , which landed in pre.15.

2 years agoAuto merge of #12349 - lnicola:universal-vsix, r=lnicola
bors [Sun, 22 May 2022 18:16:57 +0000 (18:16 +0000)]
Auto merge of #12349 - lnicola:universal-vsix, r=lnicola

internal: Publish universal VSIX to make VS happy

2 years agoPublish universal VSIX to make VS happy
Laurențiu Nicola [Sun, 22 May 2022 18:12:48 +0000 (21:12 +0300)]
Publish universal VSIX to make VS happy

2 years agoAuto merge of #12334 - fasterthanlime:gh-11635, r=Veykril
bors [Sun, 22 May 2022 17:01:26 +0000 (17:01 +0000)]
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

2 years agoPull text creation into the closure
Amos Wenger [Sun, 22 May 2022 16:38:14 +0000 (18:38 +0200)]
Pull text creation into the closure

2 years agoBetter lowercase/uppercase checks
Amos Wenger [Sun, 22 May 2022 16:31:12 +0000 (18:31 +0200)]
Better lowercase/uppercase checks

2 years agoAuto merge of #12281 - lnicola:increase-overflow-depth, r=lnicola
bors [Sun, 22 May 2022 15:14:26 +0000 (15:14 +0000)]
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

2 years agoIncrease defalt chalk overflow depth to match max solver size
Laurențiu Nicola [Tue, 17 May 2022 04:16:26 +0000 (07:16 +0300)]
Increase defalt chalk overflow depth to match max solver size

2 years agoAuto merge of #12345 - bvanjoi:escape_format_spcifier, r=Veykril
bors [Sun, 22 May 2022 10:41:31 +0000 (10:41 +0000)]
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

2 years agoAuto merge of #12346 - rainy-me:fix/builtin-type-docs-links, r=Veykril
bors [Sun, 22 May 2022 10:33:43 +0000 (10:33 +0000)]
Auto merge of #12346 - rainy-me:fix/builtin-type-docs-links, r=Veykril

fix: special case base url of `BuiltinType` to core

fix #12250

2 years agofix: special case base url of `BuiltinType` to core
rainy-me [Sun, 22 May 2022 09:50:40 +0000 (18:50 +0900)]
fix: special case base url of `BuiltinType` to core

2 years agoAuto merge of #11830 - nemethf:on-type-formatting, r=nemethf
bors [Sun, 22 May 2022 08:59:04 +0000 (08:59 +0000)]
Auto merge of #11830 - nemethf:on-type-formatting, r=nemethf

On typing handler for angle brackets(<) with snippets

I implemented my idea in #11398 in "cargo cult programming"-style without actually know what I'm doing, so feedback is welcome.  The PR is split into two commits to ease the review.  I used `@unexge's` original prototype, which forms the basis of the PR.

2 years agoonTypeFormatting: don't insert > if another > is there
Felicián Németh [Tue, 5 Apr 2022 16:35:03 +0000 (18:35 +0200)]
onTypeFormatting: don't insert > if another > is there

2 years agofeat: Add on-typing handler for left angle
Felicián Németh [Sun, 27 Mar 2022 08:49:00 +0000 (10:49 +0200)]
feat: Add on-typing handler for left angle

Only advertise this feature in the server capabilities when the client
supports SnippetTextEdit.

Close #11398.

Co-authored-by: unexge <unexge@gmail.com>
2 years agointernal: Allow OnTypeFormatting to send SnippetTextEdit
Felicián Németh [Sun, 27 Mar 2022 08:45:57 +0000 (10:45 +0200)]
internal: Allow OnTypeFormatting to send SnippetTextEdit

But continue to send TextEdit only.

2 years agofeat: escape format specifier(close: #12258)
bvanjoi [Sun, 22 May 2022 06:40:47 +0000 (14:40 +0800)]
feat: escape format specifier(close: #12258)

2 years agoAuto merge of #12342 - lnicola:fix-join-lines, r=lnicola
bors [Sat, 21 May 2022 15:39:16 +0000 (15:39 +0000)]
Auto merge of #12342 - lnicola:fix-join-lines, r=lnicola

fix: Fix broken async callback in join lines

Fixes #12338.

2 years agoFix broken async callback in join lines
Laurențiu Nicola [Sat, 21 May 2022 15:38:10 +0000 (18:38 +0300)]
Fix broken async callback in join lines

2 years agoAuto merge of #12339 - matklad:dead, r=matklad
bors [Sat, 21 May 2022 12:40:29 +0000 (12:40 +0000)]
Auto merge of #12339 - matklad:dead, r=matklad

dead code

2 years agodead code
Aleksey Kladov [Sat, 21 May 2022 12:39:59 +0000 (13:39 +0100)]
dead code

2 years agoAuto merge of #12337 - matklad:docz, r=matklad
bors [Sat, 21 May 2022 12:12:23 +0000 (12:12 +0000)]
Auto merge of #12337 - matklad:docz, r=matklad

internal: document overall approach to reload

2 years agointernal: document overall approach to reload
Aleksey Kladov [Sat, 21 May 2022 12:11:05 +0000 (13:11 +0100)]
internal: document overall approach to reload

2 years agoStill suggest generating enum methods if the name ref starts with a lowercase letter
Amos Wenger [Fri, 20 May 2022 23:43:05 +0000 (01:43 +0200)]
Still suggest generating enum methods if the name ref starts with a lowercase letter

2 years agoDon't suggest enum variant if name_ref start with ASCII lowercase letter
Amos Wenger [Fri, 20 May 2022 23:36:26 +0000 (01:36 +0200)]
Don't suggest enum variant if name_ref start with ASCII lowercase letter

2 years agoSimplify with adt.source()
Amos Wenger [Fri, 20 May 2022 23:32:25 +0000 (01:32 +0200)]
Simplify with adt.source()

2 years agoGenerate enum variant assist
Amos Wenger [Fri, 20 May 2022 23:18:35 +0000 (01:18 +0200)]
Generate enum variant assist

This also disables "generate function" when what we clearly want is to
generate an enum variant.

Co-authored-by: Maarten Flippo <maartenflippo@outlook.com>
2 years agoAuto merge of #12329 - jonas-schievink:build-script-errors, r=jonas-schievink
bors [Fri, 20 May 2022 15:29:12 +0000 (15:29 +0000)]
Auto merge of #12329 - jonas-schievink:build-script-errors, r=jonas-schievink

fix: Don't swallow build script errors

2 years agoDon't swallow build script errors
Jonas Schievink [Fri, 20 May 2022 15:28:39 +0000 (17:28 +0200)]
Don't swallow build script errors

2 years agoAuto merge of #12328 - Veykril:simplify, r=Veykril
bors [Fri, 20 May 2022 15:03:59 +0000 (15:03 +0000)]
Auto merge of #12328 - Veykril:simplify, r=Veykril

minor: Simplify

2 years agominor: Simplify
Lukas Wirth [Fri, 20 May 2022 14:42:28 +0000 (16:42 +0200)]
minor: Simplify

2 years agoAuto merge of #12327 - jonas-schievink:lambda-to-closure, r=jonas-schievink
bors [Fri, 20 May 2022 13:45:21 +0000 (13:45 +0000)]
Auto merge of #12327 - jonas-schievink:lambda-to-closure, r=jonas-schievink

internal: Rename `Expr::Lambda` to `Expr::Closure`

They're never really called "Lambda"s in Rust, so let's call them "Closures" consistently.

2 years agoRename `Expr::Lambda` to `Expr::Closure`
Jonas Schievink [Fri, 20 May 2022 13:40:32 +0000 (15:40 +0200)]
Rename `Expr::Lambda` to `Expr::Closure`

2 years agoAuto merge of #12326 - jonas-schievink:add-clippy-task-preset, r=jonas-schievink
bors [Fri, 20 May 2022 13:36:59 +0000 (13:36 +0000)]
Auto merge of #12326 - jonas-schievink:add-clippy-task-preset, r=jonas-schievink

feat: Add "cargo clippy" task preset

We've had a couple of common presets in `Tasks: Run Task -> cargo -> cargo [check,build,test,...]` before. This PR adds `cargo clippy` to that list, which makes for a convenient way of occasionally running Clippy on your code without having to reconfigure the Check on Save command to clippy.

These presets all use the `cargo` task type that we provide, so diagnostics will show up in the editor. However, they don't go through the server-side parsing logic, so it's not possible to apply suggestions, and diagnostics are fairly "low-fidelity". It would be cool if we could somehow pass Cargo's JSON output through the LSP server and render it properly, for arbitrary tasks.

cc https://github.com/rust-lang/rust-analyzer/issues/12323

2 years agoAdd "cargo clippy" task preset
Jonas Schievink [Fri, 20 May 2022 13:25:37 +0000 (15:25 +0200)]
Add "cargo clippy" task preset

2 years agoAuto merge of #12325 - jonas-schievink:clear-check-diags, r=jonas-schievink
bors [Fri, 20 May 2022 13:10:49 +0000 (13:10 +0000)]
Auto merge of #12325 - jonas-schievink:clear-check-diags, r=jonas-schievink

fix: Clear `cargo check` diagnostics when flycheck is turned off

Previously stale diagnostics were left over indefinitely when turning off "Check on Save" while diagnostics are present.

2 years agoClear `cargo check` diagnostics when flycheck is turned off
Jonas Schievink [Fri, 20 May 2022 13:07:55 +0000 (15:07 +0200)]
Clear `cargo check` diagnostics when flycheck is turned off

2 years agoAuto merge of #12324 - jonas-schievink:rm-attribute, r=jonas-schievink
bors [Fri, 20 May 2022 12:57:08 +0000 (12:57 +0000)]
Auto merge of #12324 - jonas-schievink:rm-attribute, r=jonas-schievink

feat: Revert the "Add attribute" assist

Reverts https://github.com/rust-lang/rust-analyzer/pull/12296, as the added indirection and "assist noise" (the assist has to trigger inside the body of an item to match what the "Add `#[derive]`" does) makes this not really pull its weight over just using attribute completions.

Keeps the changes to "Add getter". `#[must_use]` can be applied using the attribute completions.

2 years agoAuto merge of #12315 - matklad:update, r=Veykril
bors [Fri, 20 May 2022 12:44:15 +0000 (12:44 +0000)]
Auto merge of #12315 - matklad:update, r=Veykril

:arrow_up: deps

2 years agoRevert the "Add attribute" assist
Jonas Schievink [Fri, 20 May 2022 12:39:22 +0000 (14:39 +0200)]
Revert the "Add attribute" assist

2 years agoAuto merge of #12263 - andylizi:hide-type-hint-closure, r=Veykril
bors [Fri, 20 May 2022 12:35:36 +0000 (12:35 +0000)]
Auto merge of #12263 - andylizi:hide-type-hint-closure, r=Veykril

feat: hide type inlay hints for initializations of closures

![hide_closure_initialization](https://user-images.githubusercontent.com/12008103/168470158-6cb77b18-068e-4431-a8b5-e2b22d50d263.gif)

This PR adds an option to hide the inlay hints for `let IDENT_PAT = CLOSURE_EXPR;`, which is a somewhat common coding pattern. Currently the inlay hints for the assigned variable and the closure expression itself are both displayed, making it rather repetitive.

In order to be consistent with closure return type hints, only closures with block bodies will be hid by this option.

Personally I'd feel comfortable making it always enabled (or at least when closure return type hints are enabled), but considering the precedent set in #10761, I introduced an off-by-default option for this.

changelog feature: option to hide type inlay hints for initializations of closures

2 years agoAuto merge of #12301 - harpsword:fix_for_crlf_cargo_range_map, r=jonas-schievink
bors [Fri, 20 May 2022 12:15:22 +0000 (12:15 +0000)]
Auto merge of #12301 - harpsword:fix_for_crlf_cargo_range_map, r=jonas-schievink

fix: calculate correct postion for Dos line ending in mapping rustc range to ls…

fix #12293

2 years agofeat: hide type inlay hints for initializations of closures
andylizi [Sun, 15 May 2022 11:17:52 +0000 (19:17 +0800)]
feat: hide type inlay hints for initializations of closures

2 years agoAuto merge of #12320 - NotWearingPants:patch-1, r=Veykril
bors [Thu, 19 May 2022 23:57:37 +0000 (23:57 +0000)]
Auto merge of #12320 - NotWearingPants:patch-1, r=Veykril

Hide closure ret hints if ret type is specified

Fixes #12319

2 years agohide closure ret hints if ret type is specified
NotWearingPants [Thu, 19 May 2022 23:35:37 +0000 (02:35 +0300)]
hide closure ret hints if ret type is specified

fixes #12319

2 years agoAuto merge of #12316 - jonas-schievink:closure-param-hints, r=jonas-schievink
bors [Thu, 19 May 2022 16:54:09 +0000 (16:54 +0000)]
Auto merge of #12316 - jonas-schievink:closure-param-hints, r=jonas-schievink

feat: Show parameter inlay hints for closure invocations

Fixes https://github.com/rust-lang/rust-analyzer/issues/12268

2 years agoTeach `Callable` about closures properly
Jonas Schievink [Thu, 19 May 2022 16:53:08 +0000 (18:53 +0200)]
Teach `Callable` about closures properly

2 years ago:arrow_up: deps
Aleksey Kladov [Thu, 19 May 2022 15:51:19 +0000 (16:51 +0100)]
:arrow_up: deps

2 years agoAuto merge of #12314 - jonas-schievink:proc-macro-load, r=jonas-schievink
bors [Thu, 19 May 2022 14:50:08 +0000 (14:50 +0000)]
Auto merge of #12314 - jonas-schievink:proc-macro-load, r=jonas-schievink

minor: simplify

2 years agoAuto merge of #12313 - equinox:typo-fix, r=lnicola
bors [Thu, 19 May 2022 14:22:09 +0000 (14:22 +0000)]
Auto merge of #12313 - equinox:typo-fix, r=lnicola

Removed duplicate 'to' in `cachePriming.numThreads` option description

One 'to' too many!