fix: Allow flyimport to import primitive shadowing modules

This commit is contained in:
Lukas Wirth 2024-07-21 13:26:19 +02:00
parent 062822ce91
commit 0851d21d1e
4 changed files with 28 additions and 2 deletions

View file

@ -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(),