]> git.lizzy.rs Git - rust.git/log
rust.git
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 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: 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 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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.

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

20 months agoAdd tests for LineEndings::normalize
Lukas Wirth [Sat, 5 Nov 2022 10:00:17 +0000 (11:00 +0100)]
Add tests for LineEndings::normalize

20 months agointernal: Optimize `apply_document_changes` a bit
Lukas Wirth [Fri, 4 Nov 2022 23:27:03 +0000 (00:27 +0100)]
internal: Optimize `apply_document_changes` a bit

20 months agoAuto merge of #13541 - Veykril:dbg-cmd, r=Veykril
bors [Fri, 4 Nov 2022 23:30:48 +0000 (23:30 +0000)]
Auto merge of #13541 - Veykril:dbg-cmd, r=Veykril

Clarify what commands are debug commands in VSCode

Renders as
![image](https://user-images.githubusercontent.com/3757771/199828895-4d7691f6-5c33-405c-9842-691b32745919.png)

20 months agoMark the Memory Usage command as debug command
Lukas Wirth [Fri, 4 Nov 2022 23:30:21 +0000 (00:30 +0100)]
Mark the Memory Usage command as debug command

20 months agoFix up adjustment hints configurations
Lukas Wirth [Fri, 4 Nov 2022 21:59:07 +0000 (22:59 +0100)]
Fix up adjustment hints configurations

20 months agoAdd adjustment hint tests
Lukas Wirth [Fri, 4 Nov 2022 21:40:06 +0000 (22:40 +0100)]
Add adjustment hint tests

20 months agoGeneralize reborrow hints as adjustment hints
Lukas Wirth [Fri, 4 Nov 2022 16:11:15 +0000 (17:11 +0100)]
Generalize reborrow hints as adjustment hints

20 months agoAuto merge of #13546 - Veykril:unsafe-fn-ptr, r=Veykril
bors [Fri, 4 Nov 2022 20:29:16 +0000 (20:29 +0000)]
Auto merge of #13546 - Veykril:unsafe-fn-ptr, r=Veykril

Lower unsafety of fn pointer and fn item types

20 months agoLower unsafety of fn pointer and fn item types
Lukas Wirth [Fri, 4 Nov 2022 20:07:15 +0000 (21:07 +0100)]
Lower unsafety of fn pointer and fn item types

20 months agoAuto merge of #13544 - HKalbasi:patch-2, r=Veykril
bors [Fri, 4 Nov 2022 16:12:21 +0000 (16:12 +0000)]
Auto merge of #13544 - HKalbasi:patch-2, r=Veykril

Add rustbot features related to PR state labels

It makes rustbot add `S-waiting-on-review` to every new PR, and ``@rustbot` author` and ``@rustbot` review` commands working.

20 months agoAdd rustbot features related to PR state labels
HKalbasi [Fri, 4 Nov 2022 11:57:50 +0000 (15:27 +0330)]
Add rustbot features related to PR state labels

20 months agoClarify what commands are debug commands in VSCode
Lukas Wirth [Thu, 3 Nov 2022 20:36:14 +0000 (21:36 +0100)]
Clarify what commands are debug commands in VSCode

20 months agoAuto merge of #13456 - emilio:scip-local-symbol, r=Veykril
bors [Thu, 3 Nov 2022 13:58:36 +0000 (13:58 +0000)]
Auto merge of #13456 - emilio:scip-local-symbol, r=Veykril

scip: Generate symbols for local crates.

Consider something like:

```
// a.rs
pub struct Foo { .. } // Foo is "local 1"

fn something() {
    crate::b::Bar::new() // Bar is "local 1", but of "b.rs"
}

// b.rs
pub struct Bar { .. } // "local 1"
```

Without this there's no way to disambiguate whether "local 1" references "Bar" or "Foo".

20 months agoAuto merge of #13537 - lnicola:ovsx-fail, r=lnicola
bors [Thu, 3 Nov 2022 13:43:38 +0000 (13:43 +0000)]
Auto merge of #13537 - lnicola:ovsx-fail, r=lnicola

minor: Allow ovsx publishing to fail

20 months agoAllow ovsx publishing to fail
Laurențiu Nicola [Thu, 3 Nov 2022 13:42:55 +0000 (15:42 +0200)]
Allow ovsx publishing to fail

20 months agodocs: add crates section to the manual
Rongjian Zhang [Thu, 3 Nov 2022 05:17:03 +0000 (13:17 +0800)]
docs: add crates section to the manual

20 months agoAuto merge of #13530 - lnicola:bump-ovsx, r=lnicola
bors [Wed, 2 Nov 2022 13:11:55 +0000 (13:11 +0000)]
Auto merge of #13530 - lnicola:bump-ovsx, r=lnicola

minor: Bump ovsx

CC https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/1330#note_1033611