diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-10-05 23:00:40 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-10-05 23:00:40 +0100 |
commit | dd6a352e64a2d52efd43feca4b2e80d124210a60 (patch) | |
tree | 9d8ac48868ba23669f48e665b7c4f8168d7ae9a7 /crates/assists/src/lib.rs | |
parent | 3fc7338dcb8af4bc8771ae319ae0dd1612fa9013 (diff) | |
parent | b2bfadb52c51b0f73f0b425fb6a486bb644e8ebb (diff) |
Merge #6111
6111: Add assist for converting the base of integer literals. r=SomeoneToIgnore a=vlakreeh
This PR adds an assist similar to Intellij's [convert number to](https://i.imgur.com/JH6wstP.png). It also does a small refactor to [assists/src/tests.rs](https://github.com/rust-analyzer/rust-analyzer/blob/fc34403018079ea053f26d0a31b7517053c7dd8c/crates/assists/src/tests.rs) to add the ability to specify the resolved assist for a specific action within an assist group.
## Demo
![Demo of the assist in action](https://i.imgur.com/MBhdPFH.gif)
Co-authored-by: vlakreeh <[email protected]>
Diffstat (limited to 'crates/assists/src/lib.rs')
-rw-r--r-- | crates/assists/src/lib.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crates/assists/src/lib.rs b/crates/assists/src/lib.rs index cbac53e71..a2bec818c 100644 --- a/crates/assists/src/lib.rs +++ b/crates/assists/src/lib.rs | |||
@@ -128,6 +128,7 @@ mod handlers { | |||
128 | mod auto_import; | 128 | mod auto_import; |
129 | mod change_return_type_to_result; | 129 | mod change_return_type_to_result; |
130 | mod change_visibility; | 130 | mod change_visibility; |
131 | mod convert_integer_literal; | ||
131 | mod early_return; | 132 | mod early_return; |
132 | mod expand_glob_import; | 133 | mod expand_glob_import; |
133 | mod extract_struct_from_enum_variant; | 134 | mod extract_struct_from_enum_variant; |
@@ -172,6 +173,7 @@ mod handlers { | |||
172 | auto_import::auto_import, | 173 | auto_import::auto_import, |
173 | change_return_type_to_result::change_return_type_to_result, | 174 | change_return_type_to_result::change_return_type_to_result, |
174 | change_visibility::change_visibility, | 175 | change_visibility::change_visibility, |
176 | convert_integer_literal::convert_integer_literal, | ||
175 | early_return::convert_to_guarded_return, | 177 | early_return::convert_to_guarded_return, |
176 | expand_glob_import::expand_glob_import, | 178 | expand_glob_import::expand_glob_import, |
177 | extract_struct_from_enum_variant::extract_struct_from_enum_variant, | 179 | extract_struct_from_enum_variant::extract_struct_from_enum_variant, |