split import assist

This commit is contained in:
Aleksey Kladov 2019-01-05 13:45:18 +03:00
parent 481713a0e1
commit ea3504057e
4 changed files with 126 additions and 0 deletions

View file

@ -363,6 +363,12 @@ impl<'a> PathSegment<'a> {
}
}
impl<'a> Path<'a> {
pub fn parent_path(self) -> Option<Path<'a>> {
self.syntax().parent().and_then(Path::cast)
}
}
impl<'a> UseTree<'a> {
pub fn has_star(self) -> bool {
self.syntax().children().any(|it| it.kind() == STAR)