mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-18 17:40:29 +00:00
Allow to disable import insertion on single path glob imports
This commit is contained in:
parent
84507a0b9c
commit
2ee090faaf
14 changed files with 99 additions and 17 deletions
|
@ -281,6 +281,15 @@ impl ast::Path {
|
|||
successors(self.qualifier(), |p| p.qualifier())
|
||||
}
|
||||
}
|
||||
|
||||
impl ast::Use {
|
||||
pub fn is_simple_glob(&self) -> bool {
|
||||
self.use_tree()
|
||||
.map(|use_tree| use_tree.use_tree_list().is_none() && use_tree.star_token().is_some())
|
||||
.unwrap_or(false)
|
||||
}
|
||||
}
|
||||
|
||||
impl ast::UseTree {
|
||||
pub fn is_simple_path(&self) -> bool {
|
||||
self.use_tree_list().is_none() && self.star_token().is_none()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue