Commit Graph

614 Commits

Author SHA1 Message Date
Jonas Schievink
7e83ed99a8 Respect casing when searching for imports 2020-06-10 16:04:55 +02:00
Jonas Schievink
781b514e58 Add test for macro generated items 2020-06-10 12:38:58 +02:00
Jonas Schievink
a70a0ca73c ImportsLocator: use ImportMap for non-local crates 2020-06-10 12:38:58 +02:00
Aleksey Kladov
8cad7d1a2b Use correct indent when replacing with match 2020-06-09 12:38:47 +02:00
Aleksey Kladov
53cc2c16e7 Unwrap block works with match arms 2020-06-09 11:52:45 +02:00
Aleksey Kladov
5233766ce5 Simplify unwrapping of blocks 2020-06-09 11:33:28 +02:00
Aleksey Kladov
38fa4d17fb Simplify API 2020-06-09 00:01:53 +02:00
bors[bot]
3a7c218fd4
Merge #4576
4576: Add implementation of extract struct from enum variant r=matklad a=mcrakhman

Hi guys! I implemented the extraction functionality including modifying multiple files. The only thing I didn't change the cursor position. I've done it with a previous API, but now snippets have been introduced and I need to figure out how to do it.

Please bear in mind that I am a newcomer in the rust-analyzer (and also Rust) world, so I tried to implement the feature to the best of my knowledge, but the API is very new to me, so I am very welcome to introducing changes etc. 

Co-authored-by: Mikhail Rakhmanov <rakhmanov.m@gmail.com>
2020-06-08 16:28:48 +00:00
Florian Diebold
a4a4a1854e Fix type parameter defaults
They should not be applied in expression or pattern contexts, unless there are
other explicitly given type args.
2020-06-05 20:09:13 +02:00
Mikhail Rakhmanov
5dda995538 Fix review comments 2020-06-05 13:17:17 +02:00
Mikhail Rakhmanov
74c3e7a1ad Remove unnecessary return 2020-06-05 11:45:41 +02:00
Jess Balint
921306757b introduce_named_lifetime assist wasn't applicable when type parameter
followed anonymous lifetime token

(fixes #4684)
2020-06-04 17:31:21 -05:00
Mikhail Rakhmanov
b0c8a2be7b Remove AsName import 2020-06-04 10:03:44 +02:00
Mikhail Rakhmanov
a6d3c77bdd Fixed tests 2020-06-03 20:43:57 +02:00
Mikhail Rakhmanov
eefa10bc6b Merge branch 'master' into assists_extract_enum 2020-06-03 20:10:54 +02:00
Mikhail Rakhmanov
a9d5675848 Fix incorrect behaviour if not resolved 2020-06-03 20:10:33 +02:00
Aleksey Kladov
285717de33 Rename assist 2020-06-01 15:41:16 +02:00
Aleksey Kladov
d08232b10d Cleanup imports 2020-06-01 15:35:41 +02:00
bors[bot]
09df51dab8
Merge #4664
4664: Generate feature documentation from code r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-05-31 10:50:11 +00:00
Aleksey Kladov
8915183d7d Don't require module docs for Features and Assists 2020-05-31 09:59:38 +02:00
bors[bot]
5d84028170
Merge #4562
4562: Assist: replace anonymous lifetime with a named one r=matklad a=jbalint

(fixes #4523)

Co-authored-by: Jess Balint <jbalint@gmail.com>
2020-05-30 08:01:00 +00:00
Jess Balint
bd8aa04bae add support for naming anon lifetimes in function return type 2020-05-28 15:10:14 -05:00
Mikhail Rakhmanov
08aa8e1de7 Further refactoring under review comments 2020-05-24 14:53:12 +02:00
Mikhail Rakhmanov
e2974ba8f7 Remove unnecessary set_file and change variable positions for better readability 2020-05-23 11:57:12 +02:00
Mikhail Rakhmanov
3a244e02b5 Remove unwraps where possible 2020-05-23 11:53:02 +02:00
Jess Balint
4967b811dd tweak syntax 2020-05-22 19:09:37 -05:00
Mikhail Rakhmanov
6ee1c60c9c Further review fixes 2020-05-23 01:41:08 +02:00
Mikhail Rakhmanov
4984520ef5 Use default instead of new in AssistDirector 2020-05-23 01:27:11 +02:00
Mikhail Rakhmanov
fce10200a0 Better naming and fix some review comments 2020-05-23 01:23:40 +02:00
kjeremy
d8af45472e Remove unnecessary clone that prevented clippy from moving on 2020-05-22 17:13:14 -04:00
Mikhail Rakhmanov
ef1aaeb595 More formatting 2020-05-22 22:59:17 +02:00
Mikhail Rakhmanov
97ffe3c6e8 Refactor AssistDirector 2020-05-22 22:47:25 +02:00
Mikhail Rakhmanov
04a35784df Formatting and remove unused imports 2020-05-22 22:43:52 +02:00
Mikhail Rakhmanov
5cd4eb6dd6 Add preliminary implementation of extract struct from enum variant 2020-05-22 22:28:30 +02:00
Aleksey Kladov
2c04aad2d2 KISS SourceChange
The idea behind requiring the label is a noble one, but we are not
really using it consistently anyway, and it should be easy to retrofit
later, should we need it.
2020-05-22 18:04:26 +02:00
Jess Balint
d42fd8efb6 use char range 2020-05-22 10:15:59 -05:00
Jess Balint
1f9e02c74e fix generated docs issue 2020-05-22 09:25:55 -05:00
Jess Balint
1fae96a8d4 handle the case of conflicting lifetime param name
- and clean/format code
2020-05-22 08:51:37 -05:00
Jess Balint
2ab79c6f4d Assist: replace anonymous lifetime with a named one
(fixes #4523)
2020-05-21 21:04:02 -05:00
Aleksey Kladov
ff28c79ebd Remove dead code for handling cursor positions 2020-05-21 15:08:03 +02:00
Aleksey Kladov
4fdb1eac08 Remove unused cursor positions 2020-05-21 10:37:11 +02:00
Aleksey Kladov
70930d3bb2 Remove set_cursor 2020-05-21 00:03:42 +02:00
Aleksey Kladov
4ac0abd296 Snippetify unwrap -> match 2020-05-21 00:01:08 +02:00
Aleksey Kladov
8300132ed0 More snippets 2020-05-20 23:50:42 +02:00
Aleksey Kladov
5e13e4eba1 More snippets 2020-05-20 23:33:03 +02:00
Aleksey Kladov
fd77170718 Snippetify introduce/inline var 2020-05-20 23:07:17 +02:00
Aleksey Kladov
65fa586410 Relax cursor position tests in assists
Those will be replaced with snippets anyway
2020-05-20 22:55:37 +02:00
Aleksey Kladov
ba3a58d1b2 Snippetify fix_visibility 2020-05-20 14:13:17 +02:00
Aleksey Kladov
c446fd76a2 Snippetify fill_match_arms 2020-05-20 14:01:10 +02:00
Aleksey Kladov
a622b54ac0 Don't set cursor in change_visibility 2020-05-20 13:48:31 +02:00