]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoTrigger hover requests on closing brace hints
Lukas Wirth [Tue, 17 May 2022 11:39:45 +0000 (13:39 +0200)]
Trigger hover requests on closing brace hints

2 years agoReplace some SmolStr usages with String as the conversion happens anyways
Lukas Wirth [Tue, 17 May 2022 10:56:14 +0000 (12:56 +0200)]
Replace some SmolStr usages with String as the conversion happens anyways

2 years agofeat: Implement inlay hint tooltips
Lukas Wirth [Tue, 17 May 2022 10:49:51 +0000 (12:49 +0200)]
feat: Implement inlay hint tooltips

2 years agointernal: Cleanup lifetime elision hints
Lukas Wirth [Tue, 17 May 2022 10:18:07 +0000 (12:18 +0200)]
internal: Cleanup lifetime elision hints

2 years agoAuto merge of #12276 - jonas-schievink:improve-generate-deref-impl, r=jonas-schievink
bors [Mon, 16 May 2022 18:12:53 +0000 (18:12 +0000)]
Auto merge of #12276 - jonas-schievink:improve-generate-deref-impl, r=jonas-schievink

feat: Improve "Generate `Deref` impl" assist

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

The assist will now generate a `DerefMut` impl if a `Deref` impl is already present.

2 years agoImprove "Generate `Deref` impl" assist
Jonas Schievink [Mon, 16 May 2022 18:10:46 +0000 (20:10 +0200)]
Improve "Generate `Deref` impl" assist

2 years agoAuto merge of #12275 - jonas-schievink:remove-setter-doc-gen, r=jonas-schievink
bors [Mon, 16 May 2022 17:28:01 +0000 (17:28 +0000)]
Auto merge of #12275 - jonas-schievink:remove-setter-doc-gen, r=jonas-schievink

fix: Don't generate documentation in `generate_setter`

Followup to https://github.com/rust-lang/rust-analyzer/pull/12274

2 years agoDon't generate documentation in `generate_setter`
Jonas Schievink [Mon, 16 May 2022 17:27:27 +0000 (19:27 +0200)]
Don't generate documentation in `generate_setter`

2 years agoAuto merge of #12274 - jonas-schievink:move-getter-docs-generation, r=jonas-schievink
bors [Mon, 16 May 2022 17:14:16 +0000 (17:14 +0000)]
Auto merge of #12274 - jonas-schievink:move-getter-docs-generation, r=jonas-schievink

feat: Handle getters and setters in documentation template assist

The assist can now turn this:

```rust
pub struct S;
impl S {
    pub fn data_mut$0(&mut self) -> &mut [u8] { &mut [] }
}
```

into

```rust
pub struct S;
impl S {
    /// Returns a mutable reference to the data.
    ///
    /// # Examples
    ///
    /// ```
    /// use test::S;
    ///
    /// let mut s = ;
    /// assert_eq!(s.data_mut(), );
    /// assert_eq!(s, );
    /// ```
    pub fn data_mut(&mut self) -> &mut [u8] { &mut [] }
}
```

And similarly for by-value or immutable getters, and for setters. Previously the intro line would be empty.

This PR also removes the documentation generation function from the "Generate getter/setter" assist, since that is better handled by applying the 2 assists in sequence. cc https://github.com/rust-lang/rust-analyzer/issues/12273

2 years agoHandle getters and setters in documentation template assist
Jonas Schievink [Mon, 16 May 2022 17:10:38 +0000 (19:10 +0200)]
Handle getters and setters in documentation template assist

2 years agoAuto merge of #12271 - bitgaoshu:box_with_expec, r=flodiebold
bors [Mon, 16 May 2022 15:00:36 +0000 (15:00 +0000)]
Auto merge of #12271 - bitgaoshu:box_with_expec, r=flodiebold

fix #12227 Type mismatch error shown

add box expectation hint

2 years agoAuto merge of #12272 - jonas-schievink:fix-signature-help-offsets, r=jonas-schievink
bors [Mon, 16 May 2022 13:50:00 +0000 (13:50 +0000)]
Auto merge of #12272 - jonas-schievink:fix-signature-help-offsets, r=jonas-schievink

fix: Fix signature help LSP offset conversion

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

I don't think we really handle this correctly anywhere (eg. surrogates probably aren't counted right), but this at least fixes the immediately visible bug.

2 years agoFix signature help LSP offset conversion
Jonas Schievink [Mon, 16 May 2022 13:48:38 +0000 (15:48 +0200)]
Fix signature help LSP offset conversion

2 years agoAuto merge of #12244 - jonas-schievink:closing-brace-hints, r=jonas-schievink
bors [Mon, 16 May 2022 13:25:04 +0000 (13:25 +0000)]
Auto merge of #12244 - jonas-schievink:closing-brace-hints, r=jonas-schievink

feat: Show inlay hints after a `}` to indicate the closed item

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

![screenshot-2022-05-13-19:42:00](https://user-images.githubusercontent.com/1786438/168338713-4cedef50-3611-4667-aa6a-49e154ec16a7.png)

2 years agoAdd closing brace hints for macros
Jonas Schievink [Mon, 16 May 2022 13:23:25 +0000 (15:23 +0200)]
Add closing brace hints for macros

2 years agoadd box expection hint
bitgaoshu [Sun, 15 May 2022 13:14:11 +0000 (21:14 +0800)]
add box expection hint

2 years agoShow inlay hints after a `}` to indicate the closed item
Jonas Schievink [Fri, 13 May 2022 17:42:59 +0000 (19:42 +0200)]
Show inlay hints after a `}` to indicate the closed item

2 years agoAuto merge of #12256 - matklad:m, r=matklad
bors [Mon, 16 May 2022 11:44:00 +0000 (11:44 +0000)]
Auto merge of #12256 - matklad:m, r=matklad

minor: rename

2 years agominor: rename
Aleksey Kladov [Sat, 14 May 2022 21:08:16 +0000 (22:08 +0100)]
minor: rename

2 years agoAuto merge of #12253 - Veykril:bm, r=Veykril
bors [Mon, 16 May 2022 11:16:22 +0000 (11:16 +0000)]
Auto merge of #12253 - Veykril:bm, r=Veykril

feat: Add binding mode inlay hints

![image](https://user-images.githubusercontent.com/3757771/168427387-2f299438-a0cc-496b-a9a5-d689ef6a2b55.png)

2 years agoAuto merge of #12242 - flodiebold:extension-description, r=flodiebold
bors [Sun, 15 May 2022 18:11:32 +0000 (18:11 +0000)]
Auto merge of #12242 - flodiebold:extension-description, r=flodiebold

Improve extension description and README

2 years agoAuto merge of #12262 - jhgg:fix-whitespace-between-mut-self-in-macro-expansion, r...
bors [Sun, 15 May 2022 12:47:38 +0000 (12:47 +0000)]
Auto merge of #12262 - jhgg:fix-whitespace-between-mut-self-in-macro-expansion, r=lnicola

ide: insert whitespace between 'mut' and 'self' in macro expansion

fixes #12260

2 years agoAuto merge of #12190 - harpsword:fix_diagostics_map_incorrectly, r=harpsword
bors [Sun, 15 May 2022 09:48:51 +0000 (09:48 +0000)]
Auto merge of #12190 - harpsword:fix_diagostics_map_incorrectly, r=harpsword

fix cargo check diagnostics are mapped incorrectly with non-BMP codepoints

fix #11945

2 years agoide: insert whitespace between 'mut' and 'self' in macro expansion
Jake Heinz [Sun, 15 May 2022 07:55:13 +0000 (07:55 +0000)]
ide: insert whitespace between 'mut' and 'self' in macro expansion

2 years agoAuto merge of #12251 - matklad:lsp-server, r=matklad
bors [Sat, 14 May 2022 20:20:01 +0000 (20:20 +0000)]
Auto merge of #12251 - matklad:lsp-server, r=matklad

internal: vendor lsp-server

2 years agointernal: vendor lsp-server
Aleksey Kladov [Sat, 14 May 2022 10:33:48 +0000 (11:33 +0100)]
internal: vendor lsp-server

2 years agoUpdate package.json
Lukas Wirth [Sat, 14 May 2022 13:18:18 +0000 (15:18 +0200)]
Update package.json

2 years agoEnable reborrow hints in attribute calls
Lukas Wirth [Sat, 14 May 2022 13:00:14 +0000 (15:00 +0200)]
Enable reborrow hints in attribute calls

2 years agofeat: Add binding mode inlay hints
Lukas Wirth [Sat, 14 May 2022 12:26:08 +0000 (14:26 +0200)]
feat: Add binding mode inlay hints

2 years agoAuto merge of #12252 - Veykril:config, r=Veykril
bors [Sat, 14 May 2022 11:56:11 +0000 (11:56 +0000)]
Auto merge of #12252 - Veykril:config, r=Veykril

internal: Make VSCode config more GUI edit friendly

2 years agointernal: Make VSCode config more GUI edit friendly
Lukas Wirth [Sat, 14 May 2022 11:53:41 +0000 (13:53 +0200)]
internal: Make VSCode config more GUI edit friendly

2 years agofix diagnostics location map incorrectly from rustc span to lsp position for non...
harpsword [Sun, 8 May 2022 03:06:52 +0000 (11:06 +0800)]
fix diagnostics location map incorrectly from rustc span to lsp position for non-BMP char

2 years agoChange description
Florian Diebold [Fri, 13 May 2022 20:13:23 +0000 (22:13 +0200)]
Change description

2 years agoAuto merge of #12246 - Veykril:config, r=Veykril
bors [Fri, 13 May 2022 19:36:32 +0000 (19:36 +0000)]
Auto merge of #12246 - Veykril:config, r=Veykril

fix: Fix incorrect hover actions config keys

2 years agoDon't make r-a fail to initialize if updating the config fails
Lukas Wirth [Fri, 13 May 2022 19:20:37 +0000 (21:20 +0200)]
Don't make r-a fail to initialize if updating the config fails

2 years agofix: Fix incorrect hover actions config keys
Lukas Wirth [Fri, 13 May 2022 19:17:03 +0000 (21:17 +0200)]
fix: Fix incorrect hover actions config keys

2 years agoAuto merge of #12245 - Veykril:compl-snip, r=Veykril
bors [Fri, 13 May 2022 17:53:23 +0000 (17:53 +0000)]
Auto merge of #12245 - Veykril:compl-snip, r=Veykril

fix: Fix fill-arguments completions not working

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

2 years agofix: Fix fill-arguments completions not working
Lukas Wirth [Fri, 13 May 2022 17:52:44 +0000 (19:52 +0200)]
fix: Fix fill-arguments completions not working

2 years agoImprove extension description and README
Florian Diebold [Fri, 13 May 2022 16:12:54 +0000 (18:12 +0200)]
Improve extension description and README

2 years agoAuto merge of #12241 - jonas-schievink:does-not-float-my-boat, r=jonas-schievink
bors [Fri, 13 May 2022 15:02:00 +0000 (15:02 +0000)]
Auto merge of #12241 - jonas-schievink:does-not-float-my-boat, r=jonas-schievink

fix: revert float parsing "fix" to avoid macro-related panics

Reverts https://github.com/rust-lang/rust-analyzer/pull/12149 and the follow-up fixes, while keeping their tests.

https://github.com/rust-lang/rust-analyzer/pull/12149 has caused many unexpected panics related to macros, and the fixes for those are not straightforward and further complicate the MBE token conversion logic, which was already fairly hard to follow before these fixes.

2 years agoFix tests
Jonas Schievink [Fri, 13 May 2022 13:27:17 +0000 (15:27 +0200)]
Fix tests

2 years agoRevert "Auto merge of #12149 - jonas-schievink:literally-just-a-literal, r=jonas...
Jonas Schievink [Fri, 13 May 2022 13:08:14 +0000 (15:08 +0200)]
Revert "Auto merge of #12149 - jonas-schievink:literally-just-a-literal, r=jonas-schievink"

This reverts commit cc9ae2b89e01a30e441371b9fd3376c3d03a475f, reversing
changes made to 7dfd1cb572d8d4fd951237361e43ecddd9c9a852.

2 years agoRevert "Skip only the `tt::Literal` when consuming float tokens"
Jonas Schievink [Fri, 13 May 2022 13:06:16 +0000 (15:06 +0200)]
Revert "Skip only the `tt::Literal` when consuming float tokens"

This reverts commit 7db55313a17a488a8e437fbd184290995f04a32d.

2 years agoRevert "Fix conversion of float literals in `TtTreeSink`"
Jonas Schievink [Fri, 13 May 2022 13:05:17 +0000 (15:05 +0200)]
Revert "Fix conversion of float literals in `TtTreeSink`"

This reverts commit 43a066c5a87972b5e42ad41bab56861661c49b18.

2 years agoRevert "fix: Remap float parts as integers when parsed as indices"
Jonas Schievink [Fri, 13 May 2022 13:05:03 +0000 (15:05 +0200)]
Revert "fix: Remap float parts as integers when parsed as indices"

This reverts commit dbb066b99e2e644437ddecb20127bcfdba975614.

2 years agoRevert "Don't remap float tokens to `INT_NUMBER`"
Jonas Schievink [Fri, 13 May 2022 13:04:15 +0000 (15:04 +0200)]
Revert "Don't remap float tokens to `INT_NUMBER`"

This reverts commit cb5e8da88a06be415bd804884284c11c0a709bcf.

2 years agoAuto merge of #12239 - Veykril:publisher, r=Veykril
bors [Fri, 13 May 2022 12:38:08 +0000 (12:38 +0000)]
Auto merge of #12239 - Veykril:publisher, r=Veykril

minor: Fix typo in publisher field

2 years agoUpdate package description
Lukas Wirth [Fri, 13 May 2022 12:11:09 +0000 (14:11 +0200)]
Update package description

2 years agofix: Fix typo in publisher field
Lukas Wirth [Fri, 13 May 2022 12:10:37 +0000 (14:10 +0200)]
fix: Fix typo in publisher field

2 years agoAuto merge of #12238 - Veykril:publisher, r=Veykril
bors [Fri, 13 May 2022 11:26:43 +0000 (11:26 +0000)]
Auto merge of #12238 - Veykril:publisher, r=Veykril

feat: Change VSCode extension publisher to `rust-lang`

2 years agofeat: Change VSCode extension publisher to `rust-lang`
Lukas Wirth [Fri, 13 May 2022 11:21:52 +0000 (13:21 +0200)]
feat: Change VSCode extension publisher to `rust-lang`

2 years agoAuto merge of #12231 - jonas-schievink:fix-float-macro-panic, r=jonas-schievink
bors [Thu, 12 May 2022 17:03:22 +0000 (17:03 +0000)]
Auto merge of #12231 - jonas-schievink:fix-float-macro-panic, r=jonas-schievink

fix: fix "X is not a valid punct" panic with floats in macros

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

2 years agoDon't remap float tokens to `INT_NUMBER`
Jonas Schievink [Thu, 12 May 2022 17:01:09 +0000 (19:01 +0200)]
Don't remap float tokens to `INT_NUMBER`

2 years agoAuto merge of #12229 - Veykril:configfix, r=Veykril
bors [Thu, 12 May 2022 16:16:20 +0000 (16:16 +0000)]
Auto merge of #12229 - Veykril:configfix, r=Veykril

fix: Fix vscode config descriptions not recognizing all valid values

2 years agofix: Fix vscode config descriptions not recognizing all valid values
Lukas Wirth [Thu, 12 May 2022 16:15:48 +0000 (18:15 +0200)]
fix: Fix vscode config descriptions not recognizing all valid values

2 years agoAuto merge of #12228 - Veykril:configfix, r=Veykril
bors [Thu, 12 May 2022 15:55:50 +0000 (15:55 +0000)]
Auto merge of #12228 - Veykril:configfix, r=Veykril

fix: Fix old config patching overwriting callable snippet config unconditionally

2 years agofix: Fix old config patching overwriting callable snippet config unconditionally
Lukas Wirth [Thu, 12 May 2022 15:55:25 +0000 (17:55 +0200)]
fix: Fix old config patching overwriting callable snippet config unconditionally

2 years agoAuto merge of #12226 - Veykril:reborrow-inlay-hints, r=Veykril
bors [Thu, 12 May 2022 12:21:06 +0000 (12:21 +0000)]
Auto merge of #12226 - Veykril:reborrow-inlay-hints, r=Veykril

feat: Allow reborrow inlay hints to be restricted to mutable reborrows only

2 years agofeat: Allow reborrow inlay hints to be restricted to mutable reborrows only
Lukas Wirth [Thu, 12 May 2022 11:39:32 +0000 (13:39 +0200)]
feat: Allow reborrow inlay hints to be restricted to mutable reborrows only

2 years agoAuto merge of #12224 - Veykril:anno-redundant, r=Veykril
bors [Thu, 12 May 2022 11:31:11 +0000 (11:31 +0000)]
Auto merge of #12224 - Veykril:anno-redundant, r=Veykril

internal: Remove redundant offset data in annotations

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

2 years agoAuto merge of #12225 - Veykril:tmapfloats, r=Veykril
bors [Thu, 12 May 2022 11:18:36 +0000 (11:18 +0000)]
Auto merge of #12225 - Veykril:tmapfloats, r=Veykril

internal: Add token mapping test for float literals

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

2 years agointernal: Add token mapping test for float literals
Lukas Wirth [Thu, 12 May 2022 11:17:53 +0000 (13:17 +0200)]
internal: Add token mapping test for float literals

2 years agointernal: Remove redundant offset data in annotations
Lukas Wirth [Thu, 12 May 2022 10:55:25 +0000 (12:55 +0200)]
internal: Remove redundant offset data in annotations

2 years agoAuto merge of #12215 - listochkin:Support-variable-substitution-in-vscode-settings...
bors [Thu, 12 May 2022 11:05:21 +0000 (11:05 +0000)]
Auto merge of #12215 - listochkin:Support-variable-substitution-in-vscode-settings, r=Veykril

feat: Support variable substitution in VSCode settings

Currently support a subset of [variables provided by VSCode](https://code.visualstudio.com/docs/editor/variables-reference) in `server.extraEnv` section of Rust-Analyzer settings:

  * `workspaceFolder`
  * `workspaceFolderBasename`
  * `cwd`
  * `execPath`
  * `pathSeparator`

Also, this PR adds support for general environment variables resolution. You can declare environment variables and reference them from other variables like this:

```JSON
"rust-analyzer.server.extraEnv": {
    "RUSTFLAGS": "-L${env:OPEN_XR_SDK_PATH}",
    "OPEN_XR_SDK_PATH": "${workspaceFolder}\\..\\OpenXR-SDK\\build\\src\\loader\\Release"
},
```
The order of variable declaration doesn't matter, you can reference variables before defining them. If the variable is not present in `extraEnv` section, VSCode will search for them in your environment. Missing variables will be replaced with empty string. Circular references won't be resolved and will be passed to rust-analyzer server process as is.

Closes #9626, but doesn't address use cases where people want to use values provided by `rustc` or `cargo`, such as `${targetTriple}` proposal #11649

2 years agoAuto merge of #12223 - Veykril:config-stuff, r=Veykril
bors [Thu, 12 May 2022 10:30:37 +0000 (10:30 +0000)]
Auto merge of #12223 - Veykril:config-stuff, r=Veykril

internal: Rename primeCaches config keys

2 years agointernal: Rename primeCaches config keys
Lukas Wirth [Thu, 12 May 2022 10:29:40 +0000 (12:29 +0200)]
internal: Rename primeCaches config keys

2 years agoAuto merge of #12220 - arzg:fix-character-semantic-token, r=arzg
bors [Thu, 12 May 2022 08:16:46 +0000 (08:16 +0000)]
Auto merge of #12220 - arzg:fix-character-semantic-token, r=arzg

Fix `character` semantic token type definition

The semantic token type for character literals is called `character`:

https://github.com/rust-lang/rust-analyzer/blob/94fa8a6534cf93276ad7e205026402f24d41a0b2/crates/rust-analyzer/src/semantic_tokens.rs#L51

and yet the definition in `package.json` uses `char`. In practice this means trying to highlight `char` doesn’t have any effect, while `character` doesn’t have any hover documentation and doesn’t appear in autocomplete. The definition also defines the fallback semantic token type as `type`; luckily since it currently references the non-existent `char` this doesn’t have any effect, since it doesn’t really make sense to highlight character literals as types.

This PR fixes the definition in `package.json` to correctly reference `character`, and also defines the fallback type as `number`. I’d say character literals are closer to a shorthand for writing a number than a string, though this is debatable and I’d be happy to change it to `string`, or anything else.

2 years agoFix `character` semantic token type definition
Luna Razzaghipour [Thu, 12 May 2022 07:19:41 +0000 (17:19 +1000)]
Fix `character` semantic token type definition

2 years agoEnable variable substitutions before passing them over to R-A server
Andrei Listochkin [Wed, 11 May 2022 12:37:40 +0000 (13:37 +0100)]
Enable variable substitutions before passing them over to R-A server

2 years agoVSCode variables support for substitutions
Andrei Listochkin [Wed, 11 May 2022 12:34:43 +0000 (13:34 +0100)]
VSCode variables support for substitutions

Tests now open Rust-Analyzer extension code in order to populate
VSCode variables.

2 years agohandle references to external environment variables
Andrei Listochkin [Wed, 11 May 2022 12:28:08 +0000 (13:28 +0100)]
handle references to external environment variables

use cross-env to enable env variables on Windows

2 years agoiterative dependency solver
Andrei Listochkin [Wed, 11 May 2022 12:22:58 +0000 (13:22 +0100)]
iterative dependency solver

First, we go through every environment variable key and record all cases
where there are reference to other variables / dependencies.

We track two sets of variables - resolved and yet-to-be-resolved.
We pass over a list of variables over and over again and when all
variable's dependencies were resolved during previous passes we perform
a replacement for that variable, too.

Over time the size of `toResolve` set should go down to zero, however
circular dependencies may prevent that. We track the size of `toResolve`
between iterations to avoid infinite looping.

At the end we produce an object of the same size and shape as
the original, but with the values replace with resolved versions.

2 years agosearch for test files instead of explicitly name them
Andrei Listochkin [Wed, 11 May 2022 11:01:34 +0000 (12:01 +0100)]
search for test files instead of explicitly name them

2 years agoAuto merge of #12213 - Veykril:config-fix, r=Veykril
bors [Wed, 11 May 2022 10:38:56 +0000 (10:38 +0000)]
Auto merge of #12213 - Veykril:config-fix, r=Veykril

fix: Fix incorrect config patching for runBuildScripts

2 years agofix: Fix incorrect config patching for runBuildScripts
Lukas Wirth [Wed, 11 May 2022 10:33:56 +0000 (12:33 +0200)]
fix: Fix incorrect config patching for runBuildScripts

2 years agoAuto merge of #12212 - Elliot-Roberts:hint_typo, r=lnicola
bors [Wed, 11 May 2022 07:26:28 +0000 (07:26 +0000)]
Auto merge of #12212 - Elliot-Roberts:hint_typo, r=lnicola

Fix a typo in the `inlayHints.renderColons` option description

The description said the same thing twice: "trailing colons for parameter hints, and trailing colons for parameter hints".
I'm assuming one of those is supposed to be about the leading colon for type hints.

Also, I wasn't sure how to regenerate the generated file(s?) so I just manually updated them. Hopefully that isn't a problem. If how to do that is in the documentation somewhere I'd love to know.

2 years agofix typo in `inlayHints.renderColons` option description
Elliot Roberts [Wed, 11 May 2022 02:15:07 +0000 (19:15 -0700)]
fix typo in `inlayHints.renderColons` option description

2 years agoAuto merge of #12209 - Veykril:config-fix, r=Veykril
bors [Tue, 10 May 2022 19:15:06 +0000 (19:15 +0000)]
Auto merge of #12209 - Veykril:config-fix, r=Veykril

fix: Fix config patching failing when appending suffixes

2 years agofix: Fix config patching failing when appending suffixes
Lukas Wirth [Tue, 10 May 2022 19:14:22 +0000 (21:14 +0200)]
fix: Fix config patching failing when appending suffixes

2 years agoAuto merge of #12208 - jonas-schievink:assoc-ty-signature-info, r=jonas-schievink
bors [Tue, 10 May 2022 14:55:59 +0000 (14:55 +0000)]
Auto merge of #12208 - jonas-schievink:assoc-ty-signature-info, r=jonas-schievink

feat: include associated types in trait signature help

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

![screenshot-2022-05-10-16:55:19](https://user-images.githubusercontent.com/1786438/167658642-8df42fba-523a-46fe-a0f6-e0e041b3659d.png)

2 years agoInclude assoc. types in trait signature help
Jonas Schievink [Tue, 10 May 2022 14:54:31 +0000 (16:54 +0200)]
Include assoc. types in trait signature help

2 years agoFix inverted signature help setting
Jonas Schievink [Tue, 10 May 2022 14:54:13 +0000 (16:54 +0200)]
Fix inverted signature help setting

2 years agoAuto merge of #12204 - Veykril:completions, r=Veykril
bors [Tue, 10 May 2022 13:08:27 +0000 (13:08 +0000)]
Auto merge of #12204 - Veykril:completions, r=Veykril

internal: Move keyword expressions to expr completions module

2 years agoMove keyword expressions to expr completions module
Lukas Wirth [Tue, 10 May 2022 13:00:58 +0000 (15:00 +0200)]
Move keyword expressions to expr completions module

2 years agoAuto merge of #12203 - Veykril:completions, r=Veykril
bors [Tue, 10 May 2022 12:36:46 +0000 (12:36 +0000)]
Auto merge of #12203 - Veykril:completions, r=Veykril

internal: Simplify

2 years agoDon't parse files in module completion
Lukas Wirth [Tue, 10 May 2022 12:31:43 +0000 (14:31 +0200)]
Don't parse files in module completion

2 years agoSimplify
Lukas Wirth [Tue, 10 May 2022 12:31:28 +0000 (14:31 +0200)]
Simplify

2 years agoAuto merge of #12202 - iDawer:ide.sig_help-fix, r=lnicola
bors [Tue, 10 May 2022 12:28:34 +0000 (12:28 +0000)]
Auto merge of #12202 - iDawer:ide.sig_help-fix, r=lnicola

fix: don't panic at fully qualified call syntax in signature help

Closes  #12200
Regressed from #12082

2 years ago`signature_help`: detect fully qualified call syntax for parameter fallback
iDawer [Tue, 10 May 2022 12:18:42 +0000 (17:18 +0500)]
`signature_help`: detect fully qualified call syntax for parameter fallback

2 years agoAuto merge of #12010 - Veykril:r-a-config, r=Veykril
bors [Tue, 10 May 2022 12:07:24 +0000 (12:07 +0000)]
Auto merge of #12010 - Veykril:r-a-config, r=Veykril

Config revamp

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

This PR changes a lot of config names, and a few ones are being merged or split apart. The reason for this is that our configuration names currently are rather inconsistent and some where poorly chosen in regards to extensability. This PR plans to fix that.

We still allow the old config names by patching them to the new ones before deserializing to keep backwards compatability with other clients (the VSCode client will auto update the config) but ideally we will get rid of that layer in the future.

Here is a list of the changes:

These are simple renames `old_name | alias1 | alias2 ... -> new_name` (the vscode client will fix these up automagically):
```
assist_allowMergingIntoGlobImports -> imports_merge_glob
assist_exprFillDefault -> assist_expressionFillDefault
assist_importEnforceGranularity -> imports_granularity_enforce
assist_importGranularity | assist_importMergeBehavior | assist_importMergeBehaviour -> imports_granularity_group
assist_importGroup -> imports_group_enable
assist_importPrefix -> imports_prefix

cache_warmup -> primeCaches_enable

cargo_loadOutDirsFromCheck -> cargo_buildScripts_enable
cargo_runBuildScripts | cargo_runBuildScriptsCommand -> cargo_runBuildScripts_overrideCommand
cargo_useRustcWrapperForBuildScripts -> cargo_runBuildScripts_useRustcWrapper

completion_snippets -> completion_snippets_custom

diagnostics_enableExperimental -> diagnostics_experimental_enable

experimental_procAttrMacros -> procMacro_attributes_enable

highlighting_strings -> semanticHighlighting_strings_enable

highlightRelated_breakPoints -> semanticHighlighting_breakPoints_enable
highlightRelated_exitPoints -> semanticHighlighting_exitPoints_enable
highlightRelated_yieldPoints -> semanticHighlighting_yieldPoints_enable
highlightRelated_references -> semanticHighlighting_references_enable

hover_documentation -> hover_documentation_enable
hover_linksInHover | hoverActions_linksInHover -> hover_links_enable
hoverActions_debug -> hoverActions_debug_enable
hoverActions_enable -> hoverActions_enable_enable
hoverActions_gotoTypeDef -> hoverActions_gotoTypeDef_enable
hoverActions_implementations -> hoverActions_implementations_enable
hoverActions_references -> hoverActions_references_enable
hoverActions_run -> hoverActions_run_enable

inlayHints_chainingHints -> inlayHints_chainingHints_enable
inlayHints_closureReturnTypeHints -> inlayHints_closureReturnTypeHints_enable
inlayHints_hideNamedConstructorHints -> inlayHints_typeHints_hideNamedConstructorHints
inlayHints_parameterHints -> inlayHints_parameterHints_enable
inlayHints_reborrowHints -> inlayHints_reborrowHints_enable
inlayHints_typeHints -> inlayHints_typeHints_enable

lruCapacity -> lru_capacity

runnables_cargoExtraArgs -> runnables_extraArgs
runnables_overrideCargo -> runnables_command

rustcSource -> rustc_source

rustfmt_enableRangeFormatting -> rustfmt_rangeFormatting_enable
```

These are configs that have been merged or split apart, which have to be manually updated by the user:

```
callInfo_full -> signatureInfo_detail, signatureInfo_documentation_enable

cargo_allFeatures, cargo_features -> cargo_features
checkOnSave_allFeatures, checkOnSave_features -> checkOnSave_features
completion_addCallArgumentSnippets completion_addCallParenthesis -> completion_callable_snippets
```

2 years agoAuto merge of #12201 - Veykril:inlay-hide, r=Veykril
bors [Tue, 10 May 2022 11:44:06 +0000 (11:44 +0000)]
Auto merge of #12201 - Veykril:inlay-hide, r=Veykril

fix: Add cast expressions to param name inlay hint heuristics

2 years agofix: Add cast expressions to param name inlay hint heuristics
Lukas Wirth [Tue, 10 May 2022 11:43:43 +0000 (13:43 +0200)]
fix: Add cast expressions to param name inlay hint heuristics

2 years agoAuto merge of #12199 - jonas-schievink:no-invalid-assoc-ty-completions, r=jonas-schievink
bors [Mon, 9 May 2022 16:12:47 +0000 (16:12 +0000)]
Auto merge of #12199 - jonas-schievink:no-invalid-assoc-ty-completions, r=jonas-schievink

fix: Don't show assoc. type binding completions when invalid

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

2 years agoDon't show assoc. type binding completions when invalid
Jonas Schievink [Mon, 9 May 2022 16:12:12 +0000 (18:12 +0200)]
Don't show assoc. type binding completions when invalid

2 years agoAuto merge of #12198 - jonas-schievink:ide-resolve-supertrait-assoc-types, r=jonas...
bors [Mon, 9 May 2022 15:40:45 +0000 (15:40 +0000)]
Auto merge of #12198 - jonas-schievink:ide-resolve-supertrait-assoc-types, r=jonas-schievink

fix: Resolve assoc. types of supertraits in the IDE layer

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

2 years agoMake completion work too
Jonas Schievink [Mon, 9 May 2022 15:39:13 +0000 (17:39 +0200)]
Make completion work too

2 years agoResolve assoc. types of supertraits in the IDE layer
Jonas Schievink [Mon, 9 May 2022 15:30:49 +0000 (17:30 +0200)]
Resolve assoc. types of supertraits in the IDE layer

2 years agoAuto merge of #12197 - Veykril:insert-use-fix, r=Veykril
bors [Mon, 9 May 2022 10:13:08 +0000 (10:13 +0000)]
Auto merge of #12197 - Veykril:insert-use-fix, r=Veykril

fix: Fix import insertion inserting after last comment in a file

2 years agofix: Fix import insertion inserting after last comment in a file
Lukas Wirth [Mon, 9 May 2022 09:52:49 +0000 (11:52 +0200)]
fix: Fix import insertion inserting after last comment in a file

2 years agoAuto merge of #11983 - jhpratt:remove-rustc_deprecated, r=lnicola
bors [Mon, 9 May 2022 08:33:18 +0000 (08:33 +0000)]
Auto merge of #11983 - jhpratt:remove-rustc_deprecated, r=lnicola

Remove handling of `#[rustc_deprecated]`

This should be merged along with rust-lang/rust#95960.

Because the attribute still exists in rustc, I've left the definition here. With that said, any use of it is an error, so I've removed any handling of `#[rustc_deprecated]`.