Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/file_structure.rs')
| -rw-r--r-- | crates/ide/src/file_structure.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/ide/src/file_structure.rs b/crates/ide/src/file_structure.rs index 568906a098..9245818584 100644 --- a/crates/ide/src/file_structure.rs +++ b/crates/ide/src/file_structure.rs @@ -197,7 +197,9 @@ fn structure_token(token: SyntaxToken) -> Option<StructureNode> { if let Some(comment) = ast::Comment::cast(token) { let text = comment.text().trim(); - if let Some(region_name) = text.strip_prefix("// region:").map(str::trim) { + if let Some(region_name) = + text.strip_prefix("// region:").map(str::trim).filter(|it| !it.is_empty()) + { return Some(StructureNode { parent: None, label: region_name.to_owned(), |