Commit Graph

67 Commits

Author SHA1 Message Date
Kirill Bulatov
5b7d928075 Enforce the located imports' order 2021-03-08 23:59:20 +02:00
Kirill Bulatov
33c83e72b9 Work towards better import labels 2021-03-08 23:59:20 +02:00
Kirill Bulatov
89d410cef5 Do not propose already imported imports 2021-03-08 23:59:20 +02:00
Kirill Bulatov
9482353fa8 Properly handle turbofishes in qualifiers 2021-03-08 23:59:20 +02:00
Kirill Bulatov
582cee2cdf Return more data about located imports 2021-03-08 23:59:18 +02:00
Kirill Bulatov
309421c117 Draft the qualifier import resolution 2021-03-08 23:58:48 +02:00
Kirill Bulatov
005bc49d74 Test and initial refactoring 2021-03-08 23:58:32 +02:00
Laurențiu Nicola
fc9eed4836 Use upstream cov-mark 2021-03-08 22:19:44 +02:00
Aleksey Kladov
9faf8dd69a Hygiene is an internal implementation detail of the compiler 2021-03-08 22:14:52 +03:00
bors[bot]
d54e1157b6
Merge #7889
7889: Make group imports configurable r=lnicola a=asv1



Co-authored-by: asv <asv7c2@gmail.com>
2021-03-07 08:24:02 +00:00
asv
96fc01a30b Make group imports configurable 2021-03-07 10:15:17 +02:00
bors[bot]
c44575b485
Merge #7896
7896: Only replace quotes in replace_string_with_char assist r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-03-06 20:22:36 +00:00
Lukas Wirth
1a276f8959 Only replace quotes in replace_string_with_char assist 2021-03-06 21:21:18 +01:00
bors[bot]
5480bed936
Merge #7800
7800: [WIP] 7708: Initial implementation of generate Default assist. r=Veykril a=chetankhilosiya

The Generate Default impl from new function.

Co-authored-by: Chetan Khilosiya <chetan.khilosiya@gmail.com>
2021-03-06 20:01:50 +00:00
Chetan Khilosiya
d40a4fc92c 7708: rust ideomatic code fixes. 2021-03-07 01:26:05 +05:30
bors[bot]
856c2850cd
Merge #7865
7865: preserve escape sequences when replacing string with char r=Veykril a=jDomantas

Currently it replaces escape sequence with the actual value, which is very wrong for `"\n"`.

Co-authored-by: Domantas Jadenkus <djadenkus@gmail.com>
2021-03-06 19:54:36 +00:00
Chetan Khilosiya
e4b6541c7a 7708: handle both FamousDefs fixture and plain code.
Also fix typo in example.
2021-03-07 00:51:48 +05:30
Chetan Khilosiya
9a84daf47d 7708: Added the updated implementation of is_default_implemented.
The implementation uses hir create to find the implemented trait.
2021-03-07 00:49:03 +05:30
Chetan Khilosiya
b8e6d6a606 7708: Added the logic to check is default impl is already present.
Also added test cases for code present within module.
2021-03-07 00:49:03 +05:30
Chetan Khilosiya
a59a97ae04 7708: Updated generate default fn logic. 2021-03-07 00:49:03 +05:30
Chetan Khilosiya
54b4727fa3 7708: Added the work for review comments.
Also added 1 test case to test multiple struct blocks are present.
2021-03-07 00:49:03 +05:30
Chetan Khilosiya
135c9e2027 7708: Fixed many documentaion example issues. 2021-03-07 00:49:03 +05:30
Chetan Khilosiya
69a6e4c80c 7708: Format code through rust-analyzer formatter. 2021-03-07 00:49:03 +05:30
Chetan Khilosiya
cb3f4d43d9 7708: Initial implementation of generate Default assist.
The Generate Default impl from new function.
2021-03-07 00:49:03 +05:30
Josh Mcguigan
e29b53f1e6 generate function assist convert arg names to lower snake case 2021-03-06 09:53:21 -08:00
bors[bot]
7199d5b56d
Merge #7869
7869: Add support for deref assignments to "pull assignment up" assist. r=Veykril a=Jesse-Bakker

Fixes #7867


Co-authored-by: Jesse Bakker <github@jessebakker.com>
2021-03-05 19:52:15 +00:00
Jesse Bakker
ab84a4746b Add support for deref assignments to "pull assignment up" assist.
Fixes #7867
2021-03-05 20:42:23 +01:00
bors[bot]
2b55cce49e
Merge #7880
7880: Honor snippet capability when using the extract function assist r=lnicola a=Arthamys

This fixes issue #7793

Co-authored-by: san <san@alien.parts>
2021-03-05 16:24:32 +00:00
san
769b3bca28 Honor snippet capability in extract function assist 2021-03-05 17:20:26 +01:00
Domantas Jadenkus
5bb4aec05f preserve escape sequences when replacing string with char 2021-03-03 23:20:18 +02:00
Jesse Bakker
1363d60111 Special-case parenthesized and negated expressions in demorgan assist 2021-03-03 13:18:24 +01:00
bors[bot]
0ce539ec96
Merge #7851
7851: Compress tests r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-03-02 15:46:02 +00:00
Aleksey Kladov
8471da62e6 Compress tests 2021-03-02 18:35:52 +03:00
Conrad Ludgate
2c3c728e0a
chore: remove redundant tests 2021-03-02 15:26:36 +00:00
Conrad Ludgate
b41e73ac12
chore: codegen 2021-03-02 14:55:37 +00:00
Conrad Ludgate
d4fad2be8d
refactor: re-use add_turbo_fish function 2021-03-02 14:30:11 +00:00
Conrad Ludgate
4a36129c7a
chore: fmt + docs 2021-03-02 14:30:10 +00:00
Conrad Ludgate
218390b9fb
chore: rename var 2021-03-02 14:30:10 +00:00
Conrad Ludgate
705712993f
feat: add type ascription assist 2021-03-02 14:30:10 +00:00
Vladyslav Katasonov
7066e6b362 strip useless methods, and unary ops in suggest_name 2021-03-02 16:25:24 +03:00
Vladyslav Katasonov
afc68277f6 pull out suggest_name::* to utils; enchance heuristics 2021-03-02 16:25:22 +03:00
Vladyslav Katasonov
f915ab79fa suggest parameter name before function name 2021-03-02 16:23:00 +03:00
Vladyslav Katasonov
3b75dda745 try to suggest name when extracting variable 2021-03-02 16:23:00 +03:00
bors[bot]
2183d65c97
Merge #7777
7777: Implement line<->block comment assist r=Veykril a=djrenren

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

Co-authored-by: John Renner <john@jrenner.net>
2021-03-02 08:04:38 +00:00
John Renner
f5cde97aae Apply edits 2021-03-01 11:41:22 -08:00
Aleksey Kladov
406d96c7d4 Use consistent naming for assist 2021-02-28 21:14:34 +03:00
Aleksey Kladov
aa04e3bbb2 Don't spam loop-rewriting assist
The more focused the assist, the better!
2021-02-28 21:08:51 +03:00
Domantas Jadenkus
558bcf4e0b generate try_into instead of into 2021-02-27 12:21:57 +02:00
Domantas Jadenkus
d4b6cbe5b6 rename generate_enum_match_method file to match assist name 2021-02-27 12:21:56 +02:00
Domantas Jadenkus
f098a2b31b move into_ and as_ generation to a separate file 2021-02-27 12:21:06 +02:00