mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-04 02:54:00 +00:00
Add docs strings
This commit is contained in:
parent
fede1a3beb
commit
3edc25dc26
@ -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)?;
|
||||
|
Loading…
Reference in New Issue
Block a user