mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-23 20:04:21 +00:00
Fix edge case for ImportGranularity guessing
This commit is contained in:
parent
590472607c
commit
31aad2528f
3 changed files with 30 additions and 8 deletions
|
@ -259,11 +259,14 @@ impl ast::Path {
|
|||
}
|
||||
|
||||
pub fn segments(&self) -> impl Iterator<Item = ast::PathSegment> + Clone {
|
||||
// cant make use of SyntaxNode::siblings, because the returned Iterator is not clone
|
||||
successors(self.first_segment(), |p| {
|
||||
p.parent_path().parent_path().and_then(|p| p.segment())
|
||||
})
|
||||
}
|
||||
|
||||
pub fn qualifiers(&self) -> impl Iterator<Item = ast::Path> + Clone {
|
||||
successors(self.qualifier(), |p| p.qualifier())
|
||||
}
|
||||
}
|
||||
impl ast::UseTree {
|
||||
pub fn is_simple_path(&self) -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue