]> git.lizzy.rs Git - rust.git/log
rust.git
23 months agoAuto merge of #11819 - rust-lang:dependabot/npm_and_yarn/editors/code/minimist-1...
bors [Mon, 18 Jul 2022 17:03:36 +0000 (17:03 +0000)]
Auto merge of #11819 - rust-lang:dependabot/npm_and_yarn/editors/code/minimist-1.2.6, r=Veykril

Bump minimist from 1.2.5 to 1.2.6 in /editors/code

Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/substack/minimist/commit/7efb22a518b53b06f5b02a1038a88bd6290c2846"><code>7efb22a</code></a> 1.2.6</li>
<li><a href="https://github.com/substack/minimist/commit/ef88b9325f77b5ee643ccfc97e2ebda577e4c4e2"><code>ef88b93</code></a> security notice for additional prototype pollution issue</li>
<li><a href="https://github.com/substack/minimist/commit/c2b981977fa834b223b408cfb860f933c9811e4d"><code>c2b9819</code></a> isConstructorOrProto adapted from PR</li>
<li><a href="https://github.com/substack/minimist/commit/bc8ecee43875261f4f17eb20b1243d3ed15e70eb"><code>bc8ecee</code></a> test from prototype pollution PR</li>
<li>See full diff in <a href="https://github.com/substack/minimist/compare/1.2.5...1.2.6">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=minimist&package-manager=npm_and_yarn&previous-version=1.2.5&new-version=1.2.6)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting ``@dependabot` rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- ``@dependabot` rebase` will rebase this PR
- ``@dependabot` recreate` will recreate this PR, overwriting any edits that have been made to it
- ``@dependabot` merge` will merge this PR after your CI passes on it
- ``@dependabot` squash and merge` will squash and merge this PR after your CI passes on it
- ``@dependabot` cancel merge` will cancel a previously requested merge and block automerging
- ``@dependabot` reopen` will reopen this PR if it is closed
- ``@dependabot` close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- ``@dependabot` ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` use these labels` will set the current labels as the default for future PRs for this repo and language
- ``@dependabot` use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- ``@dependabot` use these assignees` will set the current assignees as the default for future PRs for this repo and language
- ``@dependabot` use this milestone` will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/rust-analyzer/rust-analyzer/network/alerts).

</details>

23 months agoAuto merge of #12804 - jonas-schievink:config-watcher, r=Veykril
bors [Mon, 18 Jul 2022 16:41:26 +0000 (16:41 +0000)]
Auto merge of #12804 - jonas-schievink:config-watcher, r=Veykril

fix: make file watcher config a drop-down (and clarify the options)

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

Also renames "notify" to "server", since that's clearer ("notify" is still accepted for compatibility).

23 months agoAuto merge of #12549 - bitgaoshu:goto_where_trait_m_impl, r=Veykril
bors [Mon, 18 Jul 2022 16:29:23 +0000 (16:29 +0000)]
Auto merge of #12549 - bitgaoshu:goto_where_trait_m_impl, r=Veykril

feat: Go to implementation of trait methods

try goto where the trait method implies,  #4558

23 months agoMove `convert_to_def_in_trait` into `ide-db`
Lukas Wirth [Mon, 18 Jul 2022 16:23:50 +0000 (18:23 +0200)]
Move `convert_to_def_in_trait` into `ide-db`

23 months agoImprove file watcher config
Jonas Schievink [Mon, 18 Jul 2022 15:50:56 +0000 (17:50 +0200)]
Improve file watcher config

23 months agoAuto merge of #12802 - rust-lang:jonas-schievink-patch-1, r=jonas-schievink
bors [Mon, 18 Jul 2022 15:46:36 +0000 (15:46 +0000)]
Auto merge of #12802 - rust-lang:jonas-schievink-patch-1, r=jonas-schievink

minor: Remove macro ABI version from doc comment

It's hard to remember to keep this in sync, but since the file path already contains the version, this comment is pretty unnecessary.

23 months agoRemove macro ABI version from doc comment
Jonas Schievink [Mon, 18 Jul 2022 15:44:53 +0000 (17:44 +0200)]
Remove macro ABI version from doc comment

It's hard to remember to keep this in sync, but since the file path already contains the version, this comment is pretty unnecessary.

23 months agoAuto merge of #12798 - jonas-schievink:trim-proc-macro-abis, r=jonas-schievink
bors [Mon, 18 Jul 2022 13:12:10 +0000 (13:12 +0000)]
Auto merge of #12798 - jonas-schievink:trim-proc-macro-abis, r=jonas-schievink

internal: Remove outdated proc macro ABIs

Drops support for 1.48 to 1.57. We still support 1.58+, which is 4 versions out of date, so that should be plenty.

23 months agoRemove outdated proc macro ABIs
Jonas Schievink [Mon, 18 Jul 2022 12:58:50 +0000 (14:58 +0200)]
Remove outdated proc macro ABIs

23 months agoAuto merge of #12788 - hasali19:extract-var-mut, r=jonas-schievink
bors [Mon, 18 Jul 2022 12:42:05 +0000 (12:42 +0000)]
Auto merge of #12788 - hasali19:extract-var-mut, r=jonas-schievink

Fix extract variable assist for subexpression in mutable borrow

This checks if the expression is in a mutable borrow and if so makes the extracted variable `mut`.

Closes #12786

23 months agoAuto merge of #12795 - jonas-schievink:proc-macro-abi-1.64, r=jonas-schievink
bors [Mon, 18 Jul 2022 12:32:46 +0000 (12:32 +0000)]
Auto merge of #12795 - jonas-schievink:proc-macro-abi-1.64, r=jonas-schievink

feat: Support the 1.64 nightly proc macro ABI

Should resolve https://github.com/rust-lang/rust-analyzer/issues/12600

Not sure why I thought the Rust version was the same as on beta, that's never the case (but future nightly changes can break the ABI again).

23 months agoSupport the 1.64 nightly proc macro ABI
Jonas Schievink [Mon, 18 Jul 2022 12:31:21 +0000 (14:31 +0200)]
Support the 1.64 nightly proc macro ABI

23 months agoAuto merge of #12286 - harpsword:fix_generate_constant, r=Veykril
bors [Mon, 18 Jul 2022 10:24:53 +0000 (10:24 +0000)]
Auto merge of #12286 - harpsword:fix_generate_constant, r=Veykril

fix: “Generate constant” ignores the path prefix of the identifier

fix #12022

add abilities to generate constant with prefix path, even these mods in path are not exist.

## some examples

https://user-images.githubusercontent.com/10148927/168710096-59d5c594-0e4a-4ba7-bfb3-21c4b99409ea.mov

https://user-images.githubusercontent.com/10148927/168710111-cd6d3df4-58eb-4358-ae9e-791bfc408efa.mov

https://user-images.githubusercontent.com/10148927/168710115-601923b7-2164-4b9a-85a9-fbb4b29796a1.mov

https://user-images.githubusercontent.com/10148927/168710118-3d4bc9c1-758b-4e6f-9709-568fa920937d.mov

23 months agofix: “Generate constant” ignores the path prefix of the identifier
harpsword [Sun, 1 May 2022 09:08:09 +0000 (17:08 +0800)]
fix: “Generate constant” ignores the path prefix of the identifier

23 months agoFix extract variable assist for subexpression in mutable borrow
Hasan Ali [Sun, 17 Jul 2022 21:42:03 +0000 (22:42 +0100)]
Fix extract variable assist for subexpression in mutable borrow

23 months agoAuto merge of #12785 - Logarithmus:feature/fix-negative-const-generics, r=Veykril
bors [Sun, 17 Jul 2022 17:53:02 +0000 (17:53 +0000)]
Auto merge of #12785 - Logarithmus:feature/fix-negative-const-generics, r=Veykril

fix: un-inline `ConstScalarOrPath::from_expr_opt`

Sorry, but I missed these from #12778 `@flodiebold`

23 months agofix: un-inline `ConstScalarOrPath::from_expr_opt`
Artur Sinila [Sun, 17 Jul 2022 17:35:34 +0000 (20:35 +0300)]
fix: un-inline `ConstScalarOrPath::from_expr_opt`

23 months agoAuto merge of #12778 - Logarithmus:feature/fix-negative-const-generics, r=flodiebold
bors [Sun, 17 Jul 2022 17:17:39 +0000 (17:17 +0000)]
Auto merge of #12778 - Logarithmus:feature/fix-negative-const-generics, r=flodiebold

Support negative, `char` & `bool` const generics

Before:
![Before](https://user-images.githubusercontent.com/29541480/179379832-0c3b2a74-fef6-427e-b89f-7e31d9c37b3d.png)

After:
![After](https://user-images.githubusercontent.com/29541480/179379863-b62475dd-e7bf-41f2-b437-08dfe55951af.png)

I tried to implement stuff like `Const<{NUM1 + 3 + NUM2}>` by using already existing constant evaluation mechanism for ordinary constants, but turned out to be harder than I thought, maybe because I've never ever tinkered with compilers before

23 months agofix: address suggestions
Artur Sinila [Sun, 17 Jul 2022 15:22:11 +0000 (18:22 +0300)]
fix: address suggestions

23 months agorefactor: inline some variables
Artur Sinila [Sun, 17 Jul 2022 11:55:21 +0000 (14:55 +0300)]
refactor: inline some variables

23 months agoAuto merge of #12781 - iDawer:hir_display.stack_overflow, r=lnicola
bors [Sun, 17 Jul 2022 11:01:15 +0000 (11:01 +0000)]
Auto merge of #12781 - iDawer:hir_display.stack_overflow, r=lnicola

fix: Stack overflows and wrong type inference of associated type shorthands

This fixes `generic_predicates_for_param_query` comparing local IDs that belong to different definitions.

As the query is used in multiple places this fix affects various r-a features when an associated type shorthand and `impl Trait` involved. Notably inference, goto, completion, hover.

Fixes #12484

23 months agoCheck for local IDs belong to same definition
iDawer [Sun, 17 Jul 2022 06:41:17 +0000 (11:41 +0500)]
Check for local IDs belong to same definition

23 months agofeat: support negative const generic parameters
Artur Sinila [Sun, 17 Jul 2022 01:18:53 +0000 (04:18 +0300)]
feat: support negative const generic parameters

* feat: support `bool` & `char` const generics

23 months agotests: add hover tests for const generics
Artur Sinila [Wed, 13 Jul 2022 21:32:25 +0000 (00:32 +0300)]
tests: add hover tests for const generics

23 months agoAuto merge of #12689 - Veykril:macro-rec, r=Veykril
bors [Sat, 16 Jul 2022 16:45:26 +0000 (16:45 +0000)]
Auto merge of #12689 - Veykril:macro-rec, r=Veykril

internal: Record all macro definitions in ItemScope

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

Doesn't resolve the shadowing issues though, fixing those is gonna be really tricky I believe unless we can come up with a nice scheme to "order" item tree items (using syntax ranges and file ids would be a pain and also a bad idea since that'll require us to potentially reparse files in collection).

23 months agoAuto merge of #12539 - soruh:instanciate_empty_structs, r=Veykril
bors [Sat, 16 Jul 2022 16:36:57 +0000 (16:36 +0000)]
Auto merge of #12539 - soruh:instanciate_empty_structs, r=Veykril

Automatically instaciate trivially instaciable structs in "Generate new" and "Fill struct fields"

As proposed in #12535 this PR changes the "Generate new" and "Fill struct fields" assist/diagnostic to instanciate structs with no fields and enums with a single empty variant.

For example:
```rust
pub enum Bar {
    Bar {},
}
struct Foo<T> {
    a: usize,
    bar: Bar,
    _phantom: std::marker::PhantomData<T>,
}
impl<T> Foo<T> {
    /* generate new */

    fn random() -> Self {
        Self { /* Fill struct fields */ }
    }
}
```

was previously:
```rust
impl<T> Foo<T> {
    fn new(a: usize, bar: Bar, _phantom: std::marker::PhantomData<T>) -> Self {
        Self { a, bar, _phantom }
    }

    fn random() -> Self {
        Self {
            a: todo!(),
            bar: todo!(),
            _phantom: todo!(),
        }
    }
}
```

and is now:
```rust
impl<T> Foo<T> {
  fn new(a: usize) -> Self {
      Self {
          a,
          bar: Bar::Bar {},
          _phantom: std::marker::PhantomData
      }
  }

  fn random() -> Self {
      Self {
          a: todo!(),
          bar: Bar::Bar {},
          _phantom: std::marker::PhantomData,
      }
  }
}
```

I'd be happy about any suggestions.

## TODO
   - [x]  deduplicate `use_trivial_constructor` (unclear how to do as it's used in two separate crates)
   - [x]  write tests

Closes #12535

23 months agoAuto merge of #12712 - harpsword:fix-rename-crate-root, r=Veykril
bors [Sat, 16 Jul 2022 16:28:41 +0000 (16:28 +0000)]
Auto merge of #12712 - harpsword:fix-rename-crate-root, r=Veykril

fix: ignore renames for crate root

close #12684 . I just ignore renames for crate root in `rename_mod` func.

23 months agoAuto merge of #12775 - flodiebold:syntax-fixup-if, r=flodiebold
bors [Sat, 16 Jul 2022 11:05:19 +0000 (11:05 +0000)]
Auto merge of #12775 - flodiebold:syntax-fixup-if, r=flodiebold

fix: Improve syntax fixup a bit, handle incomplete `if`

- allow appending tokens after a token, not just a node
- allow inserting delimiters (and remove them again)
- fix up `if {}` and `if` without anything following

23 months agoImprove syntax fixup a bit, handle incomplete `if`
Florian Diebold [Sat, 16 Jul 2022 10:38:33 +0000 (12:38 +0200)]
Improve syntax fixup a bit, handle incomplete `if`

- allow appending tokens after a token, not just a node
- allow inserting delimiters (and remove them again)
- fix up `if {}` and `if` without anything following

23 months agoAuto merge of #12776 - matklad:nosu, r=matklad
bors [Sat, 16 Jul 2022 10:45:34 +0000 (10:45 +0000)]
Auto merge of #12776 - matklad:nosu, r=matklad

try fixing spurious CI failures on windows

It seems like it may be related to self-update? Anyways, I think we
should be disabling self-update on CI

23 months agotry fixing spurious CI failures on windows
Aleksey Kladov [Sat, 16 Jul 2022 10:42:28 +0000 (11:42 +0100)]
try fixing spurious CI failures on windows

It seems like it may be related to self-update? Anyways, I think we
should be disabling self-update on CI

23 months agoAuto merge of #12773 - Veykril:self-compl, r=Veykril
bors [Sat, 16 Jul 2022 10:28:52 +0000 (10:28 +0000)]
Auto merge of #12773 - Veykril:self-compl, r=Veykril

fix: Improve self param completion applicability

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

23 months agofix: Improve self param completion applicability
Lukas Wirth [Sat, 16 Jul 2022 10:17:31 +0000 (12:17 +0200)]
fix: Improve self param completion applicability

23 months agoAuto merge of #12772 - Veykril:nameres, r=Veykril
bors [Sat, 16 Jul 2022 09:50:22 +0000 (09:50 +0000)]
Auto merge of #12772 - Veykril:nameres, r=Veykril

internal: Remove allocation in DefCollector::reseed_with_unresolved_attribute

23 months agoAuto merge of #12766 - Veykril:completion-vis, r=Veykril
bors [Sat, 16 Jul 2022 09:29:20 +0000 (09:29 +0000)]
Auto merge of #12766 - Veykril:completion-vis, r=Veykril

fix: Don't show qualified path completions for private items

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

23 months agointernal: Remove allocation in DefCollector::reseed_with_unresolved_attribute
Lukas Wirth [Sat, 16 Jul 2022 09:17:15 +0000 (11:17 +0200)]
internal: Remove allocation in DefCollector::reseed_with_unresolved_attribute

23 months agoAuto merge of #12764 - matklad:rustupaction, r=lnicola
bors [Sat, 16 Jul 2022 05:28:32 +0000 (05:28 +0000)]
Auto merge of #12764 - matklad:rustupaction, r=lnicola

Remove deprecate action

https://old.reddit.com/r/rust/comments/vyx4oj/actionsrs_organization_became_unmaintained/

Looking at this holistically, I don't fully understand *why* we need an
action here? Seems like we can just use rustup? nowadays github runners
come with rustup pre-installed.

23 months agoRemove deprecate action
Aleksey Kladov [Thu, 14 Jul 2022 19:24:38 +0000 (20:24 +0100)]
Remove deprecate action

https://old.reddit.com/r/rust/comments/vyx4oj/actionsrs_organization_became_unmaintained/

Looking at this holistically, I don't fully understand *why* we need an
action here? Seems like we can just use rustup? nowadays github runners
come with rustup pre-installed.

23 months agoUpdate .github/workflows/release.yaml
Aleksey Kladov [Thu, 14 Jul 2022 19:56:37 +0000 (20:56 +0100)]
Update .github/workflows/release.yaml

Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
23 months agoRemove deprecate action
Aleksey Kladov [Thu, 14 Jul 2022 19:24:38 +0000 (20:24 +0100)]
Remove deprecate action

https://old.reddit.com/r/rust/comments/vyx4oj/actionsrs_organization_became_unmaintained/

Looking at this holistically, I don't fully understand *why* we need an
action here? Seems like we can just use rustup? nowadays github runners
come with rustup pre-installed.

23 months agofix: Don't show qualified path completions for private items
Lukas Wirth [Thu, 14 Jul 2022 21:22:54 +0000 (23:22 +0200)]
fix: Don't show qualified path completions for private items

23 months agoAuto merge of #12765 - Veykril:import-insert-fix, r=Veykril
bors [Thu, 14 Jul 2022 20:57:22 +0000 (20:57 +0000)]
Auto merge of #12765 - Veykril:import-insert-fix, r=Veykril

fix: Fix imports being inserted before doc comments in inline modules

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

23 months agofix: Fix imports being inserted before doc comments in inline modules
Lukas Wirth [Thu, 14 Jul 2022 20:56:56 +0000 (22:56 +0200)]
fix: Fix imports being inserted before doc comments in inline modules

23 months agoAuto merge of #12556 - DorianListens:dscheidt/generic-extract, r=Veykril
bors [Thu, 14 Jul 2022 14:29:37 +0000 (14:29 +0000)]
Auto merge of #12556 - DorianListens:dscheidt/generic-extract, r=Veykril

fix: Support generics in extract_function assist

This change attempts to resolve issue #7636: Extract into Function does not
create a generic function with constraints when extracting generic code.

In `FunctionBody::analyze_container`, we now traverse the `ancestors` in search
of `AnyHasGenericParams`, and attach any `GenericParamList`s and `WhereClause`s
we find to the `ContainerInfo`.

Later, in `format_function`, we collect all the `GenericParam`s and
`WherePred`s from the container, and filter them to keep only types matching
`TypeParam`s used within the newly extracted function body or param list. We
can then include the new `GenericParamList` and `WhereClause` in the new
function definition.

This change only impacts `TypeParam`s. `LifetimeParam`s and `ConstParam`s are
out of scope for this change.

I've never contributed to this project before, but I did try to follow the style guide. I believe that this change represents an improvement over the status quo, but I think it's also fair to argue that it doesn't fully "fix" the linked issue. I'm totally open to merging this as is, or going further to try to make a more complete solution. Also: if there are other unit or integration tests I should add, please let me know where to look!

23 months agoAuto merge of #12691 - Veykril:proc-macro-diag, r=Veykril
bors [Thu, 14 Jul 2022 14:21:16 +0000 (14:21 +0000)]
Auto merge of #12691 - Veykril:proc-macro-diag, r=Veykril

fix: Fix unresolved proc macro diagnostics pointing to macro expansions

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

23 months agoAuto merge of #12735 - feniljain:fix-completions, r=feniljain
bors [Thu, 14 Jul 2022 11:53:29 +0000 (11:53 +0000)]
Auto merge of #12735 - feniljain:fix-completions, r=feniljain

fix(completion): `super::` completion at crate root and module depth aware

- should close #12439
- Suggest super according to the depth in tree

23 months agofix(completion): `super::` completion at crate root and module depth
feniljain [Sun, 10 Jul 2022 08:38:49 +0000 (14:08 +0530)]
fix(completion): `super::` completion at crate root and module depth
aware

23 months agoMake search for applicable generics more precise
Dorian Scheidt [Wed, 13 Jul 2022 15:20:55 +0000 (10:20 -0500)]
Make search for applicable generics more precise

23 months agofix: Support generics in extract_function assist
Dorian Scheidt [Sat, 30 Apr 2022 17:29:55 +0000 (12:29 -0500)]
fix: Support generics in extract_function assist

This change attempts to resolve issue #7636: Extract into Function does not
create a generic function with constraints when extracting generic code.

In `FunctionBody::analyze_container`, we now traverse the `ancestors` in search
of `AnyHasGenericParams`, and attach any `GenericParamList`s and `WhereClause`s
we find to the `ContainerInfo`.

Later, in `format_function`, we collect all the `GenericParam`s and
`WherePred`s from the container, and filter them to keep only types matching
`TypeParam`s used within the newly extracted function body or param list. We
can then include the new `GenericParamList` and `WhereClause` in the new
function definition.

This change only impacts `TypeParam`s. `LifetimeParam`s and `ConstParam`s are
out of scope for this change.

23 months agoadd tests
soruh [Wed, 13 Jul 2022 14:16:48 +0000 (16:16 +0200)]
add tests

23 months agoAuto merge of #12755 - Veykril:server-version, r=lnicola
bors [Wed, 13 Jul 2022 12:00:16 +0000 (12:00 +0000)]
Auto merge of #12755 - Veykril:server-version, r=lnicola

fix: Set server binary version when distributing

23 months agofix: Set server binary version when distributing
Lukas Wirth [Wed, 13 Jul 2022 11:34:04 +0000 (13:34 +0200)]
fix: Set server binary version when distributing

23 months agoAuto merge of #12754 - Veykril:vscode-status, r=Veykril
bors [Wed, 13 Jul 2022 11:29:12 +0000 (11:29 +0000)]
Auto merge of #12754 - Veykril:vscode-status, r=Veykril

fix: Fix VSCode status bar tooltip not showing the error messages

23 months agofix: Fix VSCode status bar tooltip not showing the error messages
Lukas Wirth [Wed, 13 Jul 2022 11:16:35 +0000 (13:16 +0200)]
fix: Fix VSCode status bar tooltip not showing the error messages

23 months agoAuto merge of #12696 - hi-rustin:rustin-patch-fix, r=Veykril
bors [Wed, 13 Jul 2022 09:57:51 +0000 (09:57 +0000)]
Auto merge of #12696 - hi-rustin:rustin-patch-fix, r=Veykril

Add str_ref_to_string fix

close https://github.com/rust-lang/rust-analyzer/issues/11383
When type mismatch is `&str` -> `String` try to fix it.

23 months agoAuto merge of #12742 - TonalidadeHidrica:fix-obsolete-config-keys, r=Veykril
bors [Wed, 13 Jul 2022 09:46:26 +0000 (09:46 +0000)]
Auto merge of #12742 - TonalidadeHidrica:fix-obsolete-config-keys, r=Veykril

Fix obsolete config keys

The config keys were drastically reorganized by #12010, but the docs don't reflect the updates, causing inconsistency and confusion.  I checked for such obsolete configuration keys and updated to the new one.  For reproducibility, I attach a small shell script that I used to examine the old keys.  Now the script only detects `cargoExtraArgs` and `overrideCargo`, which originates from other type definition in the code but not from the configuration.

<details><summary>script</summary>

```bash
echo "allowMergingIntoGlobImports
exprFillDefault
importEnforceGranularity
importGranularity
importMergeBehavior
importMergeBehaviour
importGroup
importPrefix
warmup
loadOutDirsFromCheck
runBuildScripts
runBuildScriptsCommand
useRustcWrapperForBuildScripts
enableExperimental
procAttrMacros
breakPoints
exitPoints
yieldPoints
linksInHover
linksInHover
gotoTypeDef
chainingHints
closureReturnTypeHints
hideNamedConstructorHints
parameterHints
reborrowHints
typeHints
lruCapacity
cargoExtraArgs
overrideCargo
rustcSource
enableRangeFormatting
assist\.allowMergingIntoGlobImports
assist\.exprFillDefault
assist\.importEnforceGranularity
assist\.importGranularity
assist\.importMergeBehavior
assist\.importMergeBehaviour
assist\.importGroup
assist\.importPrefix
primeCaches\.enable
cache\.warmup
cargo\.loadOutDirsFromCheck
cargo\.runBuildScripts
cargo\.runBuildScriptsCommand
cargo\.useRustcWrapperForBuildScripts
completion\.snippets
diagnostics\.enableExperimental
experimental\.procAttrMacros
highlighting\.strings
highlightRelated\.breakPoints
highlightRelated\.exitPoints
highlightRelated\.yieldPoints
highlightRelated\.references
hover\.documentation
hover\.linksInHover
hoverActions\.linksInHover
hoverActions\.debug
hoverActions\.enable
hoverActions\.gotoTypeDef
hoverActions\.implementations
hoverActions\.references
hoverActions\.run
inlayHints\.chainingHints
inlayHints\.closureReturnTypeHints
inlayHints\.hideNamedConstructorHints
inlayHints\.parameterHints
inlayHints\.reborrowHints
inlayHints\.typeHints
lruCapacity
runnables\.cargoExtraArgs
runnables\.overrideCargo
rustcSource
rustfmt\.enableRangeFormatting
allFeatures
addCallArgumentSnippets
addCallParenthesis
callInfo\.full
cargo\.allFeatures
checkOnSave\.allFeatures
completion\.addCallArgumentSnippets
completion\.addCallParenthesis" | while read -r pattern
do
  rg '\b'$pattern'\b([^.]|$)' . -g "!crates/rust-analyzer/src/config/patch_old_style.rs" -g "!editors/code/src/config.ts" -g "!a.sh" --no-heading --color=always --line-number
done

exit

excluded
# debug
# enable
# run
# implementations
# references
# documentation
# references
# snippets
# strings
# full
```

</details>

23 months agoAuto merge of #12747 - jonas-schievink:proc-macro-abi-1.63, r=jonas-schievink
bors [Tue, 12 Jul 2022 13:29:25 +0000 (13:29 +0000)]
Auto merge of #12747 - jonas-schievink:proc-macro-abi-1.63, r=jonas-schievink

fix: Update 1.63 proc macro ABI to match rustc

This updates us to the ABI used by rustc 1.63.0-beta.5, which will likely be the ABI of the next stable Rust release. It should also work on nightly (for now, but future changes won't be supported until the rustc version is bumped).

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

23 months agoUpdate 1.63 proc macro ABI to match rustc
Jonas Schievink [Tue, 12 Jul 2022 13:13:04 +0000 (15:13 +0200)]
Update 1.63 proc macro ABI to match rustc

23 months agoAuto merge of #12745 - jonas-schievink:metavar-exprs, r=jonas-schievink
bors [Mon, 11 Jul 2022 16:34:49 +0000 (16:34 +0000)]
Auto merge of #12745 - jonas-schievink:metavar-exprs, r=jonas-schievink

feat: Implement `ignore`  and `index` metavar expression

Part of https://github.com/rust-lang/rust-analyzer/issues/11952

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

23 months agoImplement `ignore` and `index` metavar expression
Jonas Schievink [Mon, 11 Jul 2022 16:31:42 +0000 (18:31 +0200)]
Implement `ignore`  and `index` metavar expression

23 months agoAuto merge of #12744 - hi-rustin:rustin-patch-typos, r=lnicola
bors [Mon, 11 Jul 2022 13:51:20 +0000 (13:51 +0000)]
Auto merge of #12744 - hi-rustin:rustin-patch-typos, r=lnicola

Fix typos

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
23 months agoFix typos
hi-rustin [Mon, 11 Jul 2022 13:42:05 +0000 (21:42 +0800)]
Fix typos

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
23 months agoFix obsolete `completion.snippets` config
TonalidadeHidrica [Mon, 11 Jul 2022 08:00:40 +0000 (17:00 +0900)]
Fix obsolete `completion.snippets` config

23 months agoFix obsolete `enableRangeFormatting` config
TonalidadeHidrica [Mon, 11 Jul 2022 07:52:35 +0000 (16:52 +0900)]
Fix obsolete `enableRangeFormatting` config

23 months agoFix `rustcSource` -> `rustc_source`
TonalidadeHidrica [Mon, 11 Jul 2022 07:50:20 +0000 (16:50 +0900)]
Fix `rustcSource` -> `rustc_source`

This only fixes the comments in the internal source,
     which is not mandatory at all

23 months agoFix obsolete `diagnostics.experimental.enable`
TonalidadeHidrica [Mon, 11 Jul 2022 07:37:46 +0000 (16:37 +0900)]
Fix obsolete `diagnostics.experimental.enable`

23 months agoFix obsolete `loadOutDirsFromCheck` configs
TonalidadeHidrica [Mon, 11 Jul 2022 07:36:36 +0000 (16:36 +0900)]
Fix obsolete `loadOutDirsFromCheck` configs

23 months agoFix config keys regarding imports in docs
TonalidadeHidrica [Mon, 11 Jul 2022 06:42:49 +0000 (15:42 +0900)]
Fix config keys regarding imports in docs

23 months agofix: ignore renames for crate root
harpsword [Thu, 7 Jul 2022 14:25:25 +0000 (22:25 +0800)]
fix: ignore renames for crate root

23 months agoAuto merge of #12732 - lnicola:bump-npm, r=lnicola
bors [Sat, 9 Jul 2022 20:26:32 +0000 (20:26 +0000)]
Auto merge of #12732 - lnicola:bump-npm, r=lnicola

Bump npm deps

23 months agoBump transitive npm deps
Laurențiu Nicola [Sat, 9 Jul 2022 20:20:06 +0000 (23:20 +0300)]
Bump transitive npm deps

23 months agoBump @vscode/test-electron
Laurențiu Nicola [Sat, 9 Jul 2022 20:17:56 +0000 (23:17 +0300)]
Bump @vscode/test-electron

23 months agoBump @types/node to 16
Laurențiu Nicola [Sat, 9 Jul 2022 20:17:12 +0000 (23:17 +0300)]
Bump @types/node to 16

23 months agoBump typescript and tslib
Laurențiu Nicola [Sat, 9 Jul 2022 20:14:17 +0000 (23:14 +0300)]
Bump typescript and tslib

23 months agoBump prettier
Laurențiu Nicola [Sat, 9 Jul 2022 20:10:39 +0000 (23:10 +0300)]
Bump prettier

23 months agoBump @typescript-eslint
Laurențiu Nicola [Sat, 9 Jul 2022 20:10:07 +0000 (23:10 +0300)]
Bump @typescript-eslint

23 months agoBump vsce
Laurențiu Nicola [Sat, 9 Jul 2022 20:08:59 +0000 (23:08 +0300)]
Bump vsce

23 months agoBump eslint
Laurențiu Nicola [Sat, 9 Jul 2022 20:07:31 +0000 (23:07 +0300)]
Bump eslint

23 months agoBump esbuild
Laurențiu Nicola [Sat, 9 Jul 2022 20:06:45 +0000 (23:06 +0300)]
Bump esbuild

23 months agoBump d3 and d3-graphviz
Laurențiu Nicola [Sat, 9 Jul 2022 20:06:06 +0000 (23:06 +0300)]
Bump d3 and d3-graphviz

23 months agoBump vscode-languageclient
Laurențiu Nicola [Sat, 9 Jul 2022 20:04:14 +0000 (23:04 +0300)]
Bump vscode-languageclient

23 months agoAuto merge of #12727 - DorianListens:dscheidt/extract-var-field-name, r=jonas-schievink
bors [Sat, 9 Jul 2022 13:08:57 +0000 (13:08 +0000)]
Auto merge of #12727 - DorianListens:dscheidt/extract-var-field-name, r=jonas-schievink

fix: Improve suggested names for extracted variables

When extracting a field expression, if RA was unable to resolve the type of the
field, we would previously fall back to using "var_name" as the variable name.

Now, when the `Expr` being extracted matches a `FieldExpr`, we can use the
`NameRef`'s ident token as a fallback option.

fixes #10035

23 months agoFix test
hi-rustin [Sat, 9 Jul 2022 03:39:38 +0000 (11:39 +0800)]
Fix test

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
23 months agofix: Improve suggested names for extracted variables
Dorian Scheidt [Fri, 8 Jul 2022 23:01:44 +0000 (18:01 -0500)]
fix: Improve suggested names for extracted variables

When extracting a field expression, if RA was unable to resolve the type of the
field, we would previously fall back to using "var_name" as the variable name.

Now, when the `Expr` being extracted matches a `FieldExpr`, we can use the
`NameRef`'s ident token as a fallback option.

fixes #10035

23 months agoAuto merge of #12706 - DorianListens:dscheidt/closure-args, r=DorianListens
bors [Fri, 8 Jul 2022 15:02:02 +0000 (15:02 +0000)]
Auto merge of #12706 - DorianListens:dscheidt/closure-args, r=DorianListens

fix: Extract Function misses locals used in closures

This change fixes #12705.

In `FunctionBody::analyze`, we need to search any `ClosureExpr`s we encounter
for any `NameRef`s, to ensure they aren't missed.

23 months agofix: Extract Function misses locals used in closures
Dorian Scheidt [Wed, 6 Jul 2022 23:25:05 +0000 (18:25 -0500)]
fix: Extract Function misses locals used in closures

This change fixes #12705.

In `FunctionBody::analyze`, we need to search any `ClosureExpr`s we encounter
for any `NameRef`s, to ensure they aren't missed.

23 months agoAuto merge of #12719 - davidlattimore:format-args-no-unsafe, r=jonas-schievink
bors [Fri, 8 Jul 2022 14:10:19 +0000 (14:10 +0000)]
Auto merge of #12719 - davidlattimore:format-args-no-unsafe, r=jonas-schievink

Remove unnecessary unsafe from format_args expansion

23 months agoAuto merge of #12676 - DorianListens:dscheidt/extract-fun-trait-impl, r=jonas-schievink
bors [Fri, 8 Jul 2022 14:01:36 +0000 (14:01 +0000)]
Auto merge of #12676 - DorianListens:dscheidt/extract-fun-trait-impl, r=jonas-schievink

fix: Extract function from trait impl

This change fixes #10036, "Extract to function assist implements nonexistent
trait methods".

When we detect that the extraction is coming from within a trait impl, and that
a `self` param will be necessary, we adjust which `SyntaxNode` to `insert_after`,
and create a new empty `impl` block for the newly extracted function.

23 months agoAuto merge of #12722 - jonas-schievink:update-urls, r=jonas-schievink
bors [Fri, 8 Jul 2022 13:50:20 +0000 (13:50 +0000)]
Auto merge of #12722 - jonas-schievink:update-urls, r=jonas-schievink

internal: Update remaining GitHub URLs

The old links still work, but it seems less confusing to have them point to the right repo

23 months agoUpdate remaining GitHub URLs
Jonas Schievink [Fri, 8 Jul 2022 13:44:49 +0000 (15:44 +0200)]
Update remaining GitHub URLs

23 months agoAuto merge of #12716 - davidlattimore:fix-publish-crate-names, r=lnicola
bors [Fri, 8 Jul 2022 05:16:43 +0000 (05:16 +0000)]
Auto merge of #12716 - davidlattimore:fix-publish-crate-names, r=lnicola

publish workflow: Fix names for existing crates

Attempting to publish for example ra_ap_text-edit when ra_ap_text_edit
has already been published is rejected by crates.io.

23 months agoRemove unnecessary unsafe from format_args expansion
David Lattimore [Fri, 8 Jul 2022 04:56:18 +0000 (14:56 +1000)]
Remove unnecessary unsafe from format_args expansion

23 months agopublish workflow: Fix names for existing crates
David Lattimore [Fri, 8 Jul 2022 02:58:13 +0000 (12:58 +1000)]
publish workflow: Fix names for existing crates

Attempting to publish for example ra_ap_text-edit when ra_ap_text_edit
has already been published is rejected by crates.io.

23 months agoAuto merge of #12695 - xuhongxu96:fix-12140, r=jonas-schievink
bors [Wed, 6 Jul 2022 23:58:52 +0000 (23:58 +0000)]
Auto merge of #12695 - xuhongxu96:fix-12140, r=jonas-schievink

Complete type param/associated type in trait generic arg per arg index

- Fix #12140
- Also fix tidy check does not work for marks in multiline

23 months agofix default type param value position
Hongxu Xu [Wed, 6 Jul 2022 23:28:55 +0000 (07:28 +0800)]
fix default type param value position

23 months agoAuto merge of #12704 - jonas-schievink:smol-paths, r=jonas-schievink
bors [Wed, 6 Jul 2022 17:57:00 +0000 (17:57 +0000)]
Auto merge of #12704 - jonas-schievink:smol-paths, r=jonas-schievink

internal: Use `SmallVec` to slightly shrink `ModPath` size

Saves like a megabyte on r-a itself.

23 months agoUse `SmallVec` to slightly shrink `ModPath` size
Jonas Schievink [Wed, 6 Jul 2022 17:49:05 +0000 (19:49 +0200)]
Use `SmallVec` to slightly shrink `ModPath` size

23 months agocheck arg_idx >= n_params only if arg_idx >= n_required_params
Hongxu Xu [Wed, 6 Jul 2022 16:54:46 +0000 (00:54 +0800)]
check arg_idx >= n_params only if arg_idx >= n_required_params

23 months agoHandle generic args per arg index
Hongxu Xu [Wed, 6 Jul 2022 16:43:59 +0000 (00:43 +0800)]
Handle generic args per arg index
Add more test cases for generic args

23 months agoAuto merge of #12702 - lnicola:vscode-schemes, r=lnicola
bors [Wed, 6 Jul 2022 15:57:34 +0000 (15:57 +0000)]
Auto merge of #12702 - lnicola:vscode-schemes, r=lnicola

internal: use different schemes for the custom views

Related to #12699, but doesn't fix it because we still register the providers multiple times.