Skip to content

Commit 3edc25d

Browse files
committed
Add docs strings
1 parent fede1a3 commit 3edc25d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

crates/ide_assists/src/handlers/promote_mod_file.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,19 @@ use syntax::{
99

1010
use crate::assist_context::{AssistContext, Assists};
1111

12+
// Assist: promote_mod_file
13+
//
14+
// Moves inline module's contents to a separate file.
15+
//
16+
// ```
17+
// // a.rs
18+
// $0fn t() {}
19+
// ```
20+
// ->
21+
// ```
22+
// // /a/mod.rs
23+
// fn t() {}
24+
// ```
1225
pub(crate) fn promote_mod_file(acc: &mut Assists, ctx: &AssistContext) -> Option<()> {
1326
let source_file = ctx.find_node_at_offset::<ast::SourceFile>()?;
1427
let module = ctx.sema.to_module_def(ctx.frange.file_id)?;

0 commit comments

Comments
 (0)