diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-10-27 09:23:55 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-10-27 09:23:55 +0000 |
commit | 5a3d2332f8d5e382fc06210c260ff6db857ac716 (patch) | |
tree | 0e12aa5d4bcdfb609faa76e01e49854ac95ccadd /crates/ra_assists/src/assists/split_import.rs | |
parent | a455635b48b9b43904488bb33454c67e513bccf7 (diff) | |
parent | da5528824a836a4f36f44f90adc9fadcc98ca75b (diff) |
Merge #2086
2086: document almost all assists r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_assists/src/assists/split_import.rs')
-rw-r--r-- | crates/ra_assists/src/assists/split_import.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/crates/ra_assists/src/assists/split_import.rs b/crates/ra_assists/src/assists/split_import.rs index 09bde1b72..8d8a28987 100644 --- a/crates/ra_assists/src/assists/split_import.rs +++ b/crates/ra_assists/src/assists/split_import.rs | |||
@@ -1,5 +1,3 @@ | |||
1 | //! FIXME: write short doc here | ||
2 | |||
3 | use std::iter::successors; | 1 | use std::iter::successors; |
4 | 2 | ||
5 | use hir::db::HirDatabase; | 3 | use hir::db::HirDatabase; |
@@ -7,6 +5,17 @@ use ra_syntax::{ast, AstNode, TextUnit, T}; | |||
7 | 5 | ||
8 | use crate::{Assist, AssistCtx, AssistId}; | 6 | use crate::{Assist, AssistCtx, AssistId}; |
9 | 7 | ||
8 | // Assist: split_import | ||
9 | // | ||
10 | // Wraps the tail of import into braces. | ||
11 | // | ||
12 | // ``` | ||
13 | // use std::<|>collections::HashMap; | ||
14 | // ``` | ||
15 | // -> | ||
16 | // ``` | ||
17 | // use std::{collections::HashMap}; | ||
18 | // ``` | ||
10 | pub(crate) fn split_import(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> { | 19 | pub(crate) fn split_import(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> { |
11 | let colon_colon = ctx.find_token_at_offset(T![::])?; | 20 | let colon_colon = ctx.find_token_at_offset(T![::])?; |
12 | let path = ast::Path::cast(colon_colon.parent())?; | 21 | let path = ast::Path::cast(colon_colon.parent())?; |