]> git.lizzy.rs Git - rust.git/log
rust.git
18 months agofix: Don't show duplicated adjustment hints for blocks, ifs and matches
Maybe Waffle [Fri, 9 Dec 2022 17:40:54 +0000 (17:40 +0000)]
fix: Don't show duplicated adjustment hints for blocks, ifs and matches

18 months agoAuto merge of #13733 - WaffleLapkin:remove_parens, r=Veykril
bors [Fri, 9 Dec 2022 11:42:09 +0000 (11:42 +0000)]
Auto merge of #13733 - WaffleLapkin:remove_parens, r=Veykril

feat: Add "Remove redundant parentheses" assist

![Peek 2022-12-08 22-22](https://user-images.githubusercontent.com/38225716/206542898-d6c97468-d615-4c5b-8650-f89b9c0321a0.gif)

Can be quite handy when refactoring :)

18 months agoAuto merge of #13722 - MariaSolOs:add-json-contrib, r=Veykril
bors [Fri, 9 Dec 2022 11:29:10 +0000 (11:29 +0000)]
Auto merge of #13722 - MariaSolOs:add-json-contrib, r=Veykril

Add VS Code schema validation for `rust-project.json`

Now that https://github.com/SchemaStore/schemastore/pull/2628 has been merged, adding the `jsonValidation` contribution to the VS Code extension for better editor support when modifying `rust-project.json` files.

Related issue: #13714

18 months agoSimplify `remove_parentheses`'s implementation
Maybe Waffle [Thu, 8 Dec 2022 18:54:08 +0000 (18:54 +0000)]
Simplify `remove_parentheses`'s implementation

18 months agoMove precedence handling to `crates/syntax`
Maybe Waffle [Thu, 8 Dec 2022 18:44:03 +0000 (18:44 +0000)]
Move precedence handling to `crates/syntax`

18 months agoExplicitly say that the assist removes *redundant* parentheses
Maybe Waffle [Thu, 8 Dec 2022 18:22:57 +0000 (18:22 +0000)]
Explicitly say that the assist removes *redundant* parentheses

18 months agoAuto merge of #13490 - HKalbasi:layout, r=jonas-schievink
bors [Wed, 7 Dec 2022 15:22:03 +0000 (15:22 +0000)]
Auto merge of #13490 - HKalbasi:layout, r=jonas-schievink

Compute data layout of types

cc #4091

Things that aren't working:
* Closures
* Generators (so no support for `Future` I think)
* Opaque types
* Type alias and associated types which may need normalization

Things that show wrong result:
* ~Enums with explicit discriminant~
* SIMD types
* ~`NonZero*` and similar standard library items which control layout with special attributes~

At the user level, I didn't put much work, since I wasn't confident about what is the best way to present this information. Currently it shows size and align for ADTs, and size, align, offset for struct fields, in the hover, similar to clangd. I used it some days and I feel I liked it, but we may consider it too noisy and move it to an assist or command.

18 months agoAdd a fixme comment in current_target_data_layout
hkalbasi [Tue, 6 Dec 2022 22:59:50 +0000 (02:29 +0330)]
Add a fixme comment in current_target_data_layout

18 months agouse rustc crates instead of copy paste
hkalbasi [Tue, 6 Dec 2022 22:29:38 +0000 (01:59 +0330)]
use rustc crates instead of copy paste

18 months agoConsider expression precedense in `remove_parentheses` assist
Maybe Waffle [Tue, 6 Dec 2022 19:11:24 +0000 (19:11 +0000)]
Consider expression precedense in `remove_parentheses` assist

18 months agoAdd `remove_parentheses` assist
Maybe Waffle [Tue, 6 Dec 2022 16:18:25 +0000 (16:18 +0000)]
Add `remove_parentheses` assist

18 months agoAuto merge of #13730 - lowr:feat/builtin-macro-helper-attr, r=Veykril
bors [Tue, 6 Dec 2022 08:16:14 +0000 (08:16 +0000)]
Auto merge of #13730 - lowr:feat/builtin-macro-helper-attr, r=Veykril

Support builtin derive macro helper attributes

Closes #13244

It's a bit wasteful for `Macro2Data` to have `helpers` field currently just for `Default` derive macro, but I tend to think it's okay for the time being given how rare macro2's are used.

18 months agoResolve macro2's derive helpers in IDE layer
Ryo Yoshida [Tue, 6 Dec 2022 06:53:03 +0000 (15:53 +0900)]
Resolve macro2's derive helpers in IDE layer

Macro2's generally don't have derive helpers, but currently builtin
derive macros are declared with macro2 syntax, which can have derive
helpers.

18 months agoParse and collect derive helpers for builtin derive macros
Ryo Yoshida [Mon, 7 Nov 2022 12:24:17 +0000 (21:24 +0900)]
Parse and collect derive helpers for builtin derive macros

18 months agoAuto merge of #13728 - detrumi:chalk-update, r=lnicola
bors [Mon, 5 Dec 2022 17:27:53 +0000 (17:27 +0000)]
Auto merge of #13728 - detrumi:chalk-update, r=lnicola

Update to Chalk 88

This Chalk release introduces fuel for the recursive solver ([chalk#774](https://github.com/rust-lang/chalk/pull/774)).
I'm not sure how often it calls `should_continue` compared to the other solver, so we might want to increase `CHALK_SOLVER_FUEL`, the current default value of 100 might be too low.

This should fix a lot of hangs and crashes, for example this solves the hang in #12897.

18 months agoIncrease Chalk fuel from 100 to 1000
Wilco Kusee [Mon, 5 Dec 2022 17:13:11 +0000 (18:13 +0100)]
Increase Chalk fuel from 100 to 1000

The old value was for the old chalk-engine solver, nowadays the newer chalk-recursive solver is used.
The new solver currently uses fuel a bit more quickly, so a higher value is needed.
Running analysis-stats showed that a value of 100 increases the amount of unknown types,
while for a value of 1000 it's staying mostly the same.

18 months agoUpdate to Chalk 88
Wilco Kusee [Mon, 5 Dec 2022 16:29:23 +0000 (17:29 +0100)]
Update to Chalk 88

18 months agoAdd JSON schema contribution
Maria José Solano [Sun, 4 Dec 2022 20:04:56 +0000 (12:04 -0800)]
Add JSON schema contribution

18 months agoAuto merge of #13721 - Veykril:incoherent-impls, r=Veykril
bors [Sun, 4 Dec 2022 19:37:26 +0000 (19:37 +0000)]
Auto merge of #13721 - Veykril:incoherent-impls, r=Veykril

Support `rustc_has_incoherent_inherent_impls`

Fixes us not resolving `<dyn Error>::downcast` now that `Error` moved to core, while that assoc function is declared in `alloc`.

18 months agoSupport `rustc_has_incoherent_inherent_impls`
Lukas Wirth [Sun, 4 Dec 2022 19:12:11 +0000 (20:12 +0100)]
Support `rustc_has_incoherent_inherent_impls`

18 months agosupport nonzero* niche optimizations
hkalbasi [Thu, 27 Oct 2022 19:58:34 +0000 (23:28 +0330)]
support nonzero* niche optimizations

18 months agoCompute data layout of types
hkalbasi [Sun, 23 Oct 2022 08:12:05 +0000 (11:42 +0330)]
Compute data layout of types

18 months agoAuto merge of #13717 - lowr:fix/proc-macro-ident-is-raw, r=Veykril
bors [Sat, 3 Dec 2022 18:42:33 +0000 (18:42 +0000)]
Auto merge of #13717 - lowr:fix/proc-macro-ident-is-raw, r=Veykril

Handle raw identifiers in proc macro server

Fixes #13706

When proc macros create `proc_macro::Ident`s, they pass an identifier text without "r#" prefix and a flag `is_raw` to proc macro server. Our `tt::Ident` currently stores the text *with* "r#" so we need to adjust them somewhere.

Rather than following rustc and adding `is_raw` field to our `tt::Ident`, I opted for adjusting the representation of identifiers in proc macro server, because we don't need the field outside it.

It's hard to write regression test for this, but at least I:
- ran `cargo +nightly t --features sysroot-abi` and all the tests passed
- built proc macro server with `cargo +nightly b -r --bin rust-analyzer-proc-macro-srv --features sysroot-abi` and made sure #13706 resolved
  - For the record, the nightly versions used are `rustc 1.67.0-nightly (32e613bba 2022-12-02)` and `cargo 1.67.0-nightly (e027c4b5d 2022-11-25)`.

18 months agoHandle raw identifiers in proc macro server
Ryo Yoshida [Sat, 3 Dec 2022 13:57:08 +0000 (22:57 +0900)]
Handle raw identifiers in proc macro server

18 months agoAuto merge of #13707 - lowr:feat/move-const-to-impl, r=Veykril
bors [Sat, 3 Dec 2022 13:16:22 +0000 (13:16 +0000)]
Auto merge of #13707 - lowr:feat/move-const-to-impl, r=Veykril

Add `move_const_to_impl` assist

Closes #13277

For the initial implementation, this assist:
- only applies to inherent impl. Much as we can *technically* provide this assist for default impl in trait definitions, it'd be complicated to get it right.
- may break code when the const's name collides with an item of a trait the self type implements.

Comments in the code explain those caveats in a bit more detail.

18 months agoAuto merge of #13713 - allanbrondum:bug/trait-method-callers, r=Veykril
bors [Sat, 3 Dec 2022 12:45:27 +0000 (12:45 +0000)]
Auto merge of #13713 - allanbrondum:bug/trait-method-callers, r=Veykril

check reference is a NameRef (and not Name)

Fixes that implementing methods are shown in call hierarchy https://github.com/rust-lang/rust-analyzer/issues/13712

18 months agofmt
Allan Brondum Rasmussen [Sat, 3 Dec 2022 00:20:27 +0000 (01:20 +0100)]
fmt

18 months agoremove unneeded test
Allan Brondum Rasmussen [Fri, 2 Dec 2022 23:53:56 +0000 (00:53 +0100)]
remove unneeded test

18 months agocheck reference is a NameRef (and not Name)
Allan Brondum Rasmussen [Fri, 2 Dec 2022 22:50:39 +0000 (23:50 +0100)]
check reference is a NameRef (and not Name)

18 months agoAdd `move_const_to_impl` assist
Ryo Yoshida [Tue, 22 Nov 2022 09:36:58 +0000 (18:36 +0900)]
Add `move_const_to_impl` assist

19 months agoAuto merge of #13697 - jonas-schievink:version-inlay-hint-resolve-data, r=jonas-schievink
bors [Tue, 29 Nov 2022 18:37:00 +0000 (18:37 +0000)]
Auto merge of #13697 - jonas-schievink:version-inlay-hint-resolve-data, r=jonas-schievink

internal: Version the inlay hint resolve data

cc https://github.com/rust-lang/rust-analyzer/issues/13657
cc https://github.com/rust-lang/rust-analyzer/issues/13372
cc https://github.com/rust-lang/rust-analyzer/issues/13170

This will make us log an error and return the unmodified inlay hints when the client attempts to resolve inlay hints in a file that has since been modified.

19 months agoUpdate hash
Jonas Schievink [Tue, 29 Nov 2022 18:33:16 +0000 (19:33 +0100)]
Update hash

19 months agoVersion the inlay hint resolve data
Jonas Schievink [Tue, 29 Nov 2022 18:20:32 +0000 (19:20 +0100)]
Version the inlay hint resolve data

19 months agoAuto merge of #13696 - jonas-schievink:signature-help-between-closing-delims, r=jonas...
bors [Tue, 29 Nov 2022 17:51:15 +0000 (17:51 +0000)]
Auto merge of #13696 - jonas-schievink:signature-help-between-closing-delims, r=jonas-schievink

fix: Fix signature help not showing up when cursor is between `))` or `>>`

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

19 months agoFix signature help not showing up when cursor is between `))` or `>>`
Jonas Schievink [Tue, 29 Nov 2022 17:50:21 +0000 (18:50 +0100)]
Fix signature help not showing up when cursor is between `))` or `>>`

19 months agoAuto merge of #13695 - detrumi:chalk-update, r=Veykril
bors [Tue, 29 Nov 2022 14:58:09 +0000 (14:58 +0000)]
Auto merge of #13695 - detrumi:chalk-update, r=Veykril

Update Chalk to version 87

Changes:
- Support new `tuple_trait` lang item ([chalk#782](https://github.com/rust-lang/chalk/pull/782))
- Removed empty lifetime ([chalk#783](https://github.com/rust-lang/chalk/pull/783))

19 months agoUpdate Chalk to version 87
Wilco Kusee [Tue, 29 Nov 2022 14:25:09 +0000 (15:25 +0100)]
Update Chalk to version 87

19 months agoAuto merge of #13690 - Crauzer:vararg-type, r=Veykril
bors [Tue, 29 Nov 2022 07:55:57 +0000 (07:55 +0000)]
Auto merge of #13690 - Crauzer:vararg-type, r=Veykril

feat: Implement vararg parameter type inference

This PR implements the "collection" of the `va_list` type into the function parameter types list.

19 months agoAuto merge of #13686 - MariaSolOs:test-lenses, r=Veykril
bors [Tue, 29 Nov 2022 07:42:35 +0000 (07:42 +0000)]
Auto merge of #13686 - MariaSolOs:test-lenses, r=Veykril

Don't show runnable code lenses in libraries outside of the workspace

Addresses #13664. For now I'm just disabling runnable code lenses since the ones that display the number of references and implementations do work correctly with external code.

Also made a tiny TypeScript change to use the typed `sendNotification` overload.

19 months agoFix formatting
Maria José Solano [Tue, 29 Nov 2022 03:10:16 +0000 (19:10 -0800)]
Fix formatting

19 months agoimplement vararg type collection from function params
Crauzer [Mon, 28 Nov 2022 23:32:13 +0000 (00:32 +0100)]
implement vararg type collection from function params

19 months agoCheck for workspace root in runnable codelens
Maria José Solano [Sun, 27 Nov 2022 18:07:09 +0000 (10:07 -0800)]
Check for workspace root in runnable codelens

19 months agoUse typed notification method
Maria José Solano [Sun, 27 Nov 2022 17:46:37 +0000 (09:46 -0800)]
Use typed notification method

19 months agoAuto merge of #13681 - lowr:fix/extract-function-tail-expr, r=Veykril
bors [Sun, 27 Nov 2022 12:18:42 +0000 (12:18 +0000)]
Auto merge of #13681 - lowr:fix/extract-function-tail-expr, r=Veykril

fix: check tail expressions more precisely in `extract_function`

Fixes #13620

When extracting expressions with control flows into a function, we can avoid wrapping tail expressions in `Option` or `Result` when they are also tail expressions of the container we're extracting from (see #7840, #9773). This is controlled by `ContainerInfo::is_in_tail`, but we've been computing it by checking if the tail expression of the range to extract is contained in the container's syntactically last expression, which may be a block that contains both tail and non-tail expressions (e.g. in #13620, the range to be extracted is not a tail expression but we set the flag to true).

This PR tries to compute the flag as precise as possible by utilizing `for_each_tail_expr()` (and also moves the flag to `Function` struct as it's more of a property of the function to be extracted than of the container).

19 months agoAuto merge of #13611 - yue4u:fix/completion-after-colon, r=yue4u
bors [Sat, 26 Nov 2022 17:55:00 +0000 (17:55 +0000)]
Auto merge of #13611 - yue4u:fix/completion-after-colon, r=yue4u

fix: filter unnecessary completions after colon

close #13597
related: #10173

This PR also happens to fix two extra issues:

1. The test case in https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-completion/src/tests/attribute.rs#L778-L801 was never triggered in previous behavior.

after:

https://user-images.githubusercontent.com/26110087/201476995-56adf955-0fa7-4f75-ab32-28a8e6cb9504.mp4

<del>
2. completions were triggered even in invalid paths, like

```rust
fn main() {
    core:::::$0
}
```

```rust
#[:::::$0]
struct X;
```

</del>

only `:::` is excluded as discussed in https://github.com/rust-lang/rust-analyzer/pull/13611#discussion_r1031845205

19 months agofix: also exclude 2 coloncolon in a row
yue4u [Sat, 26 Nov 2022 17:39:38 +0000 (02:39 +0900)]
fix: also exclude 2 coloncolon in a row

19 months agofix: only special casing 3 colon in a row
yue4u [Sat, 26 Nov 2022 16:53:45 +0000 (01:53 +0900)]
fix: only special casing 3 colon in a row

19 months agofix: check if range contains tail expression
Ryo Yoshida [Sat, 26 Nov 2022 14:51:22 +0000 (23:51 +0900)]
fix: check if range contains tail expression

19 months agorefactor: remove unnecessary stuff
Ryo Yoshida [Sat, 26 Nov 2022 14:51:57 +0000 (23:51 +0900)]
refactor: remove unnecessary stuff

19 months agoAuto merge of #13678 - Veykril:hir-file-encode, r=Veykril
bors [Fri, 25 Nov 2022 22:33:32 +0000 (22:33 +0000)]
Auto merge of #13678 - Veykril:hir-file-encode, r=Veykril

Encode the variants of `HirFileId` in a u32 with MSB as the tag

This saves 10mb on `self` analysis, while this does limit us to 2billion real files and 2 billion macro expansions, I doubt we will ever hit that limit :) `HirFileId` is used a lot, so going from 8 bytes to 4 is a decent win.

19 months agoEncode the variants of `HirFileId` in a u32 with MSB as the tag
Lukas Wirth [Fri, 25 Nov 2022 22:17:21 +0000 (23:17 +0100)]
Encode the variants of `HirFileId` in a u32 with MSB as the tag

19 months agoAuto merge of #13676 - fasterthanlime:subtree-fix, r=Veykril
bors [Fri, 25 Nov 2022 21:27:46 +0000 (21:27 +0000)]
Auto merge of #13676 - fasterthanlime:subtree-fix, r=Veykril

Mega-sync from `rust-lang/rust`

This essentially implements `@oli-obk's` suggestion here https://github.com/rust-lang/rust-analyzer/pull/13459#issuecomment-1297285607, with `@eddyb's` help.

This PR is equivalent to 14 syncs (back and forth) between `rust-lang/rust` and `rust-lang/rust-analyzer`.

Working from this list (from bottom to top):

```
(x) a2a1d9954 :arrow_up: rust-analyzer
(x) 79923c382 :arrow_up: rust-analyzer
(x) c60b1f641 :arrow_up: rust-analyzer
(x) 8807fc4cc :arrow_up: rust-analyzer
(x) a99a48e78 :arrow_up: rust-analyzer
(x) 4f55ebbd4 :arrow_up: rust-analyzer
(x) f5fde4df4 :arrow_up: rust-analyzer
(x) 459bbb422 :arrow_up: rust-analyzer
(x) 65e1dc4d9 :arrow_up: rust-analyzer
(x) 3e358a682 :arrow_up: rust-analyzer
(x) 31519bb39 :arrow_up: rust-analyzer
(x) 8231fee46 :arrow_up: rust-analyzer
(x) 22c8c9c40 :arrow_up: rust-analyzer
(x) 9d2cb42a4 :arrow_up: rust-analyzer
```

(This listed was assembled by doing a `git subtree push`, which made a branch, and looking at the new commits in that branch, picking only those that were `:arrow_up: rust-analyzer` commits)

We used the following commands to simulate merges in both directions:

```shell
TO_MERGE=22c8c9c40 # taken from the list above, bottom to top
git merge --no-edit --no-ff $TO_MERGE
git merge --no-edit --no-ff $(git -C ../rust log --pretty=format:'%cN | %s | %ad => %P' | rg -m1 -F "$(git show --no-patch --pretty=format:%ad $TO_MERGE)" | tee /dev/stderr | rg '.* => \S+ (\S+)$' --replace '$1')
```

We encountered no merge conflicts that Git wasn't able to solve by doing it this way.

Here's what the commit graph looks like (as shown in the Git Lens VSCode extension):

<img width="1345" alt="image" src="https://user-images.githubusercontent.com/7998310/203984523-7c1a690a-8224-416c-8015-ed6e49667066.png">

This PR closes #13459

## Does this unbreak `rust->ra` syncs?

Yes, here's how we tried:

In `rust-analyzer`:

  * check out `subtree-fix` (this PR's branch)
  * make a new branch off of it: `git checkout -b subtree-fix-merge-test`
  * simulate this PR getting merged with `git merge master`

In `rust`:

  * pull latest master
  * make a new branch: `git checkout -b test-change`
  * mess with rust-analyzer (I added a comment to `src/tools/rust-analyzer/Cargo.toml`)
  * commit
  * run `git subtree push -P src/tools/rust-analyzer ra-local final-sync` (this follows the [Clippy sync guide](https://doc.rust-lang.org/nightly/clippy/development/infrastructure/sync.html))

This created a `final-sync` branch in `rust-analyzer`.

In `rust-analyzer`:

  * `git merge --no-ff final-sync` (this follows the [Clippy sync guide](https://doc.rust-lang.org/nightly/clippy/development/infrastructure/sync.html))

Now `git log` in `rust-analyzer` shows this:

```
commit 460128387e46ddfc2b95921b2d7f6e913a3d2b9f (HEAD -> subtree-fix-merge-test)
Merge: 0513fc02a 9ce6a734f
Author: Amos Wenger <amoswenger@gmail.com>
Date:   Fri Nov 25 13:28:24 2022 +0100

    Merge branch 'final-sync' into subtree-fix-merge-test

commit 0513fc02a08ea9de952983624bd0a00e98044b36
Merge: 38c98d1ff 6918009fe
Author: Amos Wenger <amoswenger@gmail.com>
Date:   Fri Nov 25 13:28:02 2022 +0100

    Merge branch 'master' into subtree-fix-merge-test

commit 9ce6a734f37ef8e53689f1c6f427a9efafe846bd (final-sync)
Author: Amos Wenger <amoswenger@gmail.com>
Date:   Fri Nov 25 13:26:26 2022 +0100

    Mess with rust-analyzer just for fun
```

And `git diff 0513fc02a08ea9de952983624bd0a00e98044b36` shows this:

```patch
diff --git a/Cargo.toml b/Cargo.toml
index 286ef1e7d..c9e24cd19 100644
--- a/Cargo.toml
+++ b/Cargo.toml
`@@` -32,3 +32,5 `@@` debug = 0
 # ungrammar = { path = "../ungrammar" }

 # salsa = { path = "../salsa" }
+
+# lol, hi
```

## Does this unbreak `ra->rust` syncs?

Yes, here's how we tried.

From `rust`:

  * `git checkout -b sync-from-ra`
  * `git subtree pull -P src/tools/rust-analyzer ra-local subtree-fix-merge-test` (this is adapted from the [Clippy sync guide](https://doc.rust-lang.org/nightly/clippy/development/infrastructure/sync.html#performing-the-sync-from-clippy-to-rust-langrust), you would normally use `ra-upstream master` but we're simulating things here)

A commit editor pops up, there was no merge conflicts.

## How do we prevent this from happening again?

Like `@bjorn3` said in https://github.com/rust-lang/rust-analyzer/pull/13459#issuecomment-1293587848

> Whenever syncing from rust-analyzer -> rust you have to immediately sync the merge commit from rust -> rust-analyzer to prevent merge conflicts in the future.

But if we get it wrong again, at least now we have a not-so-painful way to fix it.

19 months agoMerge commit '26562973b3482a635416b2b663a13016d4d90e20' into HEAD
Amos Wenger [Fri, 25 Nov 2022 12:06:33 +0000 (13:06 +0100)]
Merge commit '26562973b3482a635416b2b663a13016d4d90e20' into HEAD

19 months agoMerge commit 'a2a1d9954' into HEAD
Amos Wenger [Fri, 25 Nov 2022 12:06:31 +0000 (13:06 +0100)]
Merge commit 'a2a1d9954' into HEAD

19 months agoMerge commit 'd03c1c87d4ca2d524646316387d47b12524ac451' into HEAD
Amos Wenger [Fri, 25 Nov 2022 12:06:03 +0000 (13:06 +0100)]
Merge commit 'd03c1c87d4ca2d524646316387d47b12524ac451' into HEAD

19 months agoMerge commit '79923c382' into HEAD
Amos Wenger [Fri, 25 Nov 2022 12:06:01 +0000 (13:06 +0100)]
Merge commit '79923c382' into HEAD

19 months agoMerge commit 'ba28e19b7838e3ad4223ae82d074dc3950ef1548' into HEAD
Amos Wenger [Fri, 25 Nov 2022 12:05:27 +0000 (13:05 +0100)]
Merge commit 'ba28e19b7838e3ad4223ae82d074dc3950ef1548' into HEAD

19 months agoMerge commit 'c60b1f641' into HEAD
Amos Wenger [Fri, 25 Nov 2022 12:05:26 +0000 (13:05 +0100)]
Merge commit 'c60b1f641' into HEAD

19 months agoMerge commit '43fb9563b2943d6abc5f3552195f3e27ac618966' into HEAD
Amos Wenger [Fri, 25 Nov 2022 12:04:51 +0000 (13:04 +0100)]
Merge commit '43fb9563b2943d6abc5f3552195f3e27ac618966' into HEAD

19 months agoMerge commit '8807fc4cc' into HEAD
Amos Wenger [Fri, 25 Nov 2022 12:04:50 +0000 (13:04 +0100)]
Merge commit '8807fc4cc' into HEAD

19 months agoMerge commit '0531aab522f25d6aae30b2cc23a09f4b9257eedc' into HEAD
Amos Wenger [Fri, 25 Nov 2022 12:04:02 +0000 (13:04 +0100)]
Merge commit '0531aab522f25d6aae30b2cc23a09f4b9257eedc' into HEAD

19 months agoMerge commit 'a99a48e78' into HEAD
Amos Wenger [Fri, 25 Nov 2022 12:03:59 +0000 (13:03 +0100)]
Merge commit 'a99a48e78' into HEAD

19 months agoMerge commit '61504c8d951c566eb03037dcb300c96f4bd9a8b6' into HEAD
Amos Wenger [Fri, 25 Nov 2022 12:03:12 +0000 (13:03 +0100)]
Merge commit '61504c8d951c566eb03037dcb300c96f4bd9a8b6' into HEAD

19 months agoMerge commit '4f55ebbd4' into HEAD
Amos Wenger [Fri, 25 Nov 2022 12:03:10 +0000 (13:03 +0100)]
Merge commit '4f55ebbd4' into HEAD

19 months agoMerge commit '187bee0bb100111466a3557c20f80defcc0f4db3' into HEAD
Amos Wenger [Fri, 25 Nov 2022 12:02:46 +0000 (13:02 +0100)]
Merge commit '187bee0bb100111466a3557c20f80defcc0f4db3' into HEAD

19 months agoMerge commit 'f5fde4df4' into HEAD
Amos Wenger [Fri, 25 Nov 2022 12:02:44 +0000 (13:02 +0100)]
Merge commit 'f5fde4df4' into HEAD

19 months agoMerge commit '2e9f1204ca01c3e20898d4a67c8b84899d394a88' into HEAD
Amos Wenger [Fri, 25 Nov 2022 12:02:11 +0000 (13:02 +0100)]
Merge commit '2e9f1204ca01c3e20898d4a67c8b84899d394a88' into HEAD

19 months agoMerge commit '459bbb422' into HEAD
Amos Wenger [Fri, 25 Nov 2022 12:02:06 +0000 (13:02 +0100)]
Merge commit '459bbb422' into HEAD

19 months agoMerge commit '67920f797511c360b25dab4d30730be304848f32' into HEAD
Amos Wenger [Fri, 25 Nov 2022 11:58:20 +0000 (12:58 +0100)]
Merge commit '67920f797511c360b25dab4d30730be304848f32' into HEAD

19 months agoMerge commit '65e1dc4d9' into HEAD
Amos Wenger [Fri, 25 Nov 2022 11:58:18 +0000 (12:58 +0100)]
Merge commit '65e1dc4d9' into HEAD

19 months agoMerge commit 'e8e598f6415461e7fe957eec1bee6afb55927d59' into HEAD
Amos Wenger [Fri, 25 Nov 2022 11:58:02 +0000 (12:58 +0100)]
Merge commit 'e8e598f6415461e7fe957eec1bee6afb55927d59' into HEAD

19 months agoMerge commit '3e358a682' into HEAD
Amos Wenger [Fri, 25 Nov 2022 11:58:00 +0000 (12:58 +0100)]
Merge commit '3e358a682' into HEAD

19 months agoMerge commit 'a670ff888437f4b6a3d24cc2996e9f969a87cbae' into HEAD
Amos Wenger [Fri, 25 Nov 2022 11:57:43 +0000 (12:57 +0100)]
Merge commit 'a670ff888437f4b6a3d24cc2996e9f969a87cbae' into HEAD

19 months agoMerge commit '31519bb39' into HEAD
Amos Wenger [Fri, 25 Nov 2022 11:57:38 +0000 (12:57 +0100)]
Merge commit '31519bb39' into HEAD

19 months agoMerge commit 'b6d59f2bb4fae0ba4f74e2c967b5e2f777f8c860' into HEAD
Amos Wenger [Fri, 25 Nov 2022 11:55:14 +0000 (12:55 +0100)]
Merge commit 'b6d59f2bb4fae0ba4f74e2c967b5e2f777f8c860' into HEAD

19 months agoMerge commit '8231fee46' into HEAD
Amos Wenger [Fri, 25 Nov 2022 11:55:08 +0000 (12:55 +0100)]
Merge commit '8231fee46' into HEAD

19 months agoMerge commit '634cfe3d72e785c843ca5d412b12be137b2e14fb' into HEAD
Amos Wenger [Fri, 25 Nov 2022 11:54:28 +0000 (12:54 +0100)]
Merge commit '634cfe3d72e785c843ca5d412b12be137b2e14fb' into HEAD

19 months agoMerge commit '22c8c9c40' into HEAD
Amos Wenger [Fri, 25 Nov 2022 11:13:34 +0000 (12:13 +0100)]
Merge commit '22c8c9c40' into HEAD

19 months agoMerge commit '8e38833c3674c1be7d81c6069c62e6ed52b18b27' into HEAD
Amos Wenger [Fri, 25 Nov 2022 11:01:49 +0000 (12:01 +0100)]
Merge commit '8e38833c3674c1be7d81c6069c62e6ed52b18b27' into HEAD

19 months agoAuto merge of #13647 - nyz93:fix/tuple-to-named-struct, r=Veykril
bors [Fri, 25 Nov 2022 09:41:21 +0000 (09:41 +0000)]
Auto merge of #13647 - nyz93:fix/tuple-to-named-struct, r=Veykril

fix: tuple to named struct inside macros

seems to fix #13634

19 months agoAuto merge of #13671 - Veykril:goto-decl, r=Veykril
bors [Fri, 25 Nov 2022 09:28:39 +0000 (09:28 +0000)]
Auto merge of #13671 - Veykril:goto-decl, r=Veykril

Improve goto declaration

Closes https://github.com/rust-lang/rust-analyzer/issues/13599

- goto decl now goes to assoc items of trait declarations over the items of trait implementations
- goto decl now goes to the field declaration (opposed to goto def which shows both the field decl and binding created/local being used)
- also adds back the goto definition fallback that seems to have been dropped at some point.

19 months agoGo to declaration goes to field declaration in pattern and expression shorthands
Lukas Wirth [Thu, 24 Nov 2022 23:03:48 +0000 (00:03 +0100)]
Go to declaration goes to field declaration in pattern and expression shorthands

19 months agoGo to declaration goes to assoc items of trait declarations
Lukas Wirth [Fri, 25 Nov 2022 09:27:49 +0000 (10:27 +0100)]
Go to declaration goes to assoc items of trait declarations

19 months agoAuto merge of #13638 - DesmondWillowbrook:hover-rest-pat-mvp, r=Veykril
bors [Fri, 25 Nov 2022 07:41:05 +0000 (07:41 +0000)]
Auto merge of #13638 - DesmondWillowbrook:hover-rest-pat-mvp, r=Veykril

feat: adds hover hint to ".." in record pattern

Hovering on the "rest" pattern in struct destructuring,
```rust
struct Baz {
    a: u32,
    b: u32,
    c: u32,
    d: u32
}

let Baz { a, b, ..$0} = Baz { a: 1, b: 2, c: 3, d: 4 };
```
shows:

```
.., c: u32, d: u32
```

Currently only works with struct patterns.

![image](https://user-images.githubusercontent.com/51814158/202837115-f424cc26-c2d7-4027-8eea-eeb7749ad146.png)

19 months agofix formatting
Kartavya Vashishtha [Fri, 25 Nov 2022 06:52:06 +0000 (12:22 +0530)]
fix formatting

19 months agoadd hover tests
Kartavya Vashishtha [Fri, 25 Nov 2022 06:50:38 +0000 (12:20 +0530)]
add hover tests

19 months agofix token method call
Kartavya Vashishtha [Fri, 25 Nov 2022 06:50:34 +0000 (12:20 +0530)]
fix token method call

19 months agoadd back [] in hover documentation
Kartavya Vashishtha [Fri, 25 Nov 2022 06:33:49 +0000 (12:03 +0530)]
add back [] in hover documentation

19 months agoCorrect node traversal to look at parent instead
Kartavya Vashishtha [Fri, 25 Nov 2022 06:32:15 +0000 (22:32 -0800)]
Correct node traversal to look at parent instead

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
19 months agoAuto merge of #13670 - Veykril:derive-helper, r=Veykril
bors [Thu, 24 Nov 2022 21:27:32 +0000 (21:27 +0000)]
Auto merge of #13670 - Veykril:derive-helper, r=Veykril

Add `deriveHelper` to `semanticTokenTypes` section of package.json

19 months agoAdd deriveHelper to semanticTokenTypes section of package.json
Lukas Wirth [Thu, 24 Nov 2022 21:26:05 +0000 (22:26 +0100)]
Add deriveHelper to semanticTokenTypes section of package.json

19 months agoAuto merge of #13652 - jhgg:hir-expand/fix-compile-error-expansion, r=Veykril
bors [Thu, 24 Nov 2022 21:00:48 +0000 (21:00 +0000)]
Auto merge of #13652 - jhgg:hir-expand/fix-compile-error-expansion, r=Veykril

hir-expand: fix compile_error! expansion not unquoting strings

expanding `compile_error!` would not properly unquote strings, leading to quite ugly diagnostic messages:

![image](https://user-images.githubusercontent.com/5489149/202893481-2486ede8-c79a-4972-9713-416d6a704064.png)

this fixes it, using the conveniently placed `unquote_str` function, which now makes errors look like:

![image](https://user-images.githubusercontent.com/5489149/202893466-0763efad-9240-4d55-80a6-6c62000d5d2b.png)

additionally, using `unquote_str` has the cool side-effect of *also* handling raw strings, so this fixes a fixme too!

19 months agoAuto merge of #13592 - MihailMihov:trait_impl_assist, r=Veykril
bors [Thu, 24 Nov 2022 20:44:33 +0000 (20:44 +0000)]
Auto merge of #13592 - MihailMihov:trait_impl_assist, r=Veykril

Add assist to generate trait impl's

resolves #13553

This pull request adds a `generate_trait_impl` assist, which generates trait impl's for a type. It is almost the same as the one to generate impl's and I also reduced the trigger range to only outside the `RecordFieldList`. Also moved all the tests into separate test functions. A few of the old tests seemed redundant, so I didn't port them.

19 months agoAuto merge of #13669 - Veykril:jod-child, r=Veykril
bors [Thu, 24 Nov 2022 20:31:38 +0000 (20:31 +0000)]
Auto merge of #13669 - Veykril:jod-child, r=Veykril

Properly implement Drop for JodGroupChild

19 months agoProperly implement Drop for JodGroupChild
Lukas Wirth [Thu, 24 Nov 2022 20:30:15 +0000 (21:30 +0100)]
Properly implement Drop for JodGroupChild

19 months agoAuto merge of #13661 - iredelmeier:fix-null-checkonsave-target, r=jonas-schievink
bors [Thu, 24 Nov 2022 15:52:27 +0000 (15:52 +0000)]
Auto merge of #13661 - iredelmeier:fix-null-checkonsave-target, r=jonas-schievink

Fix: Handle empty `checkOnSave/target` values

This fixes a regression introduced by #13290, in which failing to set `checkOnSave/target` (or `checkOnSave/targets`) would lead to an invalid config.

[Fixes #13660]

19 months agoAuto merge of #13576 - Bben01:supress_missing_impl_inside_block, r=jonas-schievink
bors [Thu, 24 Nov 2022 15:16:36 +0000 (15:16 +0000)]
Auto merge of #13576 - Bben01:supress_missing_impl_inside_block, r=jonas-schievink

Suppress "Implement default members" inside contained items

Fixes #13561

19 months agoAuto merge of #13667 - Veykril:detached-files-sysroot, r=Veykril
bors [Thu, 24 Nov 2022 09:21:44 +0000 (09:21 +0000)]
Auto merge of #13667 - Veykril:detached-files-sysroot, r=Veykril

Handle sysroot config in detached-files workspaces

19 months agoHandle sysroot config in detached-files workspaces
Lukas Wirth [Thu, 24 Nov 2022 09:21:19 +0000 (10:21 +0100)]
Handle sysroot config in detached-files workspaces

19 months ago:arrow_up: rust-analyzer
Laurențiu Nicola [Wed, 23 Nov 2022 15:24:03 +0000 (17:24 +0200)]
:arrow_up: rust-analyzer