Commit Graph

19620 Commits

Author SHA1 Message Date
vi_mi
61643513b6 fix: await insertion with try_expr during extract_function 2021-10-03 09:41:21 +00:00
bors[bot]
13ec077b91
Merge #10437
10437: fix: Fix extract_variable not allowing to extract macro calls r=Veykril a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/6866
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-10-03 09:10:33 +00:00
Lukas Wirth
a359a1f2e3 Fix extract_variable not allowing to extract macro calls 2021-10-03 11:09:49 +02:00
zhoufan
116c7aef7f move outer_attrs call before the match 2021-10-03 09:22:02 +08:00
bors[bot]
60c5449120
Merge #10431
10431: internal: cleanup mbe a bit r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-10-02 17:39:06 +00:00
Aleksey Kladov
4e352275d1 minor: simplify 2021-10-02 20:38:39 +03:00
Aleksey Kladov
613609cc5e minor: cleanup 2021-10-02 20:38:39 +03:00
Aleksey Kladov
77bf761203 internal: move code to where it's used and reduce visibility 2021-10-02 20:38:39 +03:00
bors[bot]
e504f8ae8d
Merge #10430
10430: fix: Fix rename trying to edit the same range multiple times for certain macro inputs r=Veykril a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10324
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-10-02 16:51:55 +00:00
Lukas Wirth
86e5406539 Fix rename trying to edit the same range multiple times 2021-10-02 18:50:21 +02:00
bors[bot]
c88277f676
Merge #10421
10421: minor: Bump npm non-dev deps r=lnicola a=lnicola

Fixes #10407

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-10-02 16:43:24 +00:00
bors[bot]
5faf07d082
Merge #10429
10429: internal: remove deprecated method r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-10-02 16:34:03 +00:00
Aleksey Kladov
7dbf24fc7a minor: dead code 2021-10-02 15:42:10 +03:00
Aleksey Kladov
d5c5b7cd12 internal: remove deprecated method 2021-10-02 15:28:55 +03:00
Aleksey Kladov
9c74a5b2c0 minor: reduce duplication 2021-10-02 15:24:32 +03:00
bors[bot]
745fd9903c
Merge #10428
10428: minor: regen r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-10-02 12:20:45 +00:00
Aleksey Kladov
f04f8ddb0d minor: regen 2021-10-02 15:20:16 +03:00
Aleksey Kladov
f3a1ff786f minor: generated code readability 2021-10-02 15:20:03 +03:00
bors[bot]
a6e6f9c58b
Merge #10427
10427: minor r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-10-02 10:21:07 +00:00
Aleksey Kladov
393f80e036 minor 2021-10-02 13:20:45 +03:00
bors[bot]
5ff551d86f
Merge #10426
10426: internal: use naming that matches intended use-case r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-10-02 10:06:24 +00:00
Aleksey Kladov
12103b16de internal: untangle usages of ReferenceCategory somewhat
Not everything that can be read or write is a reference, let's try to
use more precise types.
2021-10-02 13:02:06 +03:00
bors[bot]
c1fa583781
Merge #10425
10425: fix: remove semicolon diagnostics only highlights the semi r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-10-02 09:54:33 +00:00
Aleksey Kladov
76e875542a fix: remove semicolon diagnostics only highlights the semi 2021-10-02 12:54:10 +03:00
Aleksey Kladov
46eb03d99a internal: use naming that matches intended use-case 2021-10-02 12:18:18 +03:00
bors[bot]
59c758d0cb
Merge #10422
10422: fix: overwrite files when calling `patchelf` r=lnicola a=lnicola

Fixes #10379

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-10-02 07:08:48 +00:00
Laurențiu Nicola
502fa1755a Remove temporary file on exception 2021-10-02 10:07:50 +03:00
Laurențiu Nicola
2c7b50217e Overwrite file when running patchelf 2021-10-02 10:05:39 +03:00
Laurențiu Nicola
aa88d7e0d6 Bump npm non-dev deps 2021-10-02 07:38:44 +03:00
zhoufan
0ee6b70b34 Parse outer attributes on StructPatternEtCetera 2021-10-02 09:57:44 +08:00
bors[bot]
237ea0d34d
Merge #10418
10418: Add whitespace between lifetime and mut keyword in "expand macro" command r=lnicola a=nathanwhit

Before, we were only adding whitespace between a lifetime and the following ident, which produced invalid code for mutable references.

Before this PR:
```rust
macro_rules! foo {
    () => {
        pub struct Foo<'a> {
            foo: &'a mut str,
        }
    };
}
foo!(); // <- expand macro here
```
expanded to
```rust
pub struct Foo< 'a>{
  foo: & 'amut str,
}
```

with this PR, it expands to
```rust
pub struct Foo< 'a>{
  foo: & 'a mut str,
}
```

Co-authored-by: nathan.whitaker <nathan.whitaker01@gmail.com>
2021-10-01 20:01:42 +00:00
nathan.whitaker
a3661b3900 Add whitespace b/w lifetime and mut in expansion 2021-10-01 15:29:26 -04:00
bors[bot]
6b10decb20
Merge #10416
10416: docs: add note about `vscode-vim` in `on_enter` r=lnicola a=7596ff

I found myself search for this, so building off of #3013 and #3308, I
hope this note is useful.


Co-authored-by: Cassandra McCarthy <cassie@7596ff.com>
2021-10-01 18:27:55 +00:00
Cassandra McCarthy
d5cf9f4add
docs: add note about vscode-vim in on_enter
I found myself search for this, so building off of #3013 and #3308, I
hope this note is useful.
2021-10-01 14:12:32 -04:00
bors[bot]
7afa84ef41
Merge #10415
10415: minor: Bump deps r=lnicola a=lnicola

Hopefully the new `libc` works now. The FreeBSD issue was fixed in https://github.com/rust-lang/rust/pull/88676.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-10-01 15:58:58 +00:00
Laurențiu Nicola
035cb443aa Bump notify 2021-10-01 18:57:04 +03:00
Laurențiu Nicola
ffa8270f6a Bump memmap2 2021-10-01 18:55:52 +03:00
Laurențiu Nicola
34adcc800c Bump libc 2021-10-01 18:51:45 +03:00
Laurențiu Nicola
193a926d45 Bump deps 2021-10-01 18:50:52 +03:00
bors[bot]
acb565e6f9
Merge #10414
10414: internal: Add some profiling calls to name resolution r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-10-01 13:30:30 +00:00
Jonas Schievink
033f87c2f0 Add some profiling calls to name resolution 2021-10-01 15:30:00 +02:00
bors[bot]
0646d5cf9e
Merge #10413
10413: fix: Fix format highlighting with `concat!` and `unreachable!` r=jonas-schievink a=jonas-schievink

Last item in https://github.com/rust-analyzer/rust-analyzer/issues/10394, closes https://github.com/rust-analyzer/rust-analyzer/issues/10394

Also documents why/how `is_format_string` even works, since I found that nontrivial.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-10-01 11:31:32 +00:00
Jonas Schievink
3bc0d89ade Fix format highlighting with concat! 2021-10-01 13:28:05 +02:00
bors[bot]
47c079a037
Merge #10403
10403: feat: Add semantic token modifier for crate root r=Veykril a=lhvy

Resolves #9073

I managed to implement crate root highlighting for crates mentioned specifically by name (e.g. `serde` in `use serde::Serialize;`), but not for crates referred to with `crate` or `super`. How could I implement this?

> P.S. I'm participating in [Hacktoberfest 2021](https://hacktoberfest.digitalocean.com/). If this PR is up to standard and merged, I'd appreciate if the `hacktoberfest-accepted` label could be added. Thanks!

Co-authored-by: lhvy <me@lhvy.dev>
2021-10-01 11:18:52 +00:00
lhvy
dbb02370a4
Add semantic token modifier for crate root 2021-10-01 20:52:13 +10:00
bors[bot]
bbd5dd0f4c
Merge #10412
10412: feat: highlight `asm!` as format string r=jonas-schievink a=jonas-schievink

![screenshot-2021-10-01-12:34:31](https://user-images.githubusercontent.com/1786438/135606261-a1cb6caf-0a7f-45f7-9dde-0275370b0889.png)

part of https://github.com/rust-analyzer/rust-analyzer/issues/10394

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-10-01 10:35:15 +00:00
Jonas Schievink
cca6ee5757 Expand asm! to format_args! 2021-10-01 12:33:18 +02:00
bors[bot]
8b45de596f
Merge #10411
10411: fix: Parenthesize expressions in `if_to_bool_then` assist where required r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-10-01 10:20:06 +00:00
Lukas Wirth
816fafd997 Parenthesize expressions in if_to_bool_then assist where required 2021-10-01 12:19:01 +02:00
bors[bot]
c30a6a2974
Merge #10406
10406: internal: Restructure syntax element highlighting into node and token branches r=Veykril a=Veykril

Gets rid of all the unseemly unwraps 
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-30 19:46:57 +00:00