Commit Graph

19149 Commits

Author SHA1 Message Date
bors[bot]
5964750e95
Merge #10264
10264: fix: Don't seek outside of character boundaries in completion handler r=Veykril a=iDawer

Fixes #10219 panic when entering `:` in `$0` places:
```rust
fn main() {
    "⊞$0";
}
```

```rust
struct S {
    д$0 u8
}
```


Co-authored-by: Dawer <7803845+iDawer@users.noreply.github.com>
2021-09-17 18:28:55 +00:00
Dawer
0ff271d38f fix completion handler trying to seek outside of character boundaries.
With this patch, in these examples
```rust
fn main() {
    "⊞$0";
}
```

```rust
struct S {
д$0 u8
}
```
entering ':' character in `$0` places shouldn't cause panics.
2021-09-17 23:04:20 +05:00
bors[bot]
00b19846c9
Merge #10257
10257: assists: turn while into loop r=Veykril a=agluszak

Implements an assist to turn a `while` loop into a `loop` loop, as requested in #10214. 
I'm not sure sure what the guidelines are regarding naming assists convert_x_to_y vs replace_x_with_y.

This is my first commit to rust-analyzer :D Thank you `@matklad` for your awesome Explaining rust-analyzer series <3

Closes #10214 

Co-authored-by: Andrzej Głuszak <gluszak.andrzej@gmail.com>
2021-09-16 21:04:42 +00:00
Andrzej Głuszak
11a56f886b assists: turn while into loop 2021-09-16 22:20:27 +02:00
bors[bot]
ae36af2bd4
Merge #10254
10254: Fix a comment typo in autoderef.rs r=lnicola a=teor2345

There's a minor typo in a comment in autoderef.rs, although the meaning is clear if your pronounce the words out loud

Co-authored-by: teor <teor@riseup.net>
2021-09-16 05:27:24 +00:00
bors[bot]
86943b0cb0
Merge #10251
10251: Fix typescript syntax errors r=lnicola a=Wilfred

Remove unwanted `:` and fix the naming of the boolean type.

Co-authored-by: Wilfred Hughes <me@wilfred.me.uk>
2021-09-16 05:19:38 +00:00
teor
e0a501424c
Fix a comment typo in autoderef.rs 2021-09-16 13:47:01 +10:00
Wilfred Hughes
e543fe855b
Fix typescript syntax errors
Remove unwanted `:` and fix the naming of the boolean type.
2021-09-15 17:53:36 -07:00
bors[bot]
959c7ef563
Merge #10250
10250: internal: Improve call_hierarchy and incoming/outgoing_calls r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-16 00:26:32 +00:00
Lukas Wirth
d777eddf0d Improve call_hierarchy and incoming/outgoing_calls 2021-09-16 02:25:02 +02:00
bors[bot]
c577e128fc
Merge #10248
10248: internal: remove dead code r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-09-15 18:23:46 +00:00
Aleksey Kladov
73b0f9dc04 internal: remove dead code 2021-09-15 21:22:06 +03:00
bors[bot]
911659a166
Merge #10048
10048: fix: correctly complete macro call if cursor at `!` r=Veykril a=unexge

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/9904

Co-authored-by: unexge <unexge@gmail.com>
2021-09-15 18:13:09 +00:00
bors[bot]
4c9eef7ede
Merge #10233
10233: fix: add multi-token mapping support to hovers r=Veykril a=spookyvision

implement #10070 in [`hover`](https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/hover.rs)

Co-authored-by: Anatol Ulrich <anatol.ulrich@ferrous-systems.com>
2021-09-15 16:36:33 +00:00
Anatol Ulrich
45090e4f4b add multi-token mappings for hover 2021-09-15 18:05:53 +02:00
Anatol Ulrich
b251a30819 # This is a combination of 3 commits.
# This is the 1st commit message:

add multi-token mappings for hover

# The commit message #2 will be skipped:

# make fallback an Option instead of vec

# The commit message #3 will be skipped:

# fix indentation
2021-09-15 18:04:45 +02:00
bors[bot]
67706cdbe0
Merge #10247
10247: fix: Don't highlight unsafe traits as unsafe in safe impls r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-15 14:29:55 +00:00
Lukas Wirth
33cdc21832 Don't highlight unsafe traits as unsafe in safe impls 2021-09-15 15:46:45 +02:00
bors[bot]
726a2aa211
Merge #10240
10240: internal: Revert attributed items inlay hints r=Veykril a=Veykril

Reverts #10231 as the implementation there is actually wrong
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-14 18:31:59 +00:00
Lukas Wirth
64fb7be247 Revert attributed items inlay hints 2021-09-14 20:30:28 +02:00
bors[bot]
62288f57cb
Merge #10237
10237: fix: Do not wrap inlined local in parens when at block tail position r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-14 16:30:41 +00:00
Lukas Wirth
747f2d1719 fix: Do not wrap inlined local in parens when at block tail position 2021-09-14 18:29:34 +02:00
bors[bot]
f750eebd0d
Merge #10232
10232: internal: Add more tests for ide functionality in attributed items r=Veykril a=Veykril

cc https://github.com/rust-analyzer/rust-analyzer/issues/9868

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-14 12:54:00 +00:00
Lukas Wirth
0f4463e45e fix source_to_def trying to use attribute macro calls as containers 2021-09-14 14:42:14 +02:00
Lukas Wirth
d1e489185f Pick smaller node ancestors first when descending at offset 2021-09-14 14:10:59 +02:00
Lukas Wirth
538ac599d2 Add some more attribute ide tests 2021-09-14 03:57:29 +02:00
Lukas Wirth
6f9de71402 fix: Use original definition ranges for ide_db::search instead of the expanded ranges 2021-09-14 02:49:06 +02:00
bors[bot]
e896def412
Merge #10204
10204: feat: Show the type of what is being dereferenced in a deref expression. r=theo-lw a=theo-lw

Addresses issue #10106.

In-progress - I'm trying to figure out why `hover_deref_expr_with_coercion` is failing.

Co-authored-by: Teddy_Wang <wangtheo662@gmail.com>
2021-09-14 00:41:17 +00:00
Teddy_Wang
8de5d66e25 Improve hover over derference message 2021-09-13 20:19:30 -04:00
bors[bot]
e08b3bf70b
Merge #10231
10231: feat: Make inlay hints work in attributed items r=Veykril a=Veykril

![image](https://user-images.githubusercontent.com/3757771/133172697-8563329f-e77e-46e4-86ab-99b50040dfd5.png)
Note the lack of chaining hints, this is currently due to macro expansion lacking the input whitespace. We might be able to recover this from the input somehow in the future.
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10043
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-14 00:07:50 +00:00
Lukas Wirth
e193e3b076 feat: Make inlay hints work in attributed items 2021-09-14 01:59:45 +02:00
Teddy_Wang
4d9728ccb2 Fix hover tests 2021-09-13 19:47:53 -04:00
bors[bot]
42617231bd
Merge #10230
10230: fix: fix expansion order for fn-like macros and attributes in token descending r=Veykril a=Veykril

Second attempt(now with a test 🎉).
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10115

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-13 23:24:33 +00:00
Lukas Wirth
8f76e41e18 Enable attribte macros in ide fixtures 2021-09-14 01:23:13 +02:00
Lukas Wirth
bb946f78f6 fix: fix expansion order for fn-like macros and attributes in token descending 2021-09-14 01:20:43 +02:00
Teddy_Wang
0c6a993f59 Fix spelling 2021-09-13 19:16:10 -04:00
bors[bot]
249ebdd076
Merge #10229
10229: fix: do not complete builtin attributes for qualified paths r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-13 22:31:39 +00:00
Lukas Wirth
845904f0bb fix: do not complete builtin attributes for qualified paths 2021-09-14 00:31:14 +02:00
bors[bot]
6eecd84771
Merge #10126
10126: feat: Speculatively expand attributes in completions r=Veykril a=Veykril

![j1OjBt5Nca](https://user-images.githubusercontent.com/3757771/133163858-91930072-1441-4ce4-9979-b0ad2727b47f.gif)

Fixes #9866

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-13 22:22:08 +00:00
Lukas Wirth
dfb94d09d4 Exclude test file from rust tidy check 2021-09-14 00:21:16 +02:00
Lukas Wirth
aa1b36dc6d Downmap the token in attribute inputs when expanding speculatively 2021-09-14 00:04:04 +02:00
bors[bot]
bcf0072bb4
Merge #10199
10199: fix: Fix Cargo.toml change detection r=lnicola a=lnicola

Maybe fixes #9546

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-09-13 18:14:20 +00:00
Laurențiu Nicola
4d7a3bb5c7 Shuffle code around to avoid an allocation 2021-09-13 21:06:31 +03:00
Lukas Wirth
2b907652ee Speculatively expand attributes in completions 2021-09-13 19:30:23 +02:00
bors[bot]
c3eb646487
Merge #10225
10225: internal: Add proc-macro fixture directive r=Veykril a=Veykril



Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-13 17:07:23 +00:00
bors[bot]
df34698cb8
Merge #10226
10226: minor: Simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-13 16:51:37 +00:00
Lukas Wirth
a044175412 Simplify 2021-09-13 18:50:19 +02:00
Lukas Wirth
edc915fbb6 Add proc-macro fixture directive 2021-09-13 18:37:50 +02:00
Laurențiu Nicola
8875f2c8aa Fix Cargo.toml change detection 2021-09-13 19:15:17 +03:00
bors[bot]
1ef4b2cb7b
Merge #10222
10222: internal: Add workaround for rename error reporting r=lnicola a=lnicola

Fixes #9875

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-09-13 11:52:29 +00:00