]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoSort config definition
Lukas Wirth [Tue, 26 Apr 2022 11:18:51 +0000 (13:18 +0200)]
Sort config definition

2 years agoInitial config revamp
Lukas Wirth [Tue, 26 Apr 2022 11:00:45 +0000 (13:00 +0200)]
Initial config revamp

2 years agoAuto merge of #12118 - randomicon00:fix#12102, r=lnicola
bors [Sun, 1 May 2022 11:00:48 +0000 (11:00 +0000)]
Auto merge of #12118 - randomicon00:fix#12102, r=lnicola

style: rename crates to kebab-case

Ref: #12102
I updated all the folders names as well as the crates names in each `Cargo.toml` to use kebab-case.

This is my first ra PR. In case I missed something, I am ready/available to fix it until it is ready to merge.

Thank you.

2 years agodelete another swap file
Peh [Sun, 1 May 2022 09:06:23 +0000 (09:06 +0000)]
delete another swap file

2 years agoupdate crates names in slow-tests/tidy.rs
Peh [Sat, 30 Apr 2022 21:46:10 +0000 (21:46 +0000)]
update crates names in slow-tests/tidy.rs

2 years agoupdate diagnostic-docs crate name
Peh [Sat, 30 Apr 2022 21:18:02 +0000 (21:18 +0000)]
update diagnostic-docs crate name

2 years agoupdated ide-assist new dir name
Peh [Sat, 30 Apr 2022 21:00:41 +0000 (21:00 +0000)]
updated ide-assist new dir name

2 years agodelete a generated swap file
Peh [Sat, 30 Apr 2022 20:14:26 +0000 (20:14 +0000)]
delete a generated swap file

2 years agostyle: rename crates to kebab case
Peh [Fri, 29 Apr 2022 14:29:24 +0000 (14:29 +0000)]
style: rename crates to kebab case

2 years agoAuto merge of #12099 - bitgaoshu:master, r=flodiebold
bors [Sun, 1 May 2022 08:49:58 +0000 (08:49 +0000)]
Auto merge of #12099 - bitgaoshu:master, r=flodiebold

fix #11986 Aliases break resolution of qualified variants in patterns

2 years agoAuto merge of #12127 - dtolnay-contrib:checkoutv3, r=lnicola
bors [Sun, 1 May 2022 05:46:30 +0000 (05:46 +0000)]
Auto merge of #12127 - dtolnay-contrib:checkoutv3, r=lnicola

Update GitHub Actions actions/checkout@v2 to v3

The v2 implementation uses Node 12, which is end-of-life on April 30, 2022. See https://nodejs.org/en/about/releases/. Update to v3, which is based on Node 16 whose support lasts until April 30, 2024.

They made this a major version change (v2 to v3) because old GitHub Enterprise versions aren't necessarily compatible with Node 16, but for github.com-supplied runners (SaaS) there is no practical difference.

2 years agoUpdate GitHub Actions actions/checkout@v2 to v3
David Tolnay [Sat, 30 Apr 2022 20:56:03 +0000 (13:56 -0700)]
Update GitHub Actions actions/checkout@v2 to v3

The v2 implementation uses Node 12, which is end-of-life on April 30, 2022.
See https://nodejs.org/en/about/releases/. Update to v3, which is based on
Node 16 whose support lasts until April 30, 2024.

2 years agoAuto merge of #12126 - Smibu:patch-1, r=lnicola
bors [Sat, 30 Apr 2022 18:15:21 +0000 (18:15 +0000)]
Auto merge of #12126 - Smibu:patch-1, r=lnicola

Fix typo in VSCode readme

2 years agoFix typo in VSCode readme
Mika Lehtinen [Sat, 30 Apr 2022 18:03:51 +0000 (21:03 +0300)]
Fix typo in VSCode readme

2 years agoAuto merge of #12124 - lnicola:downgrade-kqueue, r=lnicola
bors [Sat, 30 Apr 2022 16:03:02 +0000 (16:03 +0000)]
Auto merge of #12124 - lnicola:downgrade-kqueue, r=lnicola

minor: Downgrade kqueue to fix NetBSD

CC https://github.com/notify-rs/notify/issues/401#issuecomment-1114010902

2 years agoDowngrade kqueue to fix NetBSD
Laurențiu Nicola [Sat, 30 Apr 2022 16:02:24 +0000 (19:02 +0300)]
Downgrade kqueue to fix NetBSD

2 years agoAuto merge of #12117 - Veykril:mexpand, r=Veykril
bors [Fri, 29 Apr 2022 12:07:52 +0000 (12:07 +0000)]
Auto merge of #12117 - Veykril:mexpand, r=Veykril

minor: Insert whitespace after const token when formatting macro expansions

2 years agominor: Insert whitespace after const token when formatting macro expansions
Lukas Wirth [Fri, 29 Apr 2022 12:07:19 +0000 (14:07 +0200)]
minor: Insert whitespace after const token when formatting macro expansions

2 years agoAuto merge of #12113 - jtracey:patch-1, r=lnicola
bors [Fri, 29 Apr 2022 06:06:42 +0000 (06:06 +0000)]
Auto merge of #12113 - jtracey:patch-1, r=lnicola

small typo in log message

2 years agosmall typo in log message
Justin Tracey [Fri, 29 Apr 2022 05:59:32 +0000 (05:59 +0000)]
small typo in log message

2 years agoAuto merge of #12111 - jonas-schievink:fix-outline-mod-completion, r=jonas-schievink
bors [Thu, 28 Apr 2022 18:23:26 +0000 (18:23 +0000)]
Auto merge of #12111 - jonas-schievink:fix-outline-mod-completion, r=jonas-schievink

fix: fix outline mod completion with partial module name

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

![screenshot-2022-04-28-20:22:42](https://user-images.githubusercontent.com/1786438/165821068-a673a154-ce53-4489-af60-56d09dc9061c.png)

2 years agoFix outline mod completion with partial module name
Jonas Schievink [Thu, 28 Apr 2022 18:21:46 +0000 (20:21 +0200)]
Fix outline mod completion with partial module name

2 years agoAuto merge of #12110 - jonas-schievink:inline-self-type, r=jonas-schievink
bors [Thu, 28 Apr 2022 17:24:22 +0000 (17:24 +0000)]
Auto merge of #12110 - jonas-schievink:inline-self-type, r=jonas-schievink

feat: Make "inline type alias" work for `Self`

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

2 years agoAdd test with trait
Jonas Schievink [Thu, 28 Apr 2022 17:23:57 +0000 (19:23 +0200)]
Add test with trait

2 years agoMake "inline type alias" work for `Self`
Jonas Schievink [Thu, 28 Apr 2022 17:20:23 +0000 (19:20 +0200)]
Make "inline type alias" work for `Self`

2 years agoAuto merge of #12108 - Veykril:simplify, r=Veykril
bors [Thu, 28 Apr 2022 13:18:35 +0000 (13:18 +0000)]
Auto merge of #12108 - Veykril:simplify, r=Veykril

minor: Record snippet config errors

2 years agominor: Record snippet config errors
Lukas Wirth [Thu, 28 Apr 2022 13:17:44 +0000 (15:17 +0200)]
minor: Record snippet config errors

2 years ago#11986 Aliases break resolution of qualified variants in patterns
bitgaoshu [Wed, 27 Apr 2022 15:34:08 +0000 (23:34 +0800)]
#11986 Aliases break resolution of qualified variants in patterns

2 years agoAuto merge of #12103 - jonas-schievink:diagnose-unresolved-derives, r=jonas-schievink
bors [Wed, 27 Apr 2022 18:05:37 +0000 (18:05 +0000)]
Auto merge of #12103 - jonas-schievink:diagnose-unresolved-derives, r=jonas-schievink

feat: diagnose unresolved derive macros

![screenshot-2022-04-27-20:04:59](https://user-images.githubusercontent.com/1786438/165591059-c759f035-2400-4bb1-84b0-9332e86c65d5.png)

2 years agoDiagnose unresolved derive macros
Jonas Schievink [Wed, 27 Apr 2022 18:03:57 +0000 (20:03 +0200)]
Diagnose unresolved derive macros

2 years agoAuto merge of #12101 - Veykril:simplify, r=Veykril
bors [Wed, 27 Apr 2022 17:54:26 +0000 (17:54 +0000)]
Auto merge of #12101 - Veykril:simplify, r=Veykril

Simplify

2 years agoSimplify
Lukas Wirth [Wed, 27 Apr 2022 17:53:56 +0000 (19:53 +0200)]
Simplify

2 years agoAuto merge of #12090 - Veykril:recov, r=Veykril
bors [Wed, 27 Apr 2022 17:18:46 +0000 (17:18 +0000)]
Auto merge of #12090 - Veykril:recov, r=Veykril

fix: Use pattern recovery set when parsing ident patterns

2 years agofix: Use pattern recovery set when parsing ident patterns
Lukas Wirth [Wed, 27 Apr 2022 17:08:50 +0000 (19:08 +0200)]
fix: Use pattern recovery set when parsing ident patterns

2 years agoAuto merge of #12057 - harpsword:fix_validata_visibility, r=jonas-schievink
bors [Wed, 27 Apr 2022 13:09:31 +0000 (13:09 +0000)]
Auto merge of #12057 - harpsword:fix_validata_visibility, r=jonas-schievink

fix visibility token validation in trait impl with proc-macro

fix #11828

2 years agoAuto merge of #12089 - lowr:fix/move-raw-ident-module-to-file, r=jonas-schievink
bors [Wed, 27 Apr 2022 12:59:52 +0000 (12:59 +0000)]
Auto merge of #12089 - lowr:fix/move-raw-ident-module-to-file, r=jonas-schievink

fix: handle raw identifiers in move_module_to_file

Fixes #12045

Note that I special case'd mod named `r#mod` as commented in the code. Although it's very unlikely that one would use such name, I included it in this fix for the sake of completeness.

2 years agofix visibility token validation in trait impl with proc-macro
harpsword [Fri, 22 Apr 2022 14:16:41 +0000 (22:16 +0800)]
fix visibility token validation in trait impl with proc-macro

2 years agoAuto merge of #12098 - jonas-schievink:macro-rules-snippet, r=jonas-schievink
bors [Wed, 27 Apr 2022 12:41:29 +0000 (12:41 +0000)]
Auto merge of #12098 - jonas-schievink:macro-rules-snippet, r=jonas-schievink

fix: show `macro_rules` snippet in blocks

fixes https://github.com/rust-lang/rust-analyzer/issues/12092

2 years agoShow `macro_rules` snippet in blocks
Jonas Schievink [Wed, 27 Apr 2022 12:40:09 +0000 (14:40 +0200)]
Show `macro_rules` snippet in blocks

2 years agoAuto merge of #12097 - lnicola:revert-11490, r=lnicola
bors [Wed, 27 Apr 2022 12:32:35 +0000 (12:32 +0000)]
Auto merge of #12097 - lnicola:revert-11490, r=lnicola

Revert #11490

Closes #11725

#11490 was a little misguided. Quoting the test name should be a client concern, since it's the client that actually runs `cargo`.

2 years agoRevert "Correctly fix formatting doc tests with generics"
Laurențiu Nicola [Wed, 27 Apr 2022 12:27:50 +0000 (15:27 +0300)]
Revert "Correctly fix formatting doc tests with generics"

This reverts commit 5f3327a6b8925791ecdd9dbecb1bf1537c3ef9fc.

2 years agoRevert "Update crates/ide/src/runnables.rs"
Laurențiu Nicola [Wed, 27 Apr 2022 12:27:48 +0000 (15:27 +0300)]
Revert "Update crates/ide/src/runnables.rs"

This reverts commit bf47acf1d3451eb281ea56a6ad8f5e1834ce6a8f.

2 years agoAuto merge of #12085 - rainy-me:fix_fn_param, r=Veykril
bors [Wed, 27 Apr 2022 10:43:43 +0000 (10:43 +0000)]
Auto merge of #12085 - rainy-me:fix_fn_param, r=Veykril

fix: fn_param completion lookup

close #12073 caused by #12040

2 years agofix: remove lookup and handle mut kw case
rainy-me [Wed, 27 Apr 2022 09:54:57 +0000 (18:54 +0900)]
fix: remove lookup and handle mut kw case

2 years agofix: handle raw identifiers in move_module_to_file
LowR [Tue, 26 Apr 2022 18:34:32 +0000 (03:34 +0900)]
fix: handle raw identifiers in move_module_to_file

2 years agoAuto merge of #12083 - Veykril:inlays, r=Veykril
bors [Tue, 26 Apr 2022 09:53:26 +0000 (09:53 +0000)]
Auto merge of #12083 - Veykril:inlays, r=Veykril

minor: Add test for parameter and reborrow hint order

2 years agominor: Add test for parameter and reborrow hint order
Lukas Wirth [Tue, 26 Apr 2022 09:46:03 +0000 (11:46 +0200)]
minor: Add test for parameter and reborrow hint order

2 years agoAuto merge of #12082 - iDawer:ide.signature_help, r=lnicola
bors [Tue, 26 Apr 2022 07:34:00 +0000 (07:34 +0000)]
Auto merge of #12082 - iDawer:ide.signature_help, r=lnicola

fix: `signature_help`: use corresponding param list for methods

Close #12079

2 years ago`signature_help`: use corresponding param list for methods
iDawer [Tue, 26 Apr 2022 06:50:28 +0000 (11:50 +0500)]
`signature_help`: use corresponding param list for methods

2 years agoAuto merge of #12078 - Veykril:neither, r=Veykril
bors [Mon, 25 Apr 2022 17:01:44 +0000 (17:01 +0000)]
Auto merge of #12078 - Veykril:neither, r=Veykril

minor: Re-export `FxHashMap` and `FxHashSet` from `ide_db`

2 years agoRe-export `FxHashMap` and `FxHashSet` from `ide_db`
Lukas Wirth [Mon, 25 Apr 2022 16:51:59 +0000 (18:51 +0200)]
Re-export `FxHashMap` and `FxHashSet` from `ide_db`

2 years agoAuto merge of #12077 - Veykril:neither, r=Veykril
bors [Mon, 25 Apr 2022 16:48:42 +0000 (16:48 +0000)]
Auto merge of #12077 - Veykril:neither, r=Veykril

minor: Remove `either` dependency from `ide_completion`

bors r+

2 years agominor: Remove either dependency from `ide_completion`
Lukas Wirth [Mon, 25 Apr 2022 16:40:38 +0000 (18:40 +0200)]
minor: Remove either dependency from `ide_completion`

2 years agoAuto merge of #12075 - jonas-schievink:less-aggressive-quickfixes, r=jonas-schievink
bors [Mon, 25 Apr 2022 13:22:41 +0000 (13:22 +0000)]
Auto merge of #12075 - jonas-schievink:less-aggressive-quickfixes, r=jonas-schievink

fix: Don't emit a quickfix for placeholder suggestions from rustc/clippy

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

2 years agoDon't emit a quickfix for placeholder suggestions
Jonas Schievink [Mon, 25 Apr 2022 13:21:30 +0000 (15:21 +0200)]
Don't emit a quickfix for placeholder suggestions

2 years agoAuto merge of #12007 - edwin0cheng:restart-proc-macro-reload, r=jonas-schievink
bors [Mon, 25 Apr 2022 12:56:57 +0000 (12:56 +0000)]
Auto merge of #12007 - edwin0cheng:restart-proc-macro-reload, r=jonas-schievink

Restart proc-macro client when server reload

Fix #10719

2 years agoAuto merge of #12071 - Ma124:fix-tabs-snippet, r=jonas-schievink
bors [Mon, 25 Apr 2022 12:44:49 +0000 (12:44 +0000)]
Auto merge of #12071 - Ma124:fix-tabs-snippet, r=jonas-schievink

Change tabs to spacs in macro_rules snippet

This PR changes the `macro_rules!` snippet to use spaces instead of tabs.
The other snippets like [this one][test-snippet] already use spaces.

The snippet was introduced in 5575588 where no reason is provided to use tabs.

[test-snippet]: https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide_completion/src/completions/snippet.rs#L70=

2 years agoAuto merge of #12074 - jonas-schievink:deprioritize-flyimport, r=jonas-schievink
bors [Mon, 25 Apr 2022 12:35:39 +0000 (12:35 +0000)]
Auto merge of #12074 - jonas-schievink:deprioritize-flyimport, r=jonas-schievink

Reduce priority of flyimport completions

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

2 years agoReduce priority of flyimport completions
Jonas Schievink [Mon, 25 Apr 2022 12:34:54 +0000 (14:34 +0200)]
Reduce priority of flyimport completions

2 years agoAuto merge of #12072 - bitgaoshu:master, r=jonas-schievink
bors [Mon, 25 Apr 2022 11:07:09 +0000 (11:07 +0000)]
Auto merge of #12072 - bitgaoshu:master, r=jonas-schievink

fix #11973 associated type is unresolved

2 years agoChange tabs to spacs in macro_rules snippet
Ma_124 [Sun, 24 Apr 2022 12:24:59 +0000 (14:24 +0200)]
Change tabs to spacs in macro_rules snippet

2 years ago#11973 associated type is unresolved
bitgaoshu [Sun, 24 Apr 2022 12:51:48 +0000 (20:51 +0800)]
#11973 associated type is unresolved

2 years agoAuto merge of #12070 - rust-lang:message, r=matklad
bors [Sun, 24 Apr 2022 12:41:16 +0000 (12:41 +0000)]
Auto merge of #12070 - rust-lang:message, r=matklad

minor: clarify error message

Clarify that the server is a whole is OK, and that it's only a single
requests that's dead

2 years agominor: clarify error message
Aleksey Kladov [Sun, 24 Apr 2022 12:39:33 +0000 (13:39 +0100)]
minor: clarify error message

Clarify that the server is a whole is OK, and that it's only a single
requests that's dead

2 years agoFix Reload Workspace command
Edwin Cheng [Sun, 24 Apr 2022 03:59:08 +0000 (11:59 +0800)]
Fix Reload Workspace command

2 years agoAuto merge of #12064 - Veykril:attr-range, r=Veykril
bors [Sat, 23 Apr 2022 14:37:35 +0000 (14:37 +0000)]
Auto merge of #12064 - Veykril:attr-range, r=Veykril

fix: Fix `ide_db::search` not searching bodies of attributed items

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

2 years agofix: Fix ide_db::search not searching bodies of attributed items
Lukas Wirth [Sat, 23 Apr 2022 14:36:11 +0000 (16:36 +0200)]
fix: Fix ide_db::search not searching bodies of attributed items

2 years agoAuto merge of #12063 - iDawer:ide.signature_help, r=Veykril
bors [Sat, 23 Apr 2022 14:23:30 +0000 (14:23 +0000)]
Auto merge of #12063 - iDawer:ide.signature_help, r=Veykril

fix: Fall back to parameter definitions on error types in signature help

Fixes  #10432

2 years agoAdd fallback for return type
iDawer [Sat, 23 Apr 2022 11:45:47 +0000 (16:45 +0500)]
Add fallback for return type

2 years agoFall back to parameter definitions on error types in signature help
iDawer [Sat, 23 Apr 2022 10:10:10 +0000 (15:10 +0500)]
Fall back to parameter definitions on error types in signature help

2 years agoAuto merge of #12060 - Veykril:completion-ctx, r=Veykril
bors [Sat, 23 Apr 2022 00:29:18 +0000 (00:29 +0000)]
Auto merge of #12060 - Veykril:completion-ctx, r=Veykril

minor: Simplify

bors r+

2 years agoSimplify
Lukas Wirth [Sat, 23 Apr 2022 00:21:27 +0000 (02:21 +0200)]
Simplify

2 years agoAuto merge of #12058 - jonas-schievink:one-thread-with-extra-stack-please, r=jonas...
bors [Fri, 22 Apr 2022 15:46:30 +0000 (15:46 +0000)]
Auto merge of #12058 - jonas-schievink:one-thread-with-extra-stack-please, r=jonas-schievink

fix: Spawn a new thread with a larger stack for the LSP and proc-macro server

This runs the server and proc-macro process in dedicated threads with 8 MB of stack space to paper over OS differences and fix occasional stack overflows.

This hopefully resolves https://github.com/rust-lang/rust-analyzer/issues/11669

2 years agoSpawn a new thread with a larger stack for the server
Jonas Schievink [Fri, 22 Apr 2022 15:30:18 +0000 (17:30 +0200)]
Spawn a new thread with a larger stack for the server

2 years agoAuto merge of #12054 - HKalbasi:const_generic, r=flodiebold
bors [Fri, 22 Apr 2022 15:22:49 +0000 (15:22 +0000)]
Auto merge of #12054 - HKalbasi:const_generic, r=flodiebold

Fix const generic panic in dyn trait

fix #12048

2 years agoremove trailing space
hkalbasi [Fri, 22 Apr 2022 14:59:10 +0000 (19:29 +0430)]
remove trailing space

2 years agoAdd some comments about why never!() never happens
hkalbasi [Fri, 22 Apr 2022 14:52:18 +0000 (19:22 +0430)]
Add some comments about why never!() never happens

2 years agoAuto merge of #12053 - willcrichton:master, r=jonas-schievink
bors [Fri, 22 Apr 2022 14:42:25 +0000 (14:42 +0000)]
Auto merge of #12053 - willcrichton:master, r=jonas-schievink

Export lc.LanguageClient from VSCode extension

As described in [this Zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/Use.20Rust.20Analyzer.20in.20another.20VSCode.20extension), I would like to experiment with using Rust Analyzer's language server inside another VSCode extension, [Flowistry](https://github.com/willcrichton/flowistry). My current use case is to use one of Rust Analyzer's assists (extract function).

This PR would enable that experimentation by exporting the `lc.LanguageClient` from the `activate` function, which [allows other extensions to access it](https://code.visualstudio.com/api/references/vscode-api#extensions). This PR does **not** commit RA to any stability guarantees about the language client, similar to how rustc exports an unstable API.

2 years agofix const generic panic in dyn trait
hkalbasi [Thu, 21 Apr 2022 21:05:28 +0000 (01:35 +0430)]
fix const generic panic in dyn trait

2 years agoExport lc.LanguageClient from VSCode extension
Will Crichton [Thu, 21 Apr 2022 20:39:53 +0000 (13:39 -0700)]
Export lc.LanguageClient from VSCode extension

2 years agoAuto merge of #12052 - lnicola:cargo-config, r=lnicola
bors [Thu, 21 Apr 2022 18:10:37 +0000 (18:10 +0000)]
Auto merge of #12052 - lnicola:cargo-config, r=lnicola

minor: drop `install-ra` cargo alias

2 years agoRename cargo config to config.toml
Laurențiu Nicola [Thu, 21 Apr 2022 18:08:07 +0000 (21:08 +0300)]
Rename cargo config to config.toml

2 years agoRemove old install-ra cargo alias
Laurențiu Nicola [Thu, 21 Apr 2022 18:06:28 +0000 (21:06 +0300)]
Remove old install-ra cargo alias

2 years agoAuto merge of #12015 - arjo129:master, r=jonas-schievink
bors [Thu, 21 Apr 2022 16:52:10 +0000 (16:52 +0000)]
Auto merge of #12015 - arjo129:master, r=jonas-schievink

[Documentation]: Update developer documentation link.

Just noticed the docs links broken. The current doc link was broken. replaced with the updated version as found on the front page. Should the rest of the links be updated?

2 years agoAuto merge of #12051 - jonas-schievink:triagebot, r=jonas-schievink
bors [Thu, 21 Apr 2022 15:48:42 +0000 (15:48 +0000)]
Auto merge of #12051 - jonas-schievink:triagebot, r=jonas-schievink

Add triagebot.toml

Allow people to claim issues

2 years agoAdd triagebot.toml
Jonas Schievink [Thu, 21 Apr 2022 15:43:12 +0000 (17:43 +0200)]
Add triagebot.toml

2 years agoAuto merge of #12040 - rainy-me:improve-parameter-completion, r=jonas-schievink
bors [Thu, 21 Apr 2022 15:39:10 +0000 (15:39 +0000)]
Auto merge of #12040 - rainy-me:improve-parameter-completion, r=jonas-schievink

fix: Improve parameter completion

fix https://github.com/rust-lang/rust-analyzer/issues/12016 and handles some extra cases.

2 years agofix: lookup
rainy-me [Thu, 21 Apr 2022 15:07:42 +0000 (00:07 +0900)]
fix: lookup

2 years agoAuto merge of #12044 - tedinski:fix_rustc_workspace, r=jonas-schievink
bors [Thu, 21 Apr 2022 14:03:37 +0000 (14:03 +0000)]
Auto merge of #12044 - tedinski:fix_rustc_workspace, r=jonas-schievink

fix: index the correct CargoWorkspace with rustc_private

I believe this fixes #12043, but I'm not sufficiently setup/familiar with working on rust-analyzer to test it locally. :/

This section of code is iterating on `rustc_workspace.packages()` but then indexes `cargo[pkg]`, which is likely the source of the bug.

2 years agofix: index the correct CargoWorkspace with rustc_private
Ted Kaminski [Wed, 20 Apr 2022 17:16:04 +0000 (17:16 +0000)]
fix: index the correct CargoWorkspace with rustc_private

2 years agoAuto merge of #12042 - jonas-schievink:remove-angle-brackets-from-lang-config, r...
bors [Wed, 20 Apr 2022 14:54:24 +0000 (14:54 +0000)]
Auto merge of #12042 - jonas-schievink:remove-angle-brackets-from-lang-config, r=jonas-schievink

fix: remove angle brackets from language configuration

This should fix https://github.com/rust-lang/rust-analyzer/issues/12034

It looks like we shouldn't add any characters here that can be ambiguous, because it can make the editor highlight unrelated characters. This needs a parser to be correct, so the language server is the right place, not the editor. Upstream LSP feature request: https://github.com/microsoft/language-server-protocol/issues/672 (but it might be possible to implement this as an extension today, as long as that doesn't conflict with the built-in highlighting).

2 years agofix: remove angle brackets from language configuration
Jonas Schievink [Wed, 20 Apr 2022 14:43:24 +0000 (16:43 +0200)]
fix: remove angle brackets from language configuration

2 years agoAuto merge of #12041 - jonas-schievink:prefer-core-cfg-attr-no-std, r=jonas-schievink
bors [Wed, 20 Apr 2022 12:11:09 +0000 (12:11 +0000)]
Auto merge of #12041 - jonas-schievink:prefer-core-cfg-attr-no-std, r=jonas-schievink

feat: prefer core/alloc over std in auto-imports if `#[no_std]` is conditional

We already did this if `#![no_std]` was present, this PR makes it work with `#![cfg_attr(not(test), no_std)]` too, which is very common in libraries.

Fixes https://github.com/rust-lang/rust-analyzer/issues/12035
cc https://github.com/rust-lang/rust-analyzer/issues/10718

2 years agoPrefer core/alloc over std if no_std is conditional
Jonas Schievink [Wed, 20 Apr 2022 12:07:40 +0000 (14:07 +0200)]
Prefer core/alloc over std if no_std is conditional

2 years agofix: improve parameter completion
rainy-me [Wed, 20 Apr 2022 08:56:20 +0000 (17:56 +0900)]
fix: improve parameter completion

2 years agoAuto merge of #12037 - lnicola:inlay-hint-config, r=lnicola
bors [Wed, 20 Apr 2022 04:38:22 +0000 (04:38 +0000)]
Auto merge of #12037 - lnicola:inlay-hint-config, r=lnicola

fix: Remove `rust-analyzer.inlayHints.enable` and set language scope

Closes #12036
CC https://github.com/rust-lang/rust-analyzer/issues/12027#issuecomment-1102990324

The key was left there by mistake in #12006.

Setting the configuration scope only works if you already have it created, which is fine, but unfortunately not quite discoverable.

2 years agoPass the language id when toggling inlay hints
Laurențiu Nicola [Wed, 20 Apr 2022 04:34:00 +0000 (07:34 +0300)]
Pass the language id when toggling inlay hints

2 years agoActually remove rust-analyzer.inlayHints.enable
Laurențiu Nicola [Wed, 20 Apr 2022 04:33:26 +0000 (07:33 +0300)]
Actually remove rust-analyzer.inlayHints.enable

2 years agoAuto merge of #12032 - jonas-schievink:code-action-commands, r=jonas-schievink
bors [Tue, 19 Apr 2022 16:46:33 +0000 (16:46 +0000)]
Auto merge of #12032 - jonas-schievink:code-action-commands, r=jonas-schievink

feat: display signature help when applying "Add `::<>`" assist

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

2 years agoAllows triggering commands after an assist edit
Jonas Schievink [Tue, 19 Apr 2022 16:37:18 +0000 (18:37 +0200)]
Allows triggering commands after an assist edit