Commit Graph

16797 Commits

Author SHA1 Message Date
Jonas Schievink
cb8632d87c Parse const param defaults 2021-04-29 03:07:53 +02:00
bors[bot]
9d199486da
Merge #8684
8684: Correctly parse negated literals as const args r=jonas-schievink a=jonas-schievink

Previously we didn't accept `S::<-0>;`

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-04-29 00:28:27 +00:00
Jonas Schievink
caee3a2eeb Correctly parse negated literals as const args 2021-04-29 02:27:55 +02:00
bors[bot]
49b219b103
Merge #8683
8683: internal: ensure that client and server-side configs are not mixed up r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-04-28 10:13:52 +00:00
Aleksey Kladov
5c1a901035 internal: ensure that client and server-side configs are not mixed up
https://github.com/rust-lang/rust/issues/84647 would help big time here.
2021-04-28 13:13:30 +03:00
bors[bot]
fb45d2adec
Merge #8624
8624: Automatically detect rust library source file map  r=vsrs a=vsrs

This PR adds a new possible `rust-analyzer.debug.sourceFileMap` value:
```json
{
    "rust-analyzer.debug.sourceFileMap": "auto"
}
```

I did not make it the default because it uses two shell calls (`rustc --print sysroot` and `rustc -V -v`). First one can be slow (https://github.com/rust-lang/rustup/issues/783)

Fixes #8619

Co-authored-by: vsrs <vit@conrlab.com>
2021-04-27 20:41:35 +00:00
bors[bot]
e2b87735cc
Merge #8629 #8657
8629: Allow pressing | to surround closure arguments in VSCode r=matklad a=Smittyvb

This makes pressing <kbd>|</kbd> while some text is selected surround that text with pipes. This is useful when writing closures. 

In this demo, I press <kbd>|</kbd> to easily surround some text (`predicate`) with pipe characters to create a closure. Before, this would have replaced `predicate` with just `|`.

![](https://user-images.githubusercontent.com/10530973/115778847-3c257e00-a385-11eb-8c80-e0db970747db.gif)

(I am getting failures when I do `cargo test` even on `master` locally (due to #8585 I think), but GH Actions is fine with this)

8657: npm update r=matklad a=kjeremy



Co-authored-by: Smittyvb <me@smitop.com>
Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2021-04-27 13:22:09 +00:00
bors[bot]
86b5084917
Merge #8679
8679: fix: don't show error message for a valid notification r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-04-27 13:10:22 +00:00
Aleksey Kladov
f45c1ffc5b fix: don't show error message for a valid notification
Closes #6782, #6772
2021-04-27 16:09:59 +03:00
bors[bot]
ef7253c6df
Merge #8677
8677: Return ServerNotInitialized according to the spec r=kjeremy a=kjeremy

According to the spec we should return ServerNotInitialized if the server is waiting for an initialize request and something else comes in.
Upgrading to lsp-server 0.5.1 will do this and retry until the initialize request comes in.

Fixes #8581

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2021-04-27 11:51:03 +00:00
Jeremy Kolb
36c20dc23d Return ServerNotInitialized according to the spec
According to the spec we should return ServerNotInitialized if the server is waiting for an initialize request and something else comes in.
Upgrading to lsp-server 0.5.1 will do this and retry until the initialize request comes in.

Fixes #8581
2021-04-27 07:47:06 -04:00
bors[bot]
4af50de0ab
Merge #8617
8617: Add option to opt out of smaller font size for inlay hints. r=SomeoneToIgnore a=jmederosalvarado

As requested on issue #6883 this PR provides an option for users to opt out of the smaller font size for inlay hints. Part of #6883.

Co-authored-by: Jorge Mederos Alvarado <jmederosalvarado@gmail.com>
2021-04-27 08:31:35 +00:00
Jorge Mederos Alvarado
0230f22d2a Fix how and when old inlay hint decorations are disposed 2021-04-26 20:29:54 -04:00
Jorge Mederos Alvarado
c4dba4077f Add config options 2021-04-26 20:29:54 -04:00
Jorge Mederos Alvarado
9e5ef0ce72 Add option to opt out from smaller inlay hints font size 2021-04-26 20:29:54 -04:00
Jorge Mederos Alvarado
a2ba0f4846 add option to package.json 2021-04-26 20:29:54 -04:00
bors[bot]
c5364ffde1
Merge #8671
8671: minor: simplify r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-04-26 16:31:19 +00:00
Aleksey Kladov
f06e4b8e74 minor: simplify 2021-04-26 19:30:50 +03:00
bors[bot]
7e10df9df9
Merge #8670
8670: fix: make error message in the status bar more useful r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-04-26 16:18:02 +00:00
Aleksey Kladov
363cef5c0e fix: make error message in the status bar more useful
At the moment,the popup is just a bazillion of Cargo's "Compiling this\nCompiling that",
which is not that useful.

--quiet still displays error, which is what we needc
2021-04-26 19:16:07 +03:00
bors[bot]
6cd669e880
Merge #8668
8668: Use more cross-platform utc `date` argument r=matklad a=SomeoneToIgnore

Part of https://github.com/rust-analyzer/rust-analyzer/issues/8571

```
$ docker run -it --rm ubuntu:20.04 bash
root@7393d1e7bbad:/# date -u +%Y-%m-%d
2021-04-26
```

```
$ date -u +%Y-%m-%d
2021-04-26

$ uname -a
Darwin alaptop.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64
```

Some of the places where I've change this do not really require it (since macos bin would have failed with `--iso` param also), but I've changed them for consistency.

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2021-04-26 14:17:05 +00:00
Kirill Bulatov
c24bdab97e Use -u instead of --utc date flag 2021-04-26 17:12:13 +03:00
bors[bot]
eee50b6921
Merge #8666
8666: fix: correct version string on windows and mac r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-04-26 12:27:35 +00:00
Aleksey Kladov
4f9640ff39 fix: add date to the version string on Mac
It doesn't support `--iso`
2021-04-26 15:20:15 +03:00
Aleksey Kladov
869ec5f97a fix: dont' misundentify nightly as stable in --version on Mac&Win
We used to set `--nightly` in CI, and only for linux. Let's detect this
in xtask instead.
2021-04-26 15:17:02 +03:00
bors[bot]
691c96e36a
Merge #8661
8661: internal: make normal release after a poin release less annoying r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-04-26 10:49:40 +00:00
Aleksey Kladov
26dfb6b9d0
Update xtask/src/release.rs
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
2021-04-26 13:49:19 +03:00
Aleksey Kladov
1745207a08
Update xtask/src/release.rs
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
2021-04-26 13:49:14 +03:00
Aleksey Kladov
7bb9c147c0 internal: make normal release after a poin release less annoying 2021-04-26 13:41:34 +03:00
bors[bot]
3209ddacd5
Merge #8660
8660: Added `mutable` semantic token modifier for `&mut self` methods r=Veykril a=1c3t3a

This closes #8644.

Co-authored-by: Bastian Kersting <bastian@cmbt.de>
2021-04-26 09:39:15 +00:00
Bastian Kersting
421cf9a1bd Fixed formatting 2021-04-26 11:37:28 +02:00
Bastian Kersting
336b81abd7 Added mutable semantic token modifier for &mut self methods 2021-04-26 09:24:18 +02:00
bors[bot]
617535393b
Merge #8658
8658: Check more carefully for cases where a rename can't be done r=Veykril a=dzhu

Attempting to rename an element of a tuple field would previously replace the type with the new name, which doesn't make sense; now it fails instead.

The check is done in both `prepare_rename` and `rename` so that the case is caught before the user is prompted for a new name. Some other existing failure cases are also now additionally checked in `prepare_rename`.

Closes: #8592

(I threw in some doc edits for a relevant type; of course, I can remove those if the policy here is to be strict about scope of changes within a PR.)

Co-authored-by: Danny Zhu <dzhu@dzhu.us>
2021-04-25 21:18:57 +00:00
Danny Zhu
09fc5e1dd7 Check more carefully for cases where a rename can't be done
Attempting to rename an element of a tuple field would previously
replace the type with the new name, which doesn't make sense; now it
fails instead.

The check is done in both `prepare_rename` and `rename` so that the case
is caught before the user is prompted for a new name. Some other
existing failure cases are also now additionally checked in
`prepare_rename`.
2021-04-25 14:08:56 -07:00
Jeremy Kolb
1c927650f7 npm update 2021-04-25 16:16:01 -04:00
bors[bot]
d8578bf9bf
Merge #8656
8656: Update deps r=kjeremy a=kjeremy



Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2021-04-25 19:44:47 +00:00
Jeremy Kolb
321aa9eb92 Update deps 2021-04-25 15:43:42 -04:00
bors[bot]
1b4defd240
Merge #8647
8647: internal: Split out merge_imports module from helpers::insert_use r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-04-24 11:39:50 +00:00
Lukas Wirth
050c69c19d Split out merge_imports module from helpers::insert_use 2021-04-24 13:31:43 +02:00
bors[bot]
4d110dd118
Merge #8643
8643: fix: correct version string to contain hash, build date and channel r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-04-24 10:37:42 +00:00
Aleksey Kladov
8d54fd105c fix: correct version string to contain hash, build date and channel 2021-04-24 13:36:45 +03:00
Aleksey Kladov
43ea1bb9b9 minor 2021-04-24 10:31:58 +03:00
bors[bot]
dc6178ddd9
Merge #8641
8641: minor r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-04-24 06:09:21 +00:00
Aleksey Kladov
03f5e53678 minor 2021-04-24 09:08:56 +03:00
bors[bot]
95996ea452
Merge #8639
8639: fix: 'configuration.property' error in VS Code r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-04-23 19:09:37 +00:00
Aleksey Kladov
905ae2843a fix: 'configuration.property' error in VS Code
closes #7789
2021-04-23 22:08:09 +03:00
bors[bot]
5cbde9f531
Merge #8591 #8638
8591: Remove SyntaxRewriter usage in insert_use in favor of mutable syntax trees r=matklad a=Veykril

Unfortunately changing `insert_use` to not use `SyntaxRewriter` creates a lot of changes since so much relies on that. But on the other hand this should be the biggest usage of `SyntaxRewriter` I believe.

8638: Remove SyntaxRewriter::from_fn r=Veykril a=Veykril



Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-04-23 16:49:08 +00:00
Lukas Wirth
e6e4417bbb Remove SyntaxRewriter::from_fn 2021-04-23 18:36:43 +02:00
bors[bot]
20f82191a0
Merge #8637
8637: Tag `yield` and `await` as ControlFlow in semantic highlighting r=Veykril a=Veykril

and shuffle some code around
Closes #8634
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-04-23 15:28:55 +00:00
Lukas Wirth
1e88f5ec8e Simplify highlight token match guards 2021-04-23 17:27:18 +02:00