From d40c0fe48b1d0947db5b2ea18df92a52db068319 Mon Sep 17 00:00:00 2001 From: roife Date: Fri, 15 Mar 2024 21:05:04 +0800 Subject: [PATCH] test: add test for extract_module --- .../src/handlers/extract_module.rs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/crates/ide-assists/src/handlers/extract_module.rs b/crates/ide-assists/src/handlers/extract_module.rs index b1e43ceb52c..c6a1bd0838f 100644 --- a/crates/ide-assists/src/handlers/extract_module.rs +++ b/crates/ide-assists/src/handlers/extract_module.rs @@ -1708,6 +1708,27 @@ fn main() { } "#, r#" +mod modname { + use Direction::{Horizontal, Vertical}; + + pub(crate) struct Point; + + impl Point { + pub const fn direction(self, other: Self) -> Option { + Some(Vertical) + } + } + + pub enum Direction { + Horizontal, + Vertical, + } +} +use modname::Direction::{Horizontal, Vertical}; + +fn main() { + let x = Vertical; +} "#, ); }