Skip to content

Commit 09da74a

Browse files
committed
Added case for const
1 parent 3cb78ff commit 09da74a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

crates/ide-assists/src/handlers/extract_module.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ impl Module {
389389
| SyntaxKind::ENUM_KW
390390
| SyntaxKind::TRAIT_KW
391391
| SyntaxKind::TYPE_KW
392+
| SyntaxKind::CONST_KW
392393
| SyntaxKind::MOD_KW => true,
393394
// If we didn't find a keyword, we want to cover the record fields in a struct
394395
SyntaxKind::NAME => true,
@@ -1682,7 +1683,10 @@ mod modname {
16821683
A,
16831684
/// Another variant
16841685
B { x: i32, y: i32 }
1685-
}$0
1686+
}
1687+
1688+
/// Documented const
1689+
const MY_CONST: i32 = 0;$0
16861690
",
16871691
r"
16881692
mod modname {
@@ -1765,6 +1769,9 @@ mod modname {
17651769
/// Another variant
17661770
B { x: i32, y: i32 }
17671771
}
1772+
1773+
/// Documented const
1774+
pub(crate) const MY_CONST: i32 = 0;
17681775
}
17691776
",
17701777
)

0 commit comments

Comments
 (0)