]> git.lizzy.rs Git - rust.git/log
rust.git
19 months agoUpdate crates/ide-completion/src/context.rs
yue [Sat, 19 Nov 2022 15:58:59 +0000 (00:58 +0900)]
Update crates/ide-completion/src/context.rs

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
19 months agofix formatting
Kartavya Vashishtha [Sat, 19 Nov 2022 15:53:33 +0000 (21:23 +0530)]
fix formatting

19 months agorefactor hover
Kartavya Vashishtha [Sat, 19 Nov 2022 15:52:10 +0000 (21:22 +0530)]
refactor hover

change struct_rest_pat to guarentee a HoverResult

Move token and node matching out of struct_rest_pat into hover

19 months agoAuto merge of #13290 - poliorcetics:multiple-targets, r=Veykril
bors [Sat, 19 Nov 2022 13:09:37 +0000 (13:09 +0000)]
Auto merge of #13290 - poliorcetics:multiple-targets, r=Veykril

Support multiple targets for checkOnSave (in conjunction with cargo 1.64.0+)

This PR adds support for the ability to pass multiple `--target` flags when using
`cargo` 1.64.0+.

## Questions

I needed to change the type of two configurations options, but I did not plurialize the names to
avoid too much churn, should I ?

## Zulip thread

https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/Issue.2013282.20.28supporting.20multiple.20targets.20with.201.2E64.2B.29

## Example

To see it working, on a macOS machine:

```sh
$ cd /tmp
$ cargo new cargo-multiple-targets-support-ra-test
$ cd !$
$ mkdir .cargo
$ echo '
[build]
target = [
    "aarch64-apple-darwin",
    "x86_64-apple-darwin",
]
' > .cargo/config.toml
$ echo '
fn main() {
    #[cfg(all(target_arch = "aarch64", target_os = "macos"))]
    {
        let a = std::fs::read_to_string("/tmp/test-read");
    }

    #[cfg(all(target_arch = "x86_64", target_os = "macos"))]
    {
        let a = std::fs::read_to_string("/tmp/test-read");
    }

    #[cfg(all(target_arch = "x86_64", target_os = "windows"))]
    {
        let a = std::fs::read_to_string("/tmp/test-read");
    }
}
' > src/main.rs
# launch your favorite editor with the version of RA from this PR
#
# You should see warnings under the first two `let a = ...` but not the third
```

## Screen

![Two panes of a terminal emulator, on the left pane is the main.rs file described above, with warnings for the first two let a = declaration, on the right pane is a display of the .cargo/config.toml, an ls of the current files in the directory and a call to cargo build to show the same warnings as in the editor on the left pane](https://user-images.githubusercontent.com/7951708/192122707-7a00606a-e581-4534-b9d5-b81c92694e8e.png)

Helps with #13282

19 months agoAuto merge of #13641 - DesmondWillowbrook:fix-move-format-string, r=Veykril
bors [Sat, 19 Nov 2022 12:46:29 +0000 (12:46 +0000)]
Auto merge of #13641 - DesmondWillowbrook:fix-move-format-string, r=Veykril

fix: format expression parsing edge-cases

- Handle positional arguments with formatting options (i.e. `{:b}`). Previously copied `:b` as an argument, producing broken code.

- Handle indexed positional arguments (`{0}`) ([reference](https://doc.rust-lang.org/std/fmt/#positional-parameters)). Previously copied over `0` as an argument.

Note: the assist also breaks when named arguments are used (`"{name}$0", name = 2 + 2` is converted to `"{}"$0, name`. I'm working on fix for that as well.

19 months agoAuto merge of #13642 - bvanjoi:fix-13292, r=Veykril
bors [Sat, 19 Nov 2022 12:33:40 +0000 (12:33 +0000)]
Auto merge of #13642 - bvanjoi:fix-13292, r=Veykril

fix(assists): remove `item_const` which had default value when implement missing members

Fixed https://github.com/rust-lang/rust-analyzer/issues/13292

19 months agofix(assists): remove `item_const` which had default value when implement missing...
bvanjoi [Sat, 19 Nov 2022 11:38:53 +0000 (19:38 +0800)]
fix(assists): remove `item_const` which had default value when implement missing members`

19 months agorun cargo fmt
Kartavya Vashishtha [Sat, 19 Nov 2022 09:38:32 +0000 (15:08 +0530)]
run cargo fmt

19 months agoAuto merge of #13639 - Veykril:macro-diags, r=Veykril
bors [Sat, 19 Nov 2022 09:33:10 +0000 (09:33 +0000)]
Auto merge of #13639 - Veykril:macro-diags, r=Veykril

fix: Fix proc-macro-srv search paths for Arch Linux

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

19 months agofix: Fix nested macro diagnostics pointing at macro expansion files
Lukas Wirth [Sat, 19 Nov 2022 09:32:32 +0000 (10:32 +0100)]
fix: Fix nested macro diagnostics pointing at macro expansion files

19 months agofix: format expression parsing edge-cases
Kartavya Vashishtha [Sat, 19 Nov 2022 09:30:25 +0000 (15:00 +0530)]
fix: format expression parsing edge-cases

handle positional arg with formatting

handle indexed positional args

19 months agofix formatting
Kartavya Vashishtha [Sat, 19 Nov 2022 06:04:49 +0000 (11:34 +0530)]
fix formatting
and remove unnecessary check

19 months agosimplify ancestor climbing to not consider macros
Kartavya Vashishtha [Sat, 19 Nov 2022 05:47:43 +0000 (11:17 +0530)]
simplify ancestor climbing to not consider macros

19 months agofeat: adds hover hint to ".." in record pattern
Kartavya Vashishtha [Sat, 19 Nov 2022 05:40:47 +0000 (11:10 +0530)]
feat: adds hover hint to ".." in record pattern

currently only works with struct pattern

19 months agofix: Fix proc-macro-srv search paths for Arch Linux
Lukas Wirth [Fri, 18 Nov 2022 22:32:26 +0000 (23:32 +0100)]
fix: Fix proc-macro-srv search paths for Arch Linux

19 months agoAuto merge of #13633 - Veykril:vscode-full-diagnostics, r=Veykril
bors [Fri, 18 Nov 2022 19:33:38 +0000 (19:33 +0000)]
Auto merge of #13633 - Veykril:vscode-full-diagnostics, r=Veykril

feat: Allow viewing the full compiler diagnostic in a readonly textview

![Code_y1qrash9gg](https://user-images.githubusercontent.com/3757771/202780459-f751f65d-2b1b-4dc3-9685-100d65ebf6a0.gif)

Also adds a VSCode only config that replaces the split diagnostic message with the first relevant part of the diagnostic output

![Code_7k4qsMkx5e](https://user-images.githubusercontent.com/3757771/202780346-cf9137d9-eb77-46b7-aed6-c73a2e41e1c7.png)

This only affects diagnostics generated by primary spans and has no effect on other clients than VSCode.

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

19 months agoFix tests checking the data value
Lukas Wirth [Fri, 18 Nov 2022 19:11:48 +0000 (20:11 +0100)]
Fix tests checking the data value

19 months agofeat: Allow viewing the full compiler diagnostic in a readonly textview
Lukas Wirth [Fri, 18 Nov 2022 18:47:45 +0000 (19:47 +0100)]
feat: Allow viewing the full compiler diagnostic in a readonly textview

19 months agoAuto merge of #13632 - Veykril:scip, r=Veykril
bors [Fri, 18 Nov 2022 10:31:41 +0000 (10:31 +0000)]
Auto merge of #13632 - Veykril:scip, r=Veykril

Make it more obvious which SCIP features we do not yet emit in code

19 months agoMake it more obvious which SCIP features we do not yet emit in code
Lukas Wirth [Fri, 18 Nov 2022 10:31:12 +0000 (11:31 +0100)]
Make it more obvious which SCIP features we do not yet emit in code

19 months agoAuto merge of #13629 - jonas-schievink:remove-dbg-selection, r=jonas-schievink
bors [Thu, 17 Nov 2022 16:41:51 +0000 (16:41 +0000)]
Auto merge of #13629 - jonas-schievink:remove-dbg-selection, r=jonas-schievink

feat: Make "Remove dbg!()" assist work on selections

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

19 months agoMake "Remove dbg!()" assist work on selections
Jonas Schievink [Thu, 17 Nov 2022 16:39:31 +0000 (17:39 +0100)]
Make "Remove dbg!()" assist work on selections

19 months agoAuto merge of #13625 - lowr:fix/proc-macro-src-test, r=lnicola
bors [Wed, 16 Nov 2022 17:10:59 +0000 (17:10 +0000)]
Auto merge of #13625 - lowr:fix/proc-macro-src-test, r=lnicola

internal: Update proc-macro-srv tests

Should have been included in #13548, but I didn't notice as those tests aren't run in our CI.

cc rust-lang/rust#104454

19 months agoUpdate proc-macro-srv tests
Ryo Yoshida [Wed, 16 Nov 2022 16:42:56 +0000 (01:42 +0900)]
Update proc-macro-srv tests

19 months agoAuto merge of #13624 - lowr:fix/unsize-array-inference-variable, r=lnicola
bors [Wed, 16 Nov 2022 11:07:18 +0000 (11:07 +0000)]
Auto merge of #13624 - lowr:fix/unsize-array-inference-variable, r=lnicola

fix: resolve inference variable before applying adjustments

Fixes #13619

19 months agofix: resolve inference variable before applying adjustments
Ryo Yoshida [Wed, 16 Nov 2022 10:54:07 +0000 (19:54 +0900)]
fix: resolve inference variable before applying adjustments

19 months agoAuto merge of #13615 - mati865:miow-update, r=jonas-schievink
bors [Tue, 15 Nov 2022 11:59:27 +0000 (11:59 +0000)]
Auto merge of #13615 - mati865:miow-update, r=jonas-schievink

Update several crates to bring support for the new Tier 3 Windows tar…

`cargo t` has passed on Windows 11 with both `x86_64-pc-windows-gnu` and `x86_64-pc-windows-gnullvm` targets.

19 months agoAuto merge of #13623 - jonas-schievink:strip-trait-item-completions, r=jonas-schievink
bors [Tue, 15 Nov 2022 11:45:02 +0000 (11:45 +0000)]
Auto merge of #13623 - jonas-schievink:strip-trait-item-completions, r=jonas-schievink

fix: Strip comments and attributes off of all trait item completions

Previously, this was done in several places redundantly, but not for all items. It was also untested. This PR fixes that.

19 months agoStrip comments and attributes off of all trait item completions
Jonas Schievink [Tue, 15 Nov 2022 11:41:39 +0000 (12:41 +0100)]
Strip comments and attributes off of all trait item completions

19 months agoAuto merge of #13622 - jonas-schievink:fix-gat-completions, r=jonas-schievink
bors [Tue, 15 Nov 2022 11:10:34 +0000 (11:10 +0000)]
Auto merge of #13622 - jonas-schievink:fix-gat-completions, r=jonas-schievink

fix: include generic parameter in GAT completions

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

19 months agoFix GAT completion not including generic parameters
Jonas Schievink [Tue, 15 Nov 2022 11:05:11 +0000 (12:05 +0100)]
Fix GAT completion not including generic parameters

19 months agoUpdate several crates to bring support for the new Tier 3 Windows targets
Mateusz Mikuła [Sun, 13 Nov 2022 21:23:56 +0000 (22:23 +0100)]
Update several crates to bring support for the new Tier 3 Windows targets

19 months agofix: filter unnecessary completions after colon
yue4u [Sat, 12 Nov 2022 13:33:40 +0000 (22:33 +0900)]
fix: filter unnecessary completions after colon

19 months agoAuto merge of #13607 - Veykril:proc-macro-error, r=Veykril
bors [Fri, 11 Nov 2022 15:57:30 +0000 (15:57 +0000)]
Auto merge of #13607 - Veykril:proc-macro-error, r=Veykril

internal: Add version info to unsupported proc macro abi error

cc https://github.com/rust-lang/rust-analyzer/issues/13589#issuecomment-1311824473

19 months agointernal: Add version info to unsupported proc macro abi error
Lukas Wirth [Fri, 11 Nov 2022 15:57:05 +0000 (16:57 +0100)]
internal: Add version info to unsupported proc macro abi error

20 months agoAuto merge of #13606 - Veykril:trait-alias, r=Veykril
bors [Fri, 11 Nov 2022 14:26:15 +0000 (14:26 +0000)]
Auto merge of #13606 - Veykril:trait-alias, r=Veykril

fix: Add trait alias grammar to rust.ungram

We already parse them, but the grammar was never updated to reflect that

20 months agofix: Add trait alias grammar to rust.ungram
Lukas Wirth [Fri, 11 Nov 2022 14:25:15 +0000 (15:25 +0100)]
fix: Add trait alias grammar to rust.ungram

20 months agoAuto merge of #13605 - Veykril:empty-ws-error, r=Veykril
bors [Fri, 11 Nov 2022 13:37:27 +0000 (13:37 +0000)]
Auto merge of #13605 - Veykril:empty-ws-error, r=Veykril

fix: Fix r-a eagerly showing no discovered workspace errors

20 months agofix: Fix r-a eagerly showing no discovered workspace errors
Lukas Wirth [Fri, 11 Nov 2022 13:36:27 +0000 (14:36 +0100)]
fix: Fix r-a eagerly showing no discovered workspace errors

20 months agofeat: Support passing multiple targets to cargo (for Rust 1.64.0+)
Alexis (Poliorcetics) Bourget [Sat, 24 Sep 2022 23:22:27 +0000 (01:22 +0200)]
feat: Support passing multiple targets to cargo (for Rust 1.64.0+)

20 months agochore: Align config property
Alexis (Poliorcetics) Bourget [Sat, 24 Sep 2022 23:23:20 +0000 (01:23 +0200)]
chore: Align config property

20 months agoAuto merge of #13604 - Veykril:hover-attr, r=Veykril
bors [Fri, 11 Nov 2022 12:48:48 +0000 (12:48 +0000)]
Auto merge of #13604 - Veykril:hover-attr, r=Veykril

fix: Fix hover in attributed items not preferring similar kinded tokens

20 months agofix: Fix hover in attributed items not preferring similar kinded tokens
Lukas Wirth [Fri, 11 Nov 2022 12:38:07 +0000 (13:38 +0100)]
fix: Fix hover in attributed items not preferring similar kinded tokens

20 months agoAuto merge of #13602 - lowr:fix/nameres-transitive-visibility, r=Veykril
bors [Fri, 11 Nov 2022 12:32:21 +0000 (12:32 +0000)]
Auto merge of #13602 - lowr:fix/nameres-transitive-visibility, r=Veykril

fix: check visibility of each path segment

Upon path resolution, we have not been checking if every def pointed to by each segment of the path is visible from the original module. This leads to incorrect import resolutions, in particular when one uses glob imports and names collide.

There is decent amount of changes in this PR because:
- some of our tests were not correct in terms of visibility
  - I left several basic nameres tests as-is (with expect test updated) since I thought it would be nice to ensure we don't resolve defs that are not visible.
- `fix_visibility` assist relied on `Semantics::resolve_path()`, which uses the name resolution procedure I'm fixing and wouldn't be able to "see through" the items with strict visibility with this patch

The first commit is the gist of the fix itself.

Fixes #10991
Fixes #11473
Fixes #13252

20 months agoAuto merge of #13548 - lowr:fix/tt-punct-spacing, r=Veykril
bors [Fri, 11 Nov 2022 12:19:30 +0000 (12:19 +0000)]
Auto merge of #13548 - lowr:fix/tt-punct-spacing, r=Veykril

Fix `tt::Punct`'s spacing calculation

Fixes #13499

We currently set a `tt::Punct`'s spacing to `Spacing::Joint` unless its next token is a trivia (i.e. whitespaces or comment). As I understand it, rustc only [sets `Spacing::Joint` if the next token is an operator](https://github.com/rust-lang/rust/blob/5b3e9090757da9a95b22f589fe39b6a4b5455b96/compiler/rustc_parse/src/lexer/tokentrees.rs#L77-L78) and we should follow it to guarantee the consistent behavior of proc macros.

20 months agoAuto merge of #13603 - Veykril:no-workspaces, r=Veykril
bors [Fri, 11 Nov 2022 12:01:52 +0000 (12:01 +0000)]
Auto merge of #13603 - Veykril:no-workspaces, r=Veykril

fix: Send status notification if there are no found workspaces

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

20 months agoSend status notification if there are no found workspaces
Lukas Wirth [Fri, 11 Nov 2022 12:00:22 +0000 (13:00 +0100)]
Send status notification if there are no found workspaces

20 months agoFix tests that depended on loose visibility restriction
Ryo Yoshida [Fri, 11 Nov 2022 10:59:52 +0000 (19:59 +0900)]
Fix tests that depended on loose visibility restriction

20 months agoResolve invisible defs in `fix_visibility` assist
Ryo Yoshida [Fri, 11 Nov 2022 10:56:47 +0000 (19:56 +0900)]
Resolve invisible defs in `fix_visibility` assist

20 months agofix: check visibility of each segment in path resolution
Ryo Yoshida [Fri, 11 Nov 2022 10:50:26 +0000 (19:50 +0900)]
fix: check visibility of each segment in path resolution

20 months agoTest `TokenTree`s' equality modulo `Punct`s' spacing
Ryo Yoshida [Thu, 10 Nov 2022 10:24:01 +0000 (19:24 +0900)]
Test `TokenTree`s' equality modulo `Punct`s' spacing

20 months agoIgnore outermost non-delimited `Subtree` when reversing fixups
Ryo Yoshida [Thu, 10 Nov 2022 10:22:20 +0000 (19:22 +0900)]
Ignore outermost non-delimited `Subtree` when reversing fixups

20 months agoRollup merge of #104211 - lnicola:rust-analyzer-2022-11-09, r=lnicola
Michael Goulet [Thu, 10 Nov 2022 05:53:38 +0000 (21:53 -0800)]
Rollup merge of #104211 - lnicola:rust-analyzer-2022-11-09, r=lnicola

:arrow_up: rust-analyzer

r? ``@ghost``

20 months agoAuto merge of #13590 - Veykril:proc-macro-rustc-src, r=Veykril
bors [Wed, 9 Nov 2022 19:51:20 +0000 (19:51 +0000)]
Auto merge of #13590 - Veykril:proc-macro-rustc-src, r=Veykril

internal: Add proc-macro dependency to rustc_private crates

20 months agoAdd proc-macro dependency to rustc_private crates
Lukas Wirth [Wed, 9 Nov 2022 19:50:18 +0000 (20:50 +0100)]
Add proc-macro dependency to rustc_private crates

20 months ago:arrow_up: rust-analyzer
Laurențiu Nicola [Wed, 9 Nov 2022 19:49:10 +0000 (21:49 +0200)]
:arrow_up: rust-analyzer

20 months agoRollup merge of #103919 - nnethercote:unescaping-cleanups, r=matklad
Dylan DPC [Wed, 9 Nov 2022 13:51:22 +0000 (19:21 +0530)]
Rollup merge of #103919 - nnethercote:unescaping-cleanups, r=matklad

Unescaping cleanups

Some code improvements, and some error message improvements.

Best reviewed one commit at a time.

r? ````@matklad````

20 months agoAuto merge of #13584 - jonas-schievink:fix-signature-panic, r=jonas-schievink
bors [Tue, 8 Nov 2022 17:27:13 +0000 (17:27 +0000)]
Auto merge of #13584 - jonas-schievink:fix-signature-panic, r=jonas-schievink

fix: fix panic when computing signature of generic `FnOnce` callable

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

20 months agoDon't canonicalize self type when querying FnOnce signature
Jonas Schievink [Tue, 8 Nov 2022 17:05:07 +0000 (18:05 +0100)]
Don't canonicalize self type when querying FnOnce signature

20 months agoAuto merge of #13582 - lnicola:nest-cargo-toml, r=lnicola
bors [Tue, 8 Nov 2022 08:44:43 +0000 (08:44 +0000)]
Auto merge of #13582 - lnicola:nest-cargo-toml, r=lnicola

feat: Nest Cargo.lock under Cargo.toml in Code

Closes #13580

20 months agoNest Cargo.lock under Cargo.toml in Code
Laurențiu Nicola [Tue, 8 Nov 2022 07:57:05 +0000 (09:57 +0200)]
Nest Cargo.lock under Cargo.toml in Code

20 months agoAuto merge of #13581 - Veykril:unit-struct-compl, r=Veykril
bors [Tue, 8 Nov 2022 07:38:13 +0000 (07:38 +0000)]
Auto merge of #13581 - Veykril:unit-struct-compl, r=Veykril

fix: Fix item completions not working properly after unit structs and outline modules

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

20 months agofix: Fix item completions not working properly after unit structs and outline modules
Lukas Wirth [Tue, 8 Nov 2022 07:37:45 +0000 (08:37 +0100)]
fix: Fix item completions not working properly after unit structs and outline modules

20 months agoAuto merge of #13573 - Veykril:invalid-file-range, r=Veykril
bors [Mon, 7 Nov 2022 16:45:26 +0000 (16:45 +0000)]
Auto merge of #13573 - Veykril:invalid-file-range, r=Veykril

internal: error instead of panic on invalid file range

Fixes the panic in https://github.com/rust-lang/rust-analyzer/issues/13170

20 months agointernal: error instead of panic on invalid file range
Lukas Wirth [Mon, 7 Nov 2022 16:43:22 +0000 (17:43 +0100)]
internal: error instead of panic on invalid file range

20 months agoAuto merge of #13572 - Veykril:cancellable, r=Veykril
bors [Mon, 7 Nov 2022 16:22:33 +0000 (16:22 +0000)]
Auto merge of #13572 - Veykril:cancellable, r=Veykril

internal: Use Cancellable in favor of Result for clarity

20 months agointernal: Use Cancellable in favor of Result for clarity
Lukas Wirth [Mon, 7 Nov 2022 16:21:37 +0000 (17:21 +0100)]
internal: Use Cancellable in favor of Result for clarity

20 months agoAuto merge of #13571 - Veykril:unique-references, r=Veykril
bors [Mon, 7 Nov 2022 15:49:54 +0000 (15:49 +0000)]
Auto merge of #13571 - Veykril:unique-references, r=Veykril

minor: Deduplicate reference search results

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

20 months agoDeduplicate reference search results
Lukas Wirth [Mon, 7 Nov 2022 15:48:50 +0000 (16:48 +0100)]
Deduplicate reference search results

20 months agoAuto merge of #13568 - noritada:fix/len-of-byte-string-with-escaped-newlines, r=Veykril
bors [Mon, 7 Nov 2022 15:04:40 +0000 (15:04 +0000)]
Auto merge of #13568 - noritada:fix/len-of-byte-string-with-escaped-newlines, r=Veykril

Fix the length displayed for byte string literals with escaped newlines

This is a fix for the problem I reported earlier: "the length of byte strings containing escaped newlines is displayed two bytes longer when the first escaped character is a newline".

I would appreciate it if you could review the fix.
Many thanks.

Closes #13567

20 months agoAuto merge of #13570 - Veykril:dedup-crates-for, r=Veykril
bors [Mon, 7 Nov 2022 14:52:05 +0000 (14:52 +0000)]
Auto merge of #13570 - Veykril:dedup-crates-for, r=Veykril

minor: Remove code duplication

20 months agoRemove code duplication
Lukas Wirth [Mon, 7 Nov 2022 14:49:26 +0000 (15:49 +0100)]
Remove code duplication

20 months agoAdd test code for unescaping byte strings
Noritada Kobayashi [Mon, 7 Nov 2022 14:39:02 +0000 (23:39 +0900)]
Add test code for unescaping byte strings

20 months agoAuto merge of #13545 - Veykril:adjustment-hints, r=Veykril
bors [Mon, 7 Nov 2022 14:38:59 +0000 (14:38 +0000)]
Auto merge of #13545 - Veykril:adjustment-hints, r=Veykril

Generalize reborrow hints as adjustment hints

Like reborrow hints, these are still mainly useful for teaching/learning

![image](https://user-images.githubusercontent.com/3757771/200073606-b5cd3b95-a9ad-454d-a3c4-d4d89bf45928.png)

20 months agoAuto merge of #13569 - Veykril:rust-version, r=Veykril
bors [Mon, 7 Nov 2022 14:21:31 +0000 (14:21 +0000)]
Auto merge of #13569 - Veykril:rust-version, r=Veykril

Bump Cargo rust-version fields to latest stable

We already depend on `let ... else` now anyways

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

20 months agoClarify the intent
Noritada Kobayashi [Mon, 7 Nov 2022 13:51:29 +0000 (22:51 +0900)]
Clarify the intent

Thanks to Lukas Wirth for a suggestion.

20 months agoBump Cargo rust-version fields to latest stable
Lukas Wirth [Mon, 7 Nov 2022 11:59:51 +0000 (12:59 +0100)]
Bump Cargo rust-version fields to latest stable

20 months agoDon't trigger adjustment hints in all inlay hint tests
Lukas Wirth [Mon, 7 Nov 2022 11:49:52 +0000 (12:49 +0100)]
Don't trigger adjustment hints in all inlay hint tests

20 months agoAuto merge of #13565 - Veykril:sysroot, r=Veykril
bors [Mon, 7 Nov 2022 11:40:44 +0000 (11:40 +0000)]
Auto merge of #13565 - Veykril:sysroot, r=Veykril

Update sysroot crates

20 months agoFix the length displayed for byte string literals with escaped newlines
Noritada Kobayashi [Mon, 7 Nov 2022 10:25:07 +0000 (19:25 +0900)]
Fix the length displayed for byte string literals with escaped newlines

The length of byte strings containing escaped newlines is displayed two
bytes longer when the first escaped character is a newline.

This is due to a small bug in handling the first escaped newline in
string literals.

Closes #13567

20 months agoAuto merge of #12991 - TiddoLangerak:extract-method-from-trait-into-impl-root, r...
bors [Mon, 7 Nov 2022 11:07:12 +0000 (11:07 +0000)]
Auto merge of #12991 - TiddoLangerak:extract-method-from-trait-into-impl-root, r=Veykril

Feat: extracted method from trait impl is placed in existing impl

**Before**

https://user-images.githubusercontent.com/1759192/183872883-3b0eafd2-d1dc-440e-9e66-38e3372f8b64.mp4

**After**

https://user-images.githubusercontent.com/1759192/183875769-87f34c7d-52f0-4dfc-9766-f591ee738ebb.mp4

Previously, when triggering a method extraction from within an impl trait block, then this would always create a new impl block for
the struct, even if there already is one. Now, if there is already an existing trait-less impl block, then it'll put the extracted method in there.

**Caveats**:
- It currently requires the target impl block to be non-empty. This limitation is because the current architecture takes a `node_to_insert_after` as reference for where to insert the extracted function. An empty impl block doesn't have such a reference node, since it's empty. It seems that supporting this requires a much larger and more complex change.
- This is my first contribution in rust, so apologies for any beginner mistakes.

20 months agoUpdate sysroot crates
Lukas Wirth [Mon, 7 Nov 2022 10:45:52 +0000 (11:45 +0100)]
Update sysroot crates

20 months agorustfmt
Lukas Wirth [Mon, 7 Nov 2022 10:58:57 +0000 (11:58 +0100)]
rustfmt

20 months agoAuto merge of #13566 - lnicola:therefor, r=lnicola
bors [Mon, 7 Nov 2022 10:54:38 +0000 (10:54 +0000)]
Auto merge of #13566 - lnicola:therefor, r=lnicola

minor: Fix typos

20 months agoFix typos
Laurențiu Nicola [Mon, 7 Nov 2022 10:53:33 +0000 (12:53 +0200)]
Fix typos

20 months agoAuto merge of #13547 - Veykril:line-index, r=Veykril
bors [Mon, 7 Nov 2022 10:33:13 +0000 (10:33 +0000)]
Auto merge of #13547 - Veykril:line-index, r=Veykril

internal: Optimize `apply_document_changes` a bit

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

20 months agoAuto merge of #13552 - Veykril:flycheck-process-group, r=Veykril
bors [Mon, 7 Nov 2022 10:19:32 +0000 (10:19 +0000)]
Auto merge of #13552 - Veykril:flycheck-process-group, r=Veykril

internal: Use a process group for flycheck

Should fix https://github.com/rust-lang/rust-analyzer/issues/13348

20 months agoAuto merge of #13556 - pd4d10:patch-1, r=lnicola
bors [Sat, 5 Nov 2022 17:57:31 +0000 (17:57 +0000)]
Auto merge of #13556 - pd4d10:patch-1, r=lnicola

docs: fix adoc links

Correct #13536 with adoc link syntax

20 months agodocs: fix adoc links
Rongjian Zhang [Sat, 5 Nov 2022 17:33:57 +0000 (01:33 +0800)]
docs: fix adoc links

20 months agointernal: Use a process group for flycheck
Lukas Wirth [Sat, 5 Nov 2022 15:28:04 +0000 (16:28 +0100)]
internal: Use a process group for flycheck

20 months agoAuto merge of #13550 - Veykril:issue-template, r=lnicola
bors [Sat, 5 Nov 2022 13:20:26 +0000 (13:20 +0000)]
Auto merge of #13550 - Veykril:issue-template, r=lnicola

minor: Update github issue templates

20 months agoAuto merge of #13536 - pd4d10:patch-1, r=Veykril
bors [Sat, 5 Nov 2022 12:59:05 +0000 (12:59 +0000)]
Auto merge of #13536 - pd4d10:patch-1, r=Veykril

docs: add crates section to the manual

closes #13533

Added a section to the user manual, to make it easier for users to find the correct crate.

20 months agoAuto merge of #13435 - DropDemBits:assists-format-args-capture-pt3, r=Veykril
bors [Sat, 5 Nov 2022 12:41:23 +0000 (12:41 +0000)]
Auto merge of #13435 - DropDemBits:assists-format-args-capture-pt3, r=Veykril

Migrate assists to format args captures, part 3

Continuation of https://github.com/rust-lang/rust-analyzer/pull/13379

Migrates:

- `inline_call`
- `inline_local_variable`
- `introduce_named_lifetime`
- `merge_match_arms`
- `move_from_mod_rs`
- `move_guard`
- `move_module_to_file`
- `move_to_mod_rs`
- `number_representation`
- `qualify_method_call`
- `qualify_path`
- `raw_string`
- `remove_dbg`
- `replace_derive_with_manual_impl`
- `replace_or_with_or_else`
- `replace_turbofish_with_explicit_type`
- `unwrap_tuple`
- `wrap_return_type_in_result`

20 months agominor: Update github issue templates
Lukas Wirth [Sat, 5 Nov 2022 12:29:44 +0000 (13:29 +0100)]
minor: Update github issue templates

20 months agoAuto merge of #13379 - DropDemBits:ide-assists-format-args-capture, r=Veykril
bors [Sat, 5 Nov 2022 12:29:06 +0000 (12:29 +0000)]
Auto merge of #13379 - DropDemBits:ide-assists-format-args-capture, r=Veykril

internal: Migrate `ide_assists::utils` and `ide_assists::handlers` to use format arg captures (part 1)

This not only serves as making future migration to mutable syntax trees easier, it also finds out what needs to be migrated in the first place.

~~Aside from the first commit, subsequent commits are structured to only deal with one file/handler at a time.~~

This is the first of 3 PRs, migrating:

Utils:

- `gen_trait_fn_body`
- `render_snippet`
- `ReferenceConversion`
  - `convert_type`
  - `getter`

Handlers:

- `add_explicit_type`
- `add_return_type`
- `add_turbo_fish`
- `apply_demorgan`
- `auto_import`
- `convert_comment_block`
- `convert_integer_literal`
- `convert_into_to_from`
- `convert_iter_for_each_to_for`
- `convert_let_else_to_match`
- `convert_tuple_struct_to_named_struct`
- `convert_two_arm_bool_match_to_matches_macro`
- `destructure_tuple_binding`
- `extract_function`
- `extract_module`
- `extract_struct_from_enum_variant`
- `extract_type_alias`
- `extract_variable`
- `fix_visibility`

20 months agoAuto merge of #13549 - Veykril:search-fix, r=Veykril
bors [Sat, 5 Nov 2022 12:16:18 +0000 (12:16 +0000)]
Auto merge of #13549 - Veykril:search-fix, r=Veykril

fix: Fix reference searching only accounting substrings instead of whole identifiers

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

20 months agofix: Fix reference searching only accounting substrings instead of whole identifiers
Lukas Wirth [Sat, 5 Nov 2022 11:04:21 +0000 (12:04 +0100)]
fix: Fix reference searching only accounting substrings instead of whole identifiers

20 months agoFix `tt::Punct`'s spacing calculation
Ryo Yoshida [Sat, 5 Nov 2022 10:01:26 +0000 (19:01 +0900)]
Fix `tt::Punct`'s spacing calculation

20 months agoRename convertor -> converter
Ryo Yoshida [Wed, 2 Nov 2022 14:26:29 +0000 (23:26 +0900)]
Rename convertor -> converter

20 months agoAuto merge of #13454 - justinmmott:master, r=flodiebold
bors [Sat, 5 Nov 2022 10:05:52 +0000 (10:05 +0000)]
Auto merge of #13454 - justinmmott:master, r=flodiebold

Fixed local shadowing the caller's argument issue

fix https://github.com/rust-lang/rust-analyzer/issues/12536