We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fede1a3 commit 3edc25dCopy full SHA for 3edc25d
crates/ide_assists/src/handlers/promote_mod_file.rs
@@ -9,6 +9,19 @@ use syntax::{
9
10
use crate::assist_context::{AssistContext, Assists};
11
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
25
pub(crate) fn promote_mod_file(acc: &mut Assists, ctx: &AssistContext) -> Option<()> {
26
let source_file = ctx.find_node_at_offset::<ast::SourceFile>()?;
27
let module = ctx.sema.to_module_def(ctx.frange.file_id)?;
0 commit comments