bors[bot]
a3dbd272e0
Merge #4406 #4410 #4411 #4417
...
4406: Update cargo-metadata r=matklad a=edwin0cheng
This PR update `cargo-metadata` to 0.10.0 and it also relax the` serde-derive` deps to 1.0 for tests in `proc-macro-srv`.
cc @robojumper
r= @matklad , I think you would have something to say related to https://github.com/serde-rs/json/issues/647#issue-593788429 ?
4410: Improve wording in comment r=matklad a=edwin0cheng
4411: do not remove then block when you unwrap else block #4361 r=matklad a=bnjjj
close #4361
4417: Omit default types in HirDisplay SourceCode mode r=matklad a=TimoFreiberg
Closes #4390
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
Co-authored-by: Timo Freiberg <timo.freiberg@gmail.com>
2020-05-10 17:37:07 +00:00
Timo Freiberg
cbbbd48325
Omit default types in HirDisplay SourceCode mode
2020-05-10 18:10:15 +02:00
Benjamin Coenen
98a7bb2435
do not remove then block when you unwrap else block #4361
...
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-05-10 15:31:51 +02:00
bors[bot]
f1cb5b8a29
Merge #4392
...
4392: Add From should not move the cursor r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-05-09 14:22:06 +00:00
Aleksey Kladov
d9828a57fc
Add From should not move the cursor
2020-05-09 16:21:10 +02:00
Aleksey Kladov
e201e7834d
Ascribe more correct types
2020-05-09 15:57:53 +02:00
Aleksey Kladov
5c04d8544c
unindent -> dedent
2020-05-09 14:48:43 +02:00
Aleksey Kladov
231fddab54
More fluent indent API
2020-05-09 14:40:11 +02:00
Timo Freiberg
64e6b8200b
Use new HirDisplay variant in add_function assist
2020-05-08 17:14:45 +02:00
Aleksey Kladov
1e790ea314
Simplify
2020-05-07 17:32:01 +02:00
Aleksey Kladov
4867968d22
Refactor assists API to be more convenient for adding new assists
...
It now duplicates completion API in its shape.
2020-05-07 16:27:54 +02:00
Benjamin Coenen
51c02ab84f
add Ok wrapping
...
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-05-06 17:45:55 +02:00
Aleksey Kladov
020ca6695f
Simplify
2020-05-06 16:39:11 +02:00
Aleksey Kladov
1116c9a0e9
Fix TODO
2020-05-06 13:21:49 +02:00
Aleksey Kladov
233f01c9ba
Move target to AssistLabel
...
Target is used for assists sorting, so we need it before we compute
the action.
2020-05-06 12:51:28 +02:00
Aleksey Kladov
25e6bbde01
Merge assits::test_helpers and tests
2020-05-06 10:16:55 +02:00
Edwin Cheng
92665358cd
Rename ImplItem to AssocItem
2020-05-05 23:56:10 +08:00
bors[bot]
f68e099777
Merge #4265
...
4265: Make `change_visibility` assist work for tuple struct fields r=matklad a=Jesse-Bakker
Fixes #4206
Co-authored-by: Jesse Bakker <git@jessebakker.com>
2020-05-05 14:42:33 +00:00
Aleksey Kladov
d7450222a9
Simplify
2020-05-04 14:55:24 +02:00
Aleksey Kladov
802617ccc2
Simplify
2020-05-04 14:16:10 +02:00
Edwin Cheng
2034002413
Support auto-import in macro
2020-05-03 03:24:55 +08:00
Jesse Bakker
b5c330bf5a
Make change_visibility
assist work for tuple struct field visibility
2020-05-02 18:25:38 +02:00
Benjamin Coenen
6d5f3922f7
Add unwrap block assist #4156
...
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-05-02 12:31:11 +02:00
Benjamin Coenen
0b40876b99
Merge branch 'master' of github.com:rust-analyzer/rust-analyzer
2020-05-02 12:25:04 +02:00
Benjamin Coenen
eea21738ab
Add unwrap block assist #4156
...
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-05-02 12:20:39 +02:00
Aleksey Kladov
b73dbbfbf2
Add missing members generates indented blocks
2020-05-02 11:53:07 +02:00
Aleksey Kladov
4f2134cc33
Introduce EffectExpr
2020-05-02 11:21:39 +02:00
Benjamin Coenen
df7899e47a
Add unwrap block assist #4156
...
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-05-01 16:41:29 +02:00
Benjamin Coenen
dc34162450
Merge branch 'master' of github.com:rust-analyzer/rust-analyzer
2020-05-01 16:26:30 +02:00
Edwin Cheng
44f5e2048c
Remove lower_path from AssistCtx to Semantic
2020-05-01 20:05:12 +08:00
Edwin Cheng
bdcf6f5658
Introduce LowerCtx for path lowering
2020-05-01 20:01:17 +08:00
Benjamin Coenen
bbe22640b8
Add unwrap block assist #4156
...
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-04-29 14:53:47 +02:00
Aleksey Kladov
b4dd475257
More principled approach for finding From trait
2020-04-29 14:51:44 +02:00
Benjamin Coenen
76733f0cd4
Add unwrap block assist #4156
...
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-04-29 14:08:30 +02:00
Aleksey Kladov
7c3c289dab
Use specific pattern when translating if-let-else to match
...
We *probably* should actually use the same machinery here, as we do
for fill match arms, but just special-casing options and results seems
to be a good first step.
2020-04-29 11:59:11 +02:00
Aleksey Kladov
73bef854ab
Move shared assist code to utils
2020-04-29 10:38:51 +02:00
Aleksey Kladov
63a462f37c
Switch to TryFrom
2020-04-25 11:59:18 +02:00
Aleksey Kladov
b1d5817dd1
Convert code to text-size
2020-04-25 11:59:18 +02:00
Timo Freiberg
f2f882bc44
Add pub(crate)
to functions generated in other module
2020-04-21 23:04:44 +02:00
Timo Freiberg
74780a15f6
Jump to sourceChanges in other files
2020-04-21 23:04:44 +02:00
Timo Freiberg
ba8faf3efc
Add target file information to AssistAction
2020-04-21 23:04:44 +02:00
Timo Freiberg
317fc650d5
Make add_function generate functions in other modules via qualified path
2020-04-21 23:04:44 +02:00
Kirill Bulatov
ce06a6b422
Do not add default and closure types in 'add explicit type' assist
2020-04-21 22:56:40 +03:00
Aleksey Kladov
8a04372fec
Fix panic in split_imports assist
...
The fix is admittedly quit literally just papering over.
Long-term, I see two more principled approaches:
* we switch to a fully tree-based impl, without parse . to_string
step; with this approach, there shouldn't be any panics. The results
might be nonsensical, but so was the original input.
* we preserve the invariant that re-parsing constructed node is an
identity, and make all the `make_xxx` method return an `Option`.
closes #4044
2020-04-20 16:34:01 +02:00
Jeremy Kolb
d7f3d858ad
Some clippy fixes
2020-04-19 15:15:49 -04:00
Timo Freiberg
1231418f31
Change add_function assist to use todo!()
2020-04-13 22:17:06 +02:00
IceSentry
ed0eedb1dd
Fix PR
2020-04-13 13:59:30 -04:00
IceSentry
2e279ca031
Generalize test and clean up imports
2020-04-12 21:34:01 -04:00
IceSentry
abdf725c55
Fix double comma when merge imports on second line
...
This fixes the a bug when merging imports from the second line when it already has a comma it would previously insert a comma.
There's probably a better way to check for a COMMA.
This also ends up with a weird indentation, but rust-fmt can easily deal with it so I'm not sure how to resolve that.
Closes #3832
2020-04-12 21:29:14 -04:00
Laurențiu Nicola
e809328c12
Remove more unnecessary braces
2020-04-12 18:20:03 +03:00