aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-01-05 10:57:39 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-01-05 10:57:39 +0000
commit9b5b13dfcfe32bccbf3593eee26bf88a5fd60413 (patch)
tree6e9822bea3fbda059fa02661f6e6137770885520 /crates/ra_syntax
parent481713a0e17e1557288e88a6b1a173b111792998 (diff)
parentea3504057e73f541af64451a1b5d2c691d5c01bc (diff)
Merge #430
430: split import assist r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
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)