]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoAuto merge of #12301 - harpsword:fix_for_crlf_cargo_range_map, r=jonas-schievink
bors [Fri, 20 May 2022 12:15:22 +0000 (12:15 +0000)]
Auto merge of #12301 - harpsword:fix_for_crlf_cargo_range_map, r=jonas-schievink

fix: calculate correct postion for Dos line ending in mapping rustc range to ls…

fix #12293

2 years agoAuto merge of #12320 - NotWearingPants:patch-1, r=Veykril
bors [Thu, 19 May 2022 23:57:37 +0000 (23:57 +0000)]
Auto merge of #12320 - NotWearingPants:patch-1, r=Veykril

Hide closure ret hints if ret type is specified

Fixes #12319

2 years agohide closure ret hints if ret type is specified
NotWearingPants [Thu, 19 May 2022 23:35:37 +0000 (02:35 +0300)]
hide closure ret hints if ret type is specified

fixes #12319

2 years agoAuto merge of #12316 - jonas-schievink:closure-param-hints, r=jonas-schievink
bors [Thu, 19 May 2022 16:54:09 +0000 (16:54 +0000)]
Auto merge of #12316 - jonas-schievink:closure-param-hints, r=jonas-schievink

feat: Show parameter inlay hints for closure invocations

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

2 years agoTeach `Callable` about closures properly
Jonas Schievink [Thu, 19 May 2022 16:53:08 +0000 (18:53 +0200)]
Teach `Callable` about closures properly

2 years agoAuto merge of #12314 - jonas-schievink:proc-macro-load, r=jonas-schievink
bors [Thu, 19 May 2022 14:50:08 +0000 (14:50 +0000)]
Auto merge of #12314 - jonas-schievink:proc-macro-load, r=jonas-schievink

minor: simplify

2 years agoAuto merge of #12313 - equinox:typo-fix, r=lnicola
bors [Thu, 19 May 2022 14:22:09 +0000 (14:22 +0000)]
Auto merge of #12313 - equinox:typo-fix, r=lnicola

Removed duplicate 'to' in `cachePriming.numThreads` option description

One 'to' too many!

2 years agoremove duplicate 'to' in `cachePriming.numThreads` option description
Equinox [Thu, 19 May 2022 14:04:02 +0000 (02:04 +1200)]
remove duplicate 'to' in `cachePriming.numThreads` option description

2 years agoAuto merge of #12311 - Veykril:inlay-hints-tips, r=Veykril
bors [Thu, 19 May 2022 13:45:05 +0000 (13:45 +0000)]
Auto merge of #12311 - Veykril:inlay-hints-tips, r=Veykril

internal: Improve inlay hint tooltips

2 years agoHide more unnecessary parameter hints for constructors
Lukas Wirth [Thu, 19 May 2022 13:33:04 +0000 (15:33 +0200)]
Hide more unnecessary parameter hints for constructors

2 years agosimplify
Jonas Schievink [Thu, 19 May 2022 13:29:35 +0000 (15:29 +0200)]
simplify

2 years agoUpdate test fixtures
Lukas Wirth [Thu, 19 May 2022 13:20:45 +0000 (15:20 +0200)]
Update test fixtures

2 years agoEnable hovering function parameter inlay hints
Lukas Wirth [Thu, 19 May 2022 12:32:09 +0000 (14:32 +0200)]
Enable hovering function parameter inlay hints

2 years agointernal: Improve inlay hint tooltips
Lukas Wirth [Thu, 19 May 2022 11:38:37 +0000 (13:38 +0200)]
internal: Improve inlay hint tooltips

2 years agoAuto merge of #12309 - Veykril:completion, r=Veykril
bors [Thu, 19 May 2022 10:34:36 +0000 (10:34 +0000)]
Auto merge of #12309 - Veykril:completion, r=Veykril

fix: Fix incorrect expected type in completions for trailing match arms

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

2 years agofix: Fix incorrect expected type in completions for match arms
Lukas Wirth [Thu, 19 May 2022 10:27:43 +0000 (12:27 +0200)]
fix: Fix incorrect expected type in completions for match arms

2 years agoAuto merge of #12304 - jonas-schievink:more-doc-gen-improvements, r=jonas-schievink
bors [Wed, 18 May 2022 17:22:20 +0000 (17:22 +0000)]
Auto merge of #12304 - jonas-schievink:more-doc-gen-improvements, r=jonas-schievink

minor: Include self type in generated getter/setter docs

2 years agoInclude self type in generated getter/setter docs
Jonas Schievink [Wed, 18 May 2022 16:38:41 +0000 (18:38 +0200)]
Include self type in generated getter/setter docs

2 years agoAuto merge of #12303 - jonas-schievink:improve-generate-docs-assist, r=jonas-schievink
bors [Wed, 18 May 2022 16:09:02 +0000 (16:09 +0000)]
Auto merge of #12303 - jonas-schievink:improve-generate-docs-assist, r=jonas-schievink

feat: Improve docs generation assist

- Split into 2 assists: one generates basic docs structure, but no example, one generates an example
- Fix section ordering (the example comes last)
- Allow generating docs for private functions
- Expand `len` to `length` when generating an intro sentence

2 years agoImprove docs generation assist
Jonas Schievink [Wed, 18 May 2022 16:05:21 +0000 (18:05 +0200)]
Improve docs generation assist

2 years agoAuto merge of #12277 - listochkin:show-implementations-display-error, r=listochkin
bors [Wed, 18 May 2022 13:13:09 +0000 (13:13 +0000)]
Auto merge of #12277 - listochkin:show-implementations-display-error, r=listochkin

"Show implementations" link display error fix

While VSCode [uses it's own implementation for URIs](https://github.com/microsoft/vscode-uri)
which notably doesn't have any limits of URI size, the renderer itself
relies on Web platform engine, that limits the length of the URLs and
bails out when the attribute length of an `href` inside `a` tag is too
long.

Command URIs have a form of `command:command-name?arguments`, where
`arguments` is a percent-encoded array of data we want to pass along to
the command function. For "Show References" this is a list of all file
URIs with locations of every reference, and it can get quite long.

This PR introduces another intermediary `linkToCommand` command. When
we render a command link, a reference to a command with all its arguments
is stored in a map, and instead a `linkToCommand` link is rendered
with the key to that map.

For now the map is cleaned up periodically (I've set it to every
10 minutes). In general case we'll probably need to introduce TTLs or
flags to denote ephemeral links (like these in hover popups) and
persistent links and clean those separately. But for now simply keeping
the last few links in the map should be good enough. Likewise, we could
add code to remove a target command from the map after the link is
clicked, but assuming most links in hover sheets won't be clicked anyway
this code won't change the overall memory use much.

Closes #9926

2 years ago"Show implementations" link display error fix
Andrei Listochkin [Mon, 16 May 2022 18:53:00 +0000 (19:53 +0100)]
"Show implementations" link display error fix

While VSCode [uses it's own implementation for URIs](https://github.com/microsoft/vscode-uri)
which notably doesn't have any limits of URI size, the renderer itself
relies on Web platform engine, that limits the length of the URLs and
bails out when the attribute length of an `href` inside `a` tag is too
long.

Command URIs have a form of `command:command-name?arguments`, where
`arguments` is a percent-encoded array of data we want to pass along to
the command function. For "Show References" this is a list of all file
URIs with locations of every reference, and it can get quite long.

This PR introduces another intermediary `linkToCommand` command. When
we render a command link, a reference to a command with all its arguments
is stored in a map, and instead a `linkToCommand` link is rendered
with the key to that map.

For now the map is cleaned up periodically (I've set it to every
10 minutes). In general case we'll probably need to introduce TTLs or
flags to denote ephemeral links (like these in hover popups) and
persistent links and clean those separately. But for now simply keeping
the last few links in the map should be good enough. Likewise, we could
add code to remove a target command from the map after the link is
clicked, but assuming most links in hover sheets won't be clicked anyway
this code won't change the overall memory use much.

Closes #9926

2 years agofix: calculate right range for Dos line ending in mapping rustc range to lsp range
harpsword [Wed, 18 May 2022 10:35:51 +0000 (18:35 +0800)]
fix: calculate right range for Dos line ending in mapping rustc range to lsp range

2 years agoAuto merge of #12130 - weirane:let-else-let-match, r=weirane
bors [Tue, 17 May 2022 19:01:18 +0000 (19:01 +0000)]
Auto merge of #12130 - weirane:let-else-let-match, r=weirane

Turn let-else statements into let and match

Fixes #11906.

2 years agoAuto merge of #12294 - listochkin:prettier, r=Veykril
bors [Tue, 17 May 2022 18:50:00 +0000 (18:50 +0000)]
Auto merge of #12294 - listochkin:prettier, r=Veykril

Switch to Prettier for TypeScript Code formatting

## Summary of changes:

 1. Added [`.editorconfig` file](https://editorconfig.org) to dictate general hygienic stuff like character encoding, no trailing whitespace, new line symbols etc. for all files (e.g. Markdown). Install an editor plugin to get this rudimentary formatting assistance automatically. Prettier can read this file and, for example, use it for indentation style and size.
 2. Added a minimal prettier config file. All options are default except line width, which per [Veykril](https://github.com/Veykril) suggestion is set to 100 instead of 80, because [that's what `Rustfmt` uses](https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#max_width).
 3. Change `package.json` to use Prettier instead of `tsfmt` for code formatting.
 4. Performed initial formatting in a separate commit, per [bjorn3](https://github.com/bjorn3) suggestion added its hash to a `.git-blame-ignore-revs` file. For it to work you need to add a configuration to your git installation:
    ```Shell
    git config --global blame.ignoreRevsFile .git-blame-ignore-revs
    ```
 5. Finally, removed `typescript-formatter` from the list of dependencies.

----
What follows below is summary of the discussion we had on Zulip about the formatter switch:

## Background

For the context, there are three reasons why we went with `tsfmt` originally:
* stick to vscode default/built-in
* don't add extra deps to package.json.lock
* follow upstream (language server node I think still uses `tsfmt`)

And the meta reason here was that we didn't have anyone familiar with frontend, so went for the simplest option, at the expense of features and convenience.

Meanwhile, [**Prettier**](https://prettier.io) became a formatter project that JS community consolidated on a few years ago. It's similar to `go fmt` / `cargo fmt` in spirit: minimal to no configuration to promote general uniformity in the ecosystem. There are some options, that were needed early on to make sure the project gained momentum, but by no means it's a customizable formatter that is easy to adjust to reduce the number of changes for adoption.

## Overview of changes performed by Prettier

Some of the changes are acceptable. Prettier dictates a unified string quoting style, and as a result half of our imports at the top are changed. No one would mind that. Some one-line changes are due to string quotes, too, and although these a re numerous, the surrounding lines aren't changed, and git blame / GitLens will still show relevant context.

Some are toss ups. `trailingComma` option - set it to `none`, and get a bunch of meaningless changes in half of the code. set it to `all` and get a bunch of changes in the other half of the code. Same with using parentheses around single parameters in arrow functions: `x => x + 1` vs `(x) => x + 1`. Perrier forces one style or the other, but we use both in our code.

Like I said, the changes above are Ok - they take a single line, don't disrupt GitLens / git blame much. **The big one is line width**. Prettier wants you to choose one and stick to it. The default is 80 and it forces some reformatting to squish deeply nested code or long function type declarations. If I set it to 100-120, then Prettier finds other parts of code where a multi-line expression can be smashed into a single long line. The problem is that in both cases some of the lines that get changed are interesting, they contain somewhat non-trivial logic, and if I were to work on them in future I would love to see the commit annotations that tell me something relevant. Alas, we use some of that.

## Project impact

Though Prettier is a mainstream JS project it has no dependencies. We add another package so that it and ESLint work together nicely, and that's it.

2 years agoSimplify const reference check
weirane [Tue, 17 May 2022 18:38:50 +0000 (02:38 +0800)]
Simplify const reference check

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoAuto merge of #12296 - jonas-schievink:add-attribute-assist, r=jonas-schievink
bors [Tue, 17 May 2022 18:30:26 +0000 (18:30 +0000)]
Auto merge of #12296 - jonas-schievink:add-attribute-assist, r=jonas-schievink

feat: add a "Add attribute" assist

This generalizes the "Add `#[derive]`" assist and supports adding `#[must_use]` and `#[inline]`.

Removes `#[must_use]` from the "Generate getter/setter" assist, addressing the last point in https://github.com/rust-lang/rust-analyzer/issues/12273. Closes https://github.com/rust-lang/rust-analyzer/issues/12273.

2 years agoAdd a "Add attribute" assist
Jonas Schievink [Tue, 17 May 2022 18:28:25 +0000 (20:28 +0200)]
Add a "Add attribute" assist

2 years agoautomate braceless return substitution for long lines
Andrei Listochkin [Tue, 17 May 2022 17:31:51 +0000 (18:31 +0100)]
automate braceless return substitution for long lines

Per [bjorn3][https://github.com/bjorn3] suggestion resolves cases where
an early return is moved to a separate line due to line width formatting.

This setting changes
```
if (a very long condition) return;
```
to
```
if (a very long
    condition) {
  return;
}
```
while keeping
```
if (short) return;
```
as is.

In pathological cases this may cause `npm run fix` not to fix formatting
in one go and may require running it twice.

2 years agoremove tsfmt from dependencies
Andrei Listochkin [Tue, 17 May 2022 15:33:58 +0000 (16:33 +0100)]
remove tsfmt from dependencies

2 years agoadd prettier format commit to ignored revisions
Andrei Listochkin [Tue, 17 May 2022 15:29:01 +0000 (16:29 +0100)]
add prettier format commit to ignored revisions

2 years agoprettier run
Andrei Listochkin [Tue, 17 May 2022 17:15:06 +0000 (18:15 +0100)]
prettier run

2 years agouse prettier to format the code
Andrei Listochkin [Tue, 17 May 2022 15:07:30 +0000 (16:07 +0100)]
use prettier to format the code

2 years agoprettier config
Andrei Listochkin [Wed, 11 May 2022 17:19:45 +0000 (18:19 +0100)]
prettier config

[Prettier][1] is an up-to date code formatter for JavaScript ecosystem.

For settings we rely on [EditorConfig][2] for things like tab style and
size (with added bonus that the code editor with an EditorConfig plugin
does some automated code formatting on file save for you). Unfortunately,
Prettier's Glob handling isn't great:
 1. `*.{ts,js,json}` has no effect
 2. Similarly, in a list of globs `*.ts,*.js,*.json` only the first glob
has an effect, the rest are ignored.
That's why the file looks the way it does.

The only other setting we change is line width. [Lukas][3] suggested we
use 100 instead of 80, because that's what Rustfmt is using.

[1]: https://prettier.io
[2]: https://editorconfig.org
[3]: https://github.com/Veykril

2 years agoAuto merge of #12292 - jonas-schievink:bump-extension-version, r=jonas-schievink
bors [Tue, 17 May 2022 14:03:08 +0000 (14:03 +0000)]
Auto merge of #12292 - jonas-schievink:bump-extension-version, r=jonas-schievink

internal: Bump extension version

2 years agoBump extension version
Jonas Schievink [Tue, 17 May 2022 14:02:07 +0000 (16:02 +0200)]
Bump extension version

2 years agoAuto merge of #12285 - Veykril:inlay-hints, r=Veykril
bors [Tue, 17 May 2022 13:11:40 +0000 (13:11 +0000)]
Auto merge of #12285 - Veykril:inlay-hints, r=Veykril

feat: Implement inlay hint tooltips

Currently this just delegates to hover request for some things, and otherwise fallsback to the label.
![image](https://user-images.githubusercontent.com/3757771/168816520-e015726f-53e1-4dac-a76e-8f1312f145d7.png)
![image](https://user-images.githubusercontent.com/3757771/168802753-43749b75-866c-40db-b106-aeaa542b87a3.png)
![image](https://user-images.githubusercontent.com/3757771/168816579-da2050f0-f198-4b3a-a9a1-53199fcaab61.png)
![image](https://user-images.githubusercontent.com/3757771/168818804-d4400ffe-0e6c-48a0-a872-f054e5f550fa.png)

2 years agoUpdate test output
Lukas Wirth [Tue, 17 May 2022 12:58:26 +0000 (14:58 +0200)]
Update test output

2 years agoAuto merge of #12289 - rust-lang:Veykril-patch-1, r=Veykril
bors [Tue, 17 May 2022 12:56:25 +0000 (12:56 +0000)]
Auto merge of #12289 - rust-lang:Veykril-patch-1, r=Veykril

fix: Fix incorrect config key in client config update

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

2 years agoFix incorrect config key in client config update
Lukas Wirth [Tue, 17 May 2022 12:56:08 +0000 (14:56 +0200)]
Fix incorrect config key in client config update

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

2 years agoUpdate lsp-extensions hash
Lukas Wirth [Tue, 17 May 2022 12:48:28 +0000 (14:48 +0200)]
Update lsp-extensions hash

2 years agoAllow inlay hint tooltips to trigger hovers
Lukas Wirth [Tue, 17 May 2022 12:46:43 +0000 (14:46 +0200)]
Allow inlay hint tooltips to trigger hovers

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 agoAuto merge of #12284 - Veykril:inlay-hints, r=Veykril
bors [Tue, 17 May 2022 10:19:14 +0000 (10:19 +0000)]
Auto merge of #12284 - Veykril:inlay-hints, r=Veykril

internal: Cleanup lifetime elision hints

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