From ea3504057e73f541af64451a1b5d2c691d5c01bc Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 5 Jan 2019 13:45:18 +0300 Subject: split import assist --- crates/ra_syntax/src/ast.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'crates/ra_syntax/src') 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> { } } +impl<'a> Path<'a> { + pub fn parent_path(self) -> Option> { + 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) -- cgit v1.2.3