diff options
| author | roife <roifewu@gmail.com> | 2024-03-15 21:05:04 +0800 |
|---|---|---|
| committer | roife <roifewu@gmail.com> | 2024-03-15 21:05:04 +0800 |
| commit | d40c0fe48b1d0947db5b2ea18df92a52db068319 (patch) | |
| tree | c5a0309029cf72105fc77b3057028dc37eabba3a | |
| parent | 513c6d35ed04a5731c5aca18397a0c1b2454680f (diff) | |
| download | rust-d40c0fe48b1d0947db5b2ea18df92a52db068319.tar.gz rust-d40c0fe48b1d0947db5b2ea18df92a52db068319.zip | |
test: add test for extract_module
| -rw-r--r-- | crates/ide-assists/src/handlers/extract_module.rs | 21 |
1 files changed, 21 insertions, 0 deletions
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<Direction> { + Some(Vertical) + } + } + + pub enum Direction { + Horizontal, + Vertical, + } +} +use modname::Direction::{Horizontal, Vertical}; + +fn main() { + let x = Vertical; +} "#, ); } |
