aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-01-05 10:45:18 +0000
committerAleksey Kladov <[email protected]>2019-01-05 10:56:33 +0000
commitea3504057e73f541af64451a1b5d2c691d5c01bc (patch)
tree6e9822bea3fbda059fa02661f6e6137770885520 /crates/ra_syntax
parent481713a0e17e1557288e88a6b1a173b111792998 (diff)
split import assist
Diffstat (limited to 'crates/ra_syntax')
-rw-r--r--crates/ra_syntax/src/ast.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs
index 2a3bd27e2..c10169d90 100644
--- a/crates/ra_syntax/src/ast.rs
+++ b/crates/ra_syntax/src/ast.rs
@@ -363,6 +363,12 @@ impl<'a> PathSegment<'a> {
363 } 363 }
364} 364}
365 365
366impl<'a> Path<'a> {
367 pub fn parent_path(self) -> Option<Path<'a>> {
368 self.syntax().parent().and_then(Path::cast)
369 }
370}
371
366impl<'a> UseTree<'a> { 372impl<'a> UseTree<'a> {
367 pub fn has_star(self) -> bool { 373 pub fn has_star(self) -> bool {
368 self.syntax().children().any(|it| it.kind() == STAR) 374 self.syntax().children().any(|it| it.kind() == STAR)