mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
fix: Allow flyimport to import primitive shadowing modules
This commit is contained in:
parent
062822ce91
commit
0851d21d1e
4 changed files with 28 additions and 2 deletions
|
@ -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(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue