]> git.lizzy.rs Git - rust.git/log
rust.git
22 months agoRemove redundant --pre-release flag from publish
Laurențiu Nicola [Sun, 14 Aug 2022 17:52:43 +0000 (20:52 +0300)]
Remove redundant --pre-release flag from publish

22 months agoAuto merge of #13017 - Veykril:vscode-diag-workaround, r=Veykril
bors [Sat, 13 Aug 2022 18:50:38 +0000 (18:50 +0000)]
Auto merge of #13017 - Veykril:vscode-diag-workaround, r=Veykril

Pad empty diagnostic messages in relatedInformation as well

Follw up to https://github.com/rust-lang/rust-analyzer/pull/13016

22 months agoPad empty diagnostic messages in relatedInformation as well
Lukas Wirth [Sat, 13 Aug 2022 18:49:00 +0000 (20:49 +0200)]
Pad empty diagnostic messages in relatedInformation as well

22 months agoAuto merge of #13016 - Veykril:vscode-diag-workaround, r=Veykril
bors [Sat, 13 Aug 2022 18:35:09 +0000 (18:35 +0000)]
Auto merge of #13016 - Veykril:vscode-diag-workaround, r=Veykril

Move VSCode diagnostics workaroudn into client code

22 months agoMove VSCode diagnostics workaroudn into client code
Lukas Wirth [Sat, 13 Aug 2022 18:18:21 +0000 (20:18 +0200)]
Move VSCode diagnostics workaroudn into client code

22 months agoAuto merge of #13014 - Veykril:simplify, r=Veykril
bors [Sat, 13 Aug 2022 18:03:56 +0000 (18:03 +0000)]
Auto merge of #13014 - Veykril:simplify, r=Veykril

minor: Simplify `GlobalState::handle_event`

22 months agoSimplify `GlobalState::handle_event`
Lukas Wirth [Sat, 13 Aug 2022 18:03:06 +0000 (20:03 +0200)]
Simplify `GlobalState::handle_event`

22 months agoAuto merge of #13010 - Veykril:build-script-probes, r=Veykril
bors [Sat, 13 Aug 2022 14:12:38 +0000 (14:12 +0000)]
Auto merge of #13010 - Veykril:build-script-probes, r=Veykril

Do not unconditionally succeed RUSTC_WRAPPER checks when run by build scripts

rust-analyzer's RUSTC_WRAPPER unconditionally succeeds `cargo check`
invocations tripping up build scripts using `cargo check` to probe for
successful compilations. To prevent this from happening the RUSTC_WRAPPER
now checks if it's run from a build script by looking for the
`CARGO_CFG_TARGET_ARCH` env var that cargo sets only when running build
scripts.

22 months agoDo not unconditionally succeed RUSTC_WRAPPER checks when run by build scripts
Lukas Wirth [Sat, 13 Aug 2022 10:13:48 +0000 (12:13 +0200)]
Do not unconditionally succeed RUSTC_WRAPPER checks when run by build scripts

rust-analyzer's RUSTC_WRAPPER unconditionally succeeds `cargo check`
invocations tripping up build scripts using `cargo check` to probe for
successful compilations. To prevent this from happening the RUSTC_WRAPPER
now checks if it's run from a build script by looking for the
`CARGO_CFG_TARGET_ARCH` env var that cargo sets only when running build
scripts.

22 months agoAuto merge of #13007 - lnicola:node-16, r=lnicola
bors [Fri, 12 Aug 2022 15:23:18 +0000 (15:23 +0000)]
Auto merge of #13007 - lnicola:node-16, r=lnicola

Use Node 16 on CI and upgrade lockfile version

Code is on 16 too, there's hopefully no need to keep using the old version.

22 months agoUpgrade npm lockfile
Laurențiu Nicola [Fri, 12 Aug 2022 15:22:14 +0000 (18:22 +0300)]
Upgrade npm lockfile

22 months agoUse Node 16 in CI workflows
Laurențiu Nicola [Fri, 12 Aug 2022 15:19:48 +0000 (18:19 +0300)]
Use Node 16 in CI workflows

22 months agoAuto merge of #12993 - lowr:patch/swap-name-and-escaped-name, r=Veykril
bors [Fri, 12 Aug 2022 14:53:45 +0000 (14:53 +0000)]
Auto merge of #12993 - lowr:patch/swap-name-and-escaped-name, r=Veykril

Make `Name` hold escaped name

Resolves #12787
Resolves rust-lang/rust#99361

This PR effectively swaps `Name` and `EscapedName` in hir. In other words, it makes `Name` hold and print escaped raw identifiers and introduces another struct `UnescapedName` for cases where you need to print names without "r#" prefix.

My rationale is that it makes it easier for us to format an escaped name into string, which is what we want when we serialize names in general. This is because we format a name into string usually when we are presenting it to the users and arguably they expect its escaped form as that's what they see and write in the source code.

I split the change for `Name` into 3 commits to make it easier to follow but it also made some tests fail in the intermediate commits. I can squash them into a commit after the review if desired. I've also made similar changes for `ModPath` and `EscapedModPath` as it makes them consistent with `Name`.

For reference, there was a brief discussion on this in [a zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/escaping.20.60Name.60s).

22 months agoAuto merge of #12997 - Veykril:no-such-field, r=Veykril
bors [Thu, 11 Aug 2022 08:42:04 +0000 (08:42 +0000)]
Auto merge of #12997 - Veykril:no-such-field, r=Veykril

fix: Fix panic in `no_such_field` when using tuple fields on record structs

22 months agoFix panic in no_such_field when using tuple fields on record structs
Lukas Wirth [Thu, 11 Aug 2022 08:41:30 +0000 (10:41 +0200)]
Fix panic in no_such_field when using tuple fields on record structs

22 months agoAdd test for runnables with raw identifiers
Ryo Yoshida [Sat, 30 Jul 2022 13:28:34 +0000 (22:28 +0900)]
Add test for runnables with raw identifiers

22 months agoMake `ModPath` display escaped path
Ryo Yoshida [Wed, 10 Aug 2022 17:17:15 +0000 (02:17 +0900)]
Make `ModPath` display escaped path

22 months agoMake tests pass
Ryo Yoshida [Mon, 1 Aug 2022 06:20:14 +0000 (15:20 +0900)]
Make tests pass

22 months agoRemove `EscapedName`
Ryo Yoshida [Mon, 1 Aug 2022 06:19:49 +0000 (15:19 +0900)]
Remove `EscapedName`

22 months agoAdd `UnescapedName` and make `Name` hold escaped name
Ryo Yoshida [Mon, 1 Aug 2022 05:20:05 +0000 (14:20 +0900)]
Add `UnescapedName` and make `Name` hold escaped name

22 months agoAuto merge of #12989 - lnicola:rm-1-64-abi, r=Veykril
bors [Wed, 10 Aug 2022 14:53:21 +0000 (14:53 +0000)]
Auto merge of #12989 - lnicola:rm-1-64-abi, r=Veykril

internal: Remove incomplete 1.64 ABI

This no longer works for current nightlies and should not be needed any more, since we can use the toolchain's proc macro server instead.

22 months agoAuto merge of #12984 - Veykril:keep-going, r=Veykril
bors [Wed, 10 Aug 2022 14:43:23 +0000 (14:43 +0000)]
Auto merge of #12984 - Veykril:keep-going, r=Veykril

Use `--keep-going` cargo flag when building build scripts

See https://github.com/rust-lang/rust-analyzer/issues/12973#issuecomment-1209159426

22 months agoAuto merge of #12992 - lowr:fix/type-inference-for-byte-string-pat, r=Veykril
bors [Wed, 10 Aug 2022 11:05:02 +0000 (11:05 +0000)]
Auto merge of #12992 - lowr:fix/type-inference-for-byte-string-pat, r=Veykril

fix: infer byte string pattern as `&[u8]` when matched against slices

Fixes #12630

c.f. [rustc_typeck](https://github.com/rust-lang/rust/blob/1603a70f82240ba2d27f72f964e36614d7620ad3/compiler/rustc_typeck/src/check/pat.rs#L388-L404)

22 months agofix: infer byte string pattern as `&[u8]` when matched against slices
Ryo Yoshida [Wed, 10 Aug 2022 10:17:13 +0000 (19:17 +0900)]
fix: infer byte string pattern as `&[u8]` when matched against slices

22 months agoAuto merge of #12990 - edwin0cheng:improve-ws, r=Veykril
bors [Wed, 10 Aug 2022 09:29:19 +0000 (09:29 +0000)]
Auto merge of #12990 - edwin0cheng:improve-ws, r=Veykril

fix: Improve whitespace insertion in mbe

Related:  https://github.com/rust-lang/rust-analyzer/issues/12260#issuecomment-1126957162

22 months agoFixes tests
Edwin Cheng [Wed, 10 Aug 2022 08:29:23 +0000 (16:29 +0800)]
Fixes tests

22 months agoImprove insert whitespace in mbe
Edwin Cheng [Wed, 10 Aug 2022 08:28:56 +0000 (16:28 +0800)]
Improve insert whitespace in mbe

22 months agoRe-try build script building with --keep-going
Lukas Wirth [Wed, 10 Aug 2022 08:23:46 +0000 (10:23 +0200)]
Re-try build script building with --keep-going

22 months agoRemove incomplete 1.64 ABI
Laurențiu Nicola [Wed, 10 Aug 2022 07:49:49 +0000 (10:49 +0300)]
Remove incomplete 1.64 ABI

22 months agoAuto merge of #12987 - Veykril:ellipsis-recov, r=Veykril
bors [Tue, 9 Aug 2022 21:03:04 +0000 (21:03 +0000)]
Auto merge of #12987 - Veykril:ellipsis-recov, r=Veykril

Recover from missing ellipsis in record literals for path expressions

22 months agoAuto merge of #12986 - Veykril:completions, r=Veykril
bors [Tue, 9 Aug 2022 16:23:54 +0000 (16:23 +0000)]
Auto merge of #12986 - Veykril:completions, r=Veykril

Fix pattern field completions not working for unions

22 months agoRecover from missing ellipsis in record literals for path expressions
Lukas Wirth [Tue, 9 Aug 2022 16:23:25 +0000 (18:23 +0200)]
Recover from missing ellipsis in record literals for path expressions

22 months agoAdd some more `cov_mark`s
Lukas Wirth [Tue, 9 Aug 2022 16:08:05 +0000 (18:08 +0200)]
Add some more `cov_mark`s

22 months agoFix pattern field completions not working for unions
Lukas Wirth [Tue, 9 Aug 2022 15:53:16 +0000 (17:53 +0200)]
Fix pattern field completions not working for unions

22 months agoUse `--keep-going` cargo flag when building build scripts
Lukas Wirth [Tue, 9 Aug 2022 12:31:17 +0000 (14:31 +0200)]
Use `--keep-going` cargo flag when building build scripts

22 months agoAuto merge of #12981 - kadiwa4:remove_some_imports, r=Veykril
bors [Tue, 9 Aug 2022 07:03:35 +0000 (07:03 +0000)]
Auto merge of #12981 - kadiwa4:remove_some_imports, r=Veykril

Remove imports that are also in edition 2021's prelude

small cleanup

22 months agoremove imports that are also in edition 2021's prelude
KaDiWa [Mon, 8 Aug 2022 23:16:32 +0000 (01:16 +0200)]
remove imports that are also in edition 2021's prelude

22 months agoAuto merge of #12974 - fprasx:master, r=lnicola
bors [Mon, 8 Aug 2022 15:13:20 +0000 (15:13 +0000)]
Auto merge of #12974 - fprasx:master, r=lnicola

Corrected order of printing op and `=`

Fixes https://github.com/rust-lang/rust-analyzer/issues/12971 where `Display` impl for assignment operators does `=+` instead of `+=`

22 months agoCorrected order of printing op and `=`
fprasx [Mon, 8 Aug 2022 15:05:18 +0000 (11:05 -0400)]
Corrected order of printing op and `=`

22 months agoAuto merge of #12962 - lowr:patch/parse-last-range-pattern, r=Veykril
bors [Mon, 8 Aug 2022 15:03:39 +0000 (15:03 +0000)]
Auto merge of #12962 - lowr:patch/parse-last-range-pattern, r=Veykril

Parse range patterns in struct and slice without trailing comma

Resolves #12935

This patch includes the support for range patterns in slices, which is unstable (tracked in https://github.com/rust-lang/rust/issues/67264). If it's not desired I can remove it.

22 months agoParse range patterns in let statement with type annotation
Ryo Yoshida [Mon, 8 Aug 2022 15:00:22 +0000 (00:00 +0900)]
Parse range patterns in let statement with type annotation

22 months agoAuto merge of #12967 - jhgg:code/fix-toggle-hints, r=Veykril
bors [Mon, 8 Aug 2022 12:05:07 +0000 (12:05 +0000)]
Auto merge of #12967 - jhgg:code/fix-toggle-hints, r=Veykril

[code] make toggleInlayHints understand {off,on}UntilPressed

fixes #12964

22 months agoAuto merge of #12951 - jonas-schievink:doc-cli-stability, r=Veykril
bors [Mon, 8 Aug 2022 11:56:44 +0000 (11:56 +0000)]
Auto merge of #12951 - jonas-schievink:doc-cli-stability, r=Veykril

internal: Document CLI flag stability

22 months agoAuto merge of #12905 - HKalbasi:master, r=Veykril
bors [Mon, 8 Aug 2022 11:46:22 +0000 (11:46 +0000)]
Auto merge of #12905 - HKalbasi:master, r=Veykril

Generate rust type from json

fix #10118

Should this be a diagnostic? I made it a diagnostic because of issue label.

22 months agoAuto merge of #12937 - fprasx:master, r=Veykril
bors [Mon, 8 Aug 2022 11:37:51 +0000 (11:37 +0000)]
Auto merge of #12937 - fprasx:master, r=Veykril

Add fixups for incomplete in proc-macros

Partially implements https://github.com/rust-lang/rust-analyzer/issues/12777.

Added support for for loops and match statements.

I couldn't do paths like `crate::foo::` as I wasn't able to add `SyntheticTokens` to the end of `foo::`, they always ended up after `crate::`

This is my first contribution so please don't be shy about letting me know if I've done anything wrong!

22 months agoAuto merge of #12942 - lowr:fix/concat-with-char, r=Veykril
bors [Mon, 8 Aug 2022 11:28:42 +0000 (11:28 +0000)]
Auto merge of #12942 - lowr:fix/concat-with-char, r=Veykril

fix: make `concat!` work with char

Fixes #12921

- I avoided making `unquote_str()` take char literals as well because it's depended on by another function `parse_string()` that's only supposed to take strings.
- Even with this patch, we don't output `\0` as `\u{0}` which #12921 pointed out ~~, but we're not actually responsible for serializing it but rowan is~~. They are functionally equivalent and I don't think it'd cause any confusion, but we *could* try escaping them before serialization (for reference, `rustc -Zunpretty=expanded`, which `cargo expand` uses under the hood, [makes use of `str::escape_default()`](https://github.com/rust-lang/rust/blob/3830ecaa8db798d2727cbdfa4ddf314ff938f268/compiler/rustc_ast/src/util/literal.rs#L161).

22 months ago[code] make toggleInlayHints understand {off,on}UntilPressed
Jake Heinz [Mon, 8 Aug 2022 00:20:17 +0000 (00:20 +0000)]
[code] make toggleInlayHints understand {off,on}UntilPressed

22 months agoAuto merge of #12956 - oxalica:feat/la-arena-apis, r=lnicola
bors [Sun, 7 Aug 2022 08:50:23 +0000 (08:50 +0000)]
Auto merge of #12956 - oxalica:feat/la-arena-apis, r=lnicola

More methods and traits for `la_arena::ArenaMap`

Continue of #12931. Seems that I forgot some methods in the previous PR :(

I also changed `ArenaMap::insert` to return the old value, to match the map-like collection API of std. **So this is a breaking change.**

r? `@lnicola`

22 months agoParse range patterns in struct and slice without trailing comma
Ryo Yoshida [Fri, 5 Aug 2022 11:01:50 +0000 (20:01 +0900)]
Parse range patterns in struct and slice without trailing comma

22 months agoAuto merge of #12959 - lnicola:rainbows-again, r=lnicola
bors [Sun, 7 Aug 2022 06:30:11 +0000 (06:30 +0000)]
Auto merge of #12959 - lnicola:rainbows-again, r=lnicola

Fix `test_rainbow_highlighting` gate

CC https://github.com/rust-lang/rust-analyzer/pull/12903#pullrequestreview-1058906953

22 months agoFix test_rainbow_highlighting gate
Laurențiu Nicola [Sun, 7 Aug 2022 06:29:26 +0000 (09:29 +0300)]
Fix test_rainbow_highlighting gate

22 months agoReturns the old value for la_arena::ArenaMap::insert
oxalica [Sat, 6 Aug 2022 20:48:52 +0000 (04:48 +0800)]
Returns the old value for la_arena::ArenaMap::insert

22 months agoImpl more methods and traits for la_arena::ArenaMap
oxalica [Sat, 6 Aug 2022 20:17:04 +0000 (04:17 +0800)]
Impl more methods and traits for la_arena::ArenaMap

22 months agoImport serde derives on converting json to struct
hkalbasi [Sat, 6 Aug 2022 14:51:51 +0000 (19:21 +0430)]
Import serde derives on converting json to struct

22 months agoAuto merge of #12953 - stanciuadrian:fmt, r=lnicola
bors [Sat, 6 Aug 2022 15:02:30 +0000 (15:02 +0000)]
Auto merge of #12953 - stanciuadrian:fmt, r=lnicola

Run stable `fmt` & `cargo` through `rustup`

`cargo test -p ide-assists` fails on Windows/x64/nightly:

```shell
> rustup self update
info: checking for self-updates
  rustup unchanged - 1.25.1

> rustup update
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: syncing channel updates for 'nightly-x86_64-pc-windows-msvc'
info: checking for self-updates

   stable-x86_64-pc-windows-msvc unchanged - rustc 1.62.1 (e092d0b6b 2022-07-16)
  nightly-x86_64-pc-windows-msvc unchanged - rustc 1.64.0-nightly (affe0d3a0 2022-08-05)

info: cleaning up downloads & tmp directories

> rustup show
Default host: x86_64-pc-windows-msvc
rustup home:  C:\Users\stanc\.rustup

installed toolchains
--------------------

stable-x86_64-pc-windows-msvc
nightly-x86_64-pc-windows-msvc (default)

active toolchain
----------------

nightly-x86_64-pc-windows-msvc (default)
rustc 1.64.0-nightly (affe0d3a0 2022-08-05)

> cargo test -p ide-assists

test tests::sourcegen::sourcegen_assists_docs ... FAILED

failures:

---- tests::sourcegen::sourcegen_assists_docs stdout ----
thread 'tests::sourcegen::sourcegen_assists_docs' panicked at 'Failed to run rustfmt from toolchain 'stable'. Please run `rustup component add rustfmt --toolchain stable` to install it.', crates\sourcegen\src\lib.rs:141:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

failures:
    tests::sourcegen::sourcegen_assists_docs

test result: FAILED. 1576 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.82s

error: test failed, to rerun pass '-p ide-assists --lib'
```

After some investigation it seemed that [`cmd!`](https://github.com/rust-lang/rust-analyzer/blob/51705698bd66919435e4fcbc25d96bd7fc5583f4/crates/sourcegen/src/lib.rs#L139) didn't execute the expected (stable) rustfmt.

A simple `xshell` test failed too:

```rust
use xshell::{cmd, Shell};

fn main() {
    let sh = &Shell::new().unwrap();
    sh.set_var("RUSTUP_TOOLCHAIN", "stable");
    let version = cmd!(sh, "rustfmt --version").read().unwrap_or_default();
    println!("{version}");
}
```

Bypassing `xshell` and using `Command` directly failed too:

```rust
use std::process::{Command, Stdio};

fn main() {
    let child = Command::new("rustfmt")
        .arg("--version")
        .stdin(Stdio::null())
        .stdout(Stdio::piped())
        .env("RUSTUP_TOOLCHAIN", "stable")
        .spawn()
        .expect("failed to start");
    let output = child.wait_with_output().unwrap();
    let version = String::from_utf8_lossy(&output.stdout);
    println!("{version}");
}
```

Spawning `cargo +stable fmt version` [failed too](https://github.com/rust-lang/rustup/issues/3036) with `error: no such subcommand: +stable`.

Only `rustup run stable` worked fine for both `cargo` and `fmt`.

Thanks to `@lnicola` for a live investigation session, hints and tips.

22 months agorun stable fmt through rustup
Adrian Stanciu [Sat, 6 Aug 2022 14:12:13 +0000 (17:12 +0300)]
run stable fmt through rustup

22 months agoAuto merge of #12931 - oxalica:feat/la-arena-apis, r=lnicola
bors [Sat, 6 Aug 2022 13:39:31 +0000 (13:39 +0000)]
Auto merge of #12931 - oxalica:feat/la-arena-apis, r=lnicola

Add more constructors and entry-APIs for la-arena

`la-arena` on crates.io is quite helpful when just a thin wrapper for Vec with u32 indices is needed.
But the current API is not ergonomic enough.

This PR
- Adds `ArenaMap::new`. Not sure why only `Arena` has it now.
- Adds `Arena{,Map}::with_capacity` for known-size storage.
- Adds entry-API for `ArenaMap` for easier `.entry(idx).or_default().push(value)` or `.entry(idx).or_insert(...)` operations.

22 months agoDocument CLI flag stability
Jonas Schievink [Fri, 5 Aug 2022 13:28:53 +0000 (15:28 +0200)]
Document CLI flag stability

22 months agoAuto merge of #12947 - Veykril:switch-workspace, r=Veykril
bors [Fri, 5 Aug 2022 13:13:44 +0000 (13:13 +0000)]
Auto merge of #12947 - Veykril:switch-workspace, r=Veykril

Don't switch workspace on vfs file changes from libraries

When r-a starts up, it starts switching the workspace before all vfs
events have been processed which causes us to switch workspace multiple
times until all vfs changes have been processed. This scales with the
size of the project and its dependencies. If workspace files from
dependencies as well as the sysroot get loaded, we shouldn't switch
the workspace as those have no impact on the project workspace.

22 months agoAuto merge of #12949 - Veykril:token-pick, r=Veykril
bors [Fri, 5 Aug 2022 13:06:10 +0000 (13:06 +0000)]
Auto merge of #12949 - Veykril:token-pick, r=Veykril

fix: Fix incorrect token pick rankings

22 months agominor: align with rustc on escaping characters in macro expansion
Ryo Yoshida [Fri, 5 Aug 2022 13:01:09 +0000 (22:01 +0900)]
minor: align with rustc on escaping characters in macro expansion

22 months agofix: Fix incorrect token pick rankings
Lukas Wirth [Fri, 5 Aug 2022 12:59:26 +0000 (14:59 +0200)]
fix: Fix incorrect token pick rankings

22 months agoAuto merge of #12948 - Veykril:classify-ops, r=Veykril
bors [Fri, 5 Aug 2022 12:55:36 +0000 (12:55 +0000)]
Auto merge of #12948 - Veykril:classify-ops, r=Veykril

feat: Handle operators like their trait functions in the IDE

Allows hover and goto implementation to work on `?`, indexing brackets, binary operators, prefix operators and `await`. Regarding `await`, hover will continue to show the keyword docs while goto implementation will bring the user to the `poll` function of the `Future` implementation.
![Code_CJmZ3FGFVn](https://user-images.githubusercontent.com/3757771/183076683-c9899bd6-60d3-461b-965f-0c0f9745e2e8.gif)

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

22 months agoSimplify
Lukas Wirth [Fri, 5 Aug 2022 12:54:14 +0000 (14:54 +0200)]
Simplify

22 months agoFix visibilities
Lukas Wirth [Fri, 5 Aug 2022 12:28:36 +0000 (14:28 +0200)]
Fix visibilities

22 months agofeat: Handle operators like their trait functions in the IDE
Lukas Wirth [Fri, 5 Aug 2022 12:16:36 +0000 (14:16 +0200)]
feat: Handle operators like their trait functions in the IDE

22 months agoDon't switch workspace on vfs file changes from libraries
Lukas Wirth [Fri, 5 Aug 2022 10:06:31 +0000 (12:06 +0200)]
Don't switch workspace on vfs file changes from libraries

When r-a starts up, it starts switching the workspace before all vfs
events have been processed which causes us to switch workspace multiple
times until all vfs changes have been processed. This scales with the
size of the project and its dependencies. If workspace files from
dependencies as well as the sysroot get loaded, we shouldn't switch
the workspace as those have no impact on the project workspace.

22 months agoAuto merge of #12946 - rust-lang:issue-template, r=lnicola
bors [Fri, 5 Aug 2022 07:09:34 +0000 (07:09 +0000)]
Auto merge of #12946 - rust-lang:issue-template, r=lnicola

Update bug_report.md

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

22 months agoUpdate bug_report.md
Lukas Wirth [Fri, 5 Aug 2022 07:04:27 +0000 (09:04 +0200)]
Update bug_report.md

22 months agoUpdate bug_report.md
Lukas Wirth [Fri, 5 Aug 2022 06:42:13 +0000 (08:42 +0200)]
Update bug_report.md

22 months agofix: make `concat!` work with char
Ryo Yoshida [Thu, 4 Aug 2022 17:51:38 +0000 (02:51 +0900)]
fix: make `concat!` work with char

22 months agoFixed up for loops, added fixme with problem
fprasx [Thu, 4 Aug 2022 14:43:09 +0000 (10:43 -0400)]
Fixed up for loops, added fixme with problem

https://github.com/rust-lang/rust-analyzer/pull/12937#discussion_r937633695

22 months agoShortened fixup for match, added cases for for
fprasx [Thu, 4 Aug 2022 13:28:25 +0000 (09:28 -0400)]
Shortened fixup for match, added cases for for

Previously added a blank _ => {} for match statements

22 months agoAuto merge of #12808 - Veykril:check-workspace, r=Veykril
bors [Thu, 4 Aug 2022 12:57:04 +0000 (12:57 +0000)]
Auto merge of #12808 - Veykril:check-workspace, r=Veykril

feat: Only flycheck workspace that belongs to saved file

Supercedes https://github.com/rust-lang/rust-analyzer/pull/11038

There is still the problem that all the diagnostics are cleared, only clearing diagnostics of the relevant workspace isn't easily doable though I think, will have to dig into that

22 months agoDon't flycheck while the workspace is being loaded
Lukas Wirth [Thu, 4 Aug 2022 12:01:33 +0000 (14:01 +0200)]
Don't flycheck while the workspace is being loaded

22 months agoAuto merge of #12939 - jean-santos:errors-ide-hover-wrong-place, r=Veykril
bors [Thu, 4 Aug 2022 12:42:51 +0000 (12:42 +0000)]
Auto merge of #12939 - jean-santos:errors-ide-hover-wrong-place, r=Veykril

Error Diagnostics appear in the wrong place

Fix #12436

22 months agotidy formatting
Jean santos [Thu, 4 Aug 2022 12:28:34 +0000 (09:28 -0300)]
tidy formatting

22 months agoTrigger flycheck on all transitive dependencies as well
Lukas Wirth [Thu, 4 Aug 2022 11:22:15 +0000 (13:22 +0200)]
Trigger flycheck on all transitive dependencies as well

22 months agoon hover fallback error, adds ast::type as possible node
Jean santos [Wed, 3 Aug 2022 20:37:11 +0000 (17:37 -0300)]
on hover fallback error, adds ast::type as possible node

22 months agoTidy formatted
fprasx [Wed, 3 Aug 2022 20:27:43 +0000 (16:27 -0400)]
Tidy formatted

22 months agoAdded fixup for for loops w/ missing parts
fprasx [Wed, 3 Aug 2022 19:51:30 +0000 (15:51 -0400)]
Added fixup for for loops w/ missing parts

22 months agoAdded fixup for match statements w/ missing parts
fprasx [Wed, 3 Aug 2022 18:44:21 +0000 (14:44 -0400)]
Added fixup for match statements w/ missing parts

Passes tests

22 months agoAuto merge of #12934 - Veykril:typing, r=Veykril
bors [Wed, 3 Aug 2022 16:23:49 +0000 (16:23 +0000)]
Auto merge of #12934 - Veykril:typing, r=Veykril

Add a setting to disable comment continuation in VSCode

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

22 months agoAdd a setting to disable comment continuation in VSCode
Lukas Wirth [Wed, 3 Aug 2022 16:22:45 +0000 (18:22 +0200)]
Add a setting to disable comment continuation in VSCode

22 months agoAuto merge of #12933 - Veykril:proc-ignored, r=Veykril
bors [Wed, 3 Aug 2022 16:11:08 +0000 (16:11 +0000)]
Auto merge of #12933 - Veykril:proc-ignored, r=Veykril

Use an empty expander for ignored non-attribute proc-macros

Identity is the wrong behaviour for anything that's not an attribute here

22 months agoUse an empty expander for ignored non-attribute proc-macros
Lukas Wirth [Wed, 3 Aug 2022 16:10:15 +0000 (18:10 +0200)]
Use an empty expander for ignored non-attribute proc-macros

22 months agoImpl entry-API for la_arena::ArenaMap
oxalica [Wed, 3 Aug 2022 10:16:05 +0000 (18:16 +0800)]
Impl entry-API for la_arena::ArenaMap

We enforce integral and `Copy` key, so some key-related functions are
not necessary since user can just reuse the index for the `entry` call.

22 months agoAdd more constructors for la-arena
oxalica [Wed, 3 Aug 2022 09:35:31 +0000 (17:35 +0800)]
Add more constructors for la-arena

22 months agoAuto merge of #12930 - lnicola:subtree-branch, r=lnicola
bors [Wed, 3 Aug 2022 06:49:13 +0000 (06:49 +0000)]
Auto merge of #12930 - lnicola:subtree-branch, r=lnicola

minor: Use the release branch in xtask promote

22 months agoUse the release branch in xtask promote
Laurențiu Nicola [Wed, 3 Aug 2022 06:48:44 +0000 (09:48 +0300)]
Use the release branch in xtask promote

22 months agoAuto merge of #12837 - DorianListens:dscheidt/generate-enum-data, r=Veykril
bors [Tue, 2 Aug 2022 19:50:01 +0000 (19:50 +0000)]
Auto merge of #12837 - DorianListens:dscheidt/generate-enum-data, r=Veykril

feat: support associated values in "Generate Enum Variant" assist

This change adds support for associated values to the "Generate Enum Variant" assist.

I've split the implementation out into 4 steps to make code review easier:
- Add "add_variant" support to the structural ast editing system in `edit_in_place`
- Migrate `generate_enum_variant` to use structural ast editing instead of string manipulation
- Support tuple fields
- Support record fields

Please let me know if I should leave the commits as-is, or squash before merging.

Fixes #12797

22 months agoSupport PathPat paths in generate_enum_variant
Dorian Scheidt [Tue, 2 Aug 2022 16:11:32 +0000 (12:11 -0400)]
Support PathPat paths in generate_enum_variant

22 months agoBe more strict about supported Paths in generate_enum_variant
Dorian Scheidt [Tue, 2 Aug 2022 15:54:00 +0000 (11:54 -0400)]
Be more strict about supported Paths in generate_enum_variant

PathType path parents don't support this assist

22 months agoSupport record fields in generate_enum_variant
Dorian Scheidt [Wed, 20 Jul 2022 18:02:21 +0000 (13:02 -0500)]
Support record fields in generate_enum_variant

22 months agoSupport tuple fields in generate_enum_variant
Dorian Scheidt [Wed, 20 Jul 2022 17:26:27 +0000 (12:26 -0500)]
Support tuple fields in generate_enum_variant

22 months agoconvert generate_enum_variant to use add_variant
Dorian Scheidt [Wed, 20 Jul 2022 17:11:00 +0000 (12:11 -0500)]
convert generate_enum_variant to use add_variant

22 months agoSupport adding variants via structural editing
Dorian Scheidt [Wed, 20 Jul 2022 17:03:18 +0000 (12:03 -0500)]
Support adding variants via structural editing

22 months agoAuto merge of #12880 - palango:while-fixup, r=Veykril
bors [Tue, 2 Aug 2022 14:08:56 +0000 (14:08 +0000)]
Auto merge of #12880 - palango:while-fixup, r=Veykril

Add syntax fixup for while loops

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

This is a first iteration to gather some feedback. In particular I'm not sure if the curly braces should be added here, but I couldn't get the test to work without them. Any hints welcome!

22 months agoAuto merge of #12919 - jonas-schievink:speling, r=jonas-schievink
bors [Tue, 2 Aug 2022 13:10:12 +0000 (13:10 +0000)]
Auto merge of #12919 - jonas-schievink:speling, r=jonas-schievink

fix: Fix r-a spelling in some places

User-facing change: All commands are now rendered as "rust-analyzer: Command" rather than "Rust Analyzer: Command".

Alternative to https://github.com/rust-lang/rust-analyzer/pull/12910

Potentially controversial, since other extensions don't do this, so I won't self-approve.

22 months agoAuto merge of #12920 - jonas-schievink:arm-release, r=jonas-schievink
bors [Mon, 1 Aug 2022 14:17:53 +0000 (14:17 +0000)]
Auto merge of #12920 - jonas-schievink:arm-release, r=jonas-schievink

feat: Publish extension for 32-bit ARM systems