]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoAuto merge of #12431 - Veykril:request-retry, r=Veykril
bors [Wed, 1 Jun 2022 10:18:50 +0000 (10:18 +0000)]
Auto merge of #12431 - Veykril:request-retry, r=Veykril

fix: Fix completions disappearing when typing two keys in quick succession

With this PR we now retry requests if they get cancelled due to document changes.

This fixes the completions problem we have where completions seem to randomly disappear, see https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/Completions.20not.20always.20appearing

Fixes https://github.com/rust-lang/rust-analyzer/issues/10187
Fixes https://github.com/rust-lang/rust-analyzer/issues/7560
Fixes https://github.com/rust-lang/rust-analyzer/issues/12153

2 years agoSync handlers cannot be cancelled
Lukas Wirth [Wed, 1 Jun 2022 10:17:49 +0000 (12:17 +0200)]
Sync handlers cannot be cancelled

2 years agoAuto merge of #12435 - jhgg:vscode/status-bar-color-fix, r=Veykril
bors [Wed, 1 Jun 2022 07:19:42 +0000 (07:19 +0000)]
Auto merge of #12435 - jhgg:vscode/status-bar-color-fix, r=Veykril

[editors/vscode] cleaer status bar bg color / command  when server status returns to OK

fixes #12433

2 years ago[editors/vscode] cleaer status bar bg color / command when server status returns...
Jake Heinz [Wed, 1 Jun 2022 06:58:16 +0000 (06:58 +0000)]
[editors/vscode] cleaer status bar bg color / command  when server status returns to OK

2 years agofix: Fix completions disappearing when typing two keys in quick succession
Lukas Wirth [Tue, 31 May 2022 22:20:28 +0000 (00:20 +0200)]
fix: Fix completions disappearing when typing two keys in quick succession

2 years agoAuto merge of #12430 - Veykril:completions, r=Veykril
bors [Tue, 31 May 2022 18:22:41 +0000 (18:22 +0000)]
Auto merge of #12430 - Veykril:completions, r=Veykril

minor: Remove unused code

2 years agominor: Remove unused code
Lukas Wirth [Tue, 31 May 2022 18:21:50 +0000 (20:21 +0200)]
minor: Remove unused code

2 years agoAuto merge of #12427 - Veykril:configfix, r=Veykril
bors [Tue, 31 May 2022 11:48:42 +0000 (11:48 +0000)]
Auto merge of #12427 - Veykril:configfix, r=Veykril

fix: Fix VSCode config patching incorrectly patching some configs

2 years agofix: Fix VSCode config patching incorrectly patching some configs
Lukas Wirth [Tue, 31 May 2022 11:27:34 +0000 (13:27 +0200)]
fix: Fix VSCode config patching incorrectly patching some configs

2 years agoAuto merge of #12336 - bitgaoshu:mismatch, r=flodiebold
bors [Tue, 31 May 2022 09:48:54 +0000 (09:48 +0000)]
Auto merge of #12336 - bitgaoshu:mismatch, r=flodiebold

fix: #12267  type-mismatch when using equals w/ a trait bound

2 years agoAuto merge of #12425 - feniljain:fix_bugs, r=lnicola
bors [Tue, 31 May 2022 04:52:36 +0000 (04:52 +0000)]
Auto merge of #12425 - feniljain:fix_bugs, r=lnicola

fix: float display impl

should solve #12414

2 years agofix: float display impl
feniljain [Tue, 31 May 2022 04:43:03 +0000 (10:13 +0530)]
fix: float display impl

2 years agoAuto merge of #12418 - Veykril:completions, r=Veykril
bors [Mon, 30 May 2022 14:05:37 +0000 (14:05 +0000)]
Auto merge of #12418 - Veykril:completions, r=Veykril

internal: More precise completion filtering with existing item qualifiers

Now we are approaching the more complex cases for filtering completions

2 years agoMore precise completion filtering
Lukas Wirth [Mon, 30 May 2022 14:01:17 +0000 (16:01 +0200)]
More precise completion filtering

2 years agoAuto merge of #12417 - jonas-schievink:pr-msg-style, r=jonas-schievink
bors [Mon, 30 May 2022 13:56:54 +0000 (13:56 +0000)]
Auto merge of #12417 - jonas-schievink:pr-msg-style, r=jonas-schievink

minor: Update commit/PR style guide

What matters for the changelog is having PR title/description from the user's perspective, while commits can be internal.

2 years agoUpdate commit/PR style
Jonas Schievink [Mon, 30 May 2022 13:55:40 +0000 (15:55 +0200)]
Update commit/PR style

2 years agoUse char for trigger character
Lukas Wirth [Mon, 30 May 2022 12:17:58 +0000 (14:17 +0200)]
Use char for trigger character

2 years agoAuto merge of #12416 - Veykril:inlay-hints, r=Veykril
bors [Mon, 30 May 2022 12:00:54 +0000 (12:00 +0000)]
Auto merge of #12416 - Veykril:inlay-hints, r=Veykril

Add implicit static lifetime hints

2 years agoAdd implicit static lifetime hints
Lukas Wirth [Mon, 30 May 2022 11:51:48 +0000 (13:51 +0200)]
Add implicit static lifetime hints

2 years agoAuto merge of #12406 - harpsword:fix-add-inlayHints-closures-without-block, r=Veykril
bors [Mon, 30 May 2022 11:36:55 +0000 (11:36 +0000)]
Auto merge of #12406 - harpsword:fix-add-inlayHints-closures-without-block, r=Veykril

fix: add an option to show inlay hint for return type of closures wit…

fix #12321

2 years agoAuto merge of #12387 - 00nktk:fix-mod-rename, r=Veykril
bors [Mon, 30 May 2022 11:29:55 +0000 (11:29 +0000)]
Auto merge of #12387 - 00nktk:fix-mod-rename, r=Veykril

fix(ide-db): correct single-file module rename

Fixes a bug where rust-analyzer would emit `WorkspaceEdit`s with paths to dirs instead of files for the following project layout.

lib.rs
```rust
mod foo;
```

foo.rs
```rust
mod bar {
    struct Bar;
}
```
Also fixes emitted paths for modules with mod.rs.
The bug resulted in panic in helix editor when attempting to rename a module.

2 years agoAuto merge of #12412 - yue4u:fix/visibility-completion, r=Veykril
bors [Mon, 30 May 2022 11:22:10 +0000 (11:22 +0000)]
Auto merge of #12412 - yue4u:fix/visibility-completion, r=Veykril

fix: Retrigger visibility completion after parentheses

close #12390

This PR add `(` to trigger_characters as discussed in original issue.

Some questions:

1. Is lsp's `ctx.trigger_character` from `params.context` is the same as `ctx.original_token` inside actually completions?
    1. If not what's the difference?
    2. if they are the same, it's unnecessary to pass it down from handler at all.
    3.  if they are the same, maybe we could parse it from fixture directly instead of using the `check_with_trigger_character` I added.
2. Some completion fixtures written as `($0)` ( https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-completion/src/tests/fn_param.rs#L105 as an example), If I understand correctly they are not invoked outside tests at all?
    1. using `ctx.original_token` directly would break these tests as well as parsing trigger_character from fixture for now.
    2. I think it make sense to allow `(` triggering these cases?
3. I hope this line up with #12144

2 years agofix: visibility completion
yue4u [Sun, 29 May 2022 15:06:48 +0000 (00:06 +0900)]
fix: visibility completion

2 years agoAuto merge of #12409 - lowr:fix/usize-overflow, r=Veykril
bors [Sun, 29 May 2022 08:45:15 +0000 (08:45 +0000)]
Auto merge of #12409 - lowr:fix/usize-overflow, r=Veykril

fix overflow during type inference for tuple struct patterns

The following code causes integer overflow during type inference for (malformed) tuple struct patterns.

```rust
struct S(usize);
let S(.., a, b) = S(1);
```

It has been panicking only in debug builds, and working in a way in release builds but it was inconsistent with type inference for tuple patterns:

```rust
struct S(usize);
let S(.., a, b) = S(1); // a -> unknown, b -> usize
let (.., a, b) = (1,);  // a -> usize, b -> unknown
```

With this PR, the overflow no longer happens by utilizing `saturating_sub()` like in other places and type inference for tuple struct patterns is in line with that for tuple patterns.

2 years agofix overflow during tuple struct type inference
Ryo Yoshida [Sun, 29 May 2022 07:20:44 +0000 (16:20 +0900)]
fix overflow during tuple struct type inference

2 years agofix: add an option to show inlay hint for return type of closures without block
harpsword [Sat, 28 May 2022 12:13:25 +0000 (20:13 +0800)]
fix: add an option to show inlay hint for return type of closures without block

2 years agofix(ide-db): correct single-file module rename
Nikita Podoliako [Wed, 25 May 2022 15:47:11 +0000 (18:47 +0300)]
fix(ide-db): correct single-file module rename

2 years agoAuto merge of #12402 - Veykril:feat-docs, r=Veykril
bors [Fri, 27 May 2022 13:47:56 +0000 (13:47 +0000)]
Auto merge of #12402 - Veykril:feat-docs, r=Veykril

minor: Freshen up goto feature docs

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

2 years agominor: Freshen up goto feature docs
Lukas Wirth [Fri, 27 May 2022 13:47:31 +0000 (15:47 +0200)]
minor: Freshen up goto feature docs

2 years agoAuto merge of #12395 - feniljain:fix_bugs, r=Veykril
bors [Fri, 27 May 2022 12:44:08 +0000 (12:44 +0000)]
Auto merge of #12395 - feniljain:fix_bugs, r=Veykril

fix: f32 and f64 representation during lowering

should fix #12380

2 years agoAuto merge of #12341 - vemoo:exclude_dirs, r=Veykril
bors [Fri, 27 May 2022 12:35:48 +0000 (12:35 +0000)]
Auto merge of #12341 - vemoo:exclude_dirs, r=Veykril

make `files.excludeDirs` work

There's a small issue because if all projects are excluded, this: https://github.com/rust-lang/rust-analyzer/blob/01d412f4d7bd7ef21a7e8f0461e9ba3439e3c4bf/crates/rust-analyzer/src/main_loop.rs#L114 will be shown.
I thought about not showing it if `files.excludeDirs` is set, but that is not necessarily correct.

Fixes #7755

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 agofix: f32 and f64 representation during lowering
feniljain [Thu, 26 May 2022 10:35:25 +0000 (16:05 +0530)]
fix: f32 and f64 representation during lowering

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.