Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide_assists/src/handlers/promote_mod_file.rs')
-rw-r--r--crates/ide_assists/src/handlers/promote_mod_file.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/crates/ide_assists/src/handlers/promote_mod_file.rs b/crates/ide_assists/src/handlers/promote_mod_file.rs
index c5c37def07..2ba51d1699 100644
--- a/crates/ide_assists/src/handlers/promote_mod_file.rs
+++ b/crates/ide_assists/src/handlers/promote_mod_file.rs
@@ -9,6 +9,19 @@ use syntax::{
use crate::assist_context::{AssistContext, Assists};
+// Assist: promote_mod_file
+//
+// Moves inline module's contents to a separate file.
+//
+// ```
+// // a.rs
+// $0fn t() {}
+// ```
+// ->
+// ```
+// // /a/mod.rs
+// fn t() {}
+// ```
pub(crate) fn promote_mod_file(acc: &mut Assists, ctx: &AssistContext) -> Option<()> {
let source_file = ctx.find_node_at_offset::<ast::SourceFile>()?;
let module = ctx.sema.to_module_def(ctx.frange.file_id)?;