diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-01-28 18:32:58 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-01-28 18:32:58 +0100 |
| commit | 406de22ee5cd74dc6f67743bad4710415bb50c41 (patch) | |
| tree | 37536600378cd325956201ea175469bc22db2b1a /src/syntax/node.rs | |
| parent | 2d56e3c5e245bf8824bf0ea8f1f1a05cb9716dc5 (diff) | |
Remove method call syntax kind
Diffstat (limited to 'src/syntax/node.rs')
| -rw-r--r-- | src/syntax/node.rs | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/syntax/node.rs b/src/syntax/node.rs index ed000788..049275ed 100644 --- a/src/syntax/node.rs +++ b/src/syntax/node.rs @@ -681,11 +681,6 @@ impl<'a> LinkedNode<'a> { self.parent.as_deref() } - /// Get the kind of this node's parent. - pub fn parent_kind(&self) -> Option<SyntaxKind> { - Some(self.parent()?.node.kind()) - } - /// Get the first previous non-trivia sibling node. pub fn prev_sibling(&self) -> Option<Self> { let parent = self.parent()?; @@ -713,6 +708,21 @@ impl<'a> LinkedNode<'a> { Some(next) } } + + /// Get the kind of this node's parent. + pub fn parent_kind(&self) -> Option<SyntaxKind> { + Some(self.parent()?.node.kind()) + } + + /// Get the kind of this node's first previous non-trivia sibling. + pub fn prev_sibling_kind(&self) -> Option<SyntaxKind> { + Some(self.prev_sibling()?.node.kind()) + } + + /// Get the kind of this node's next non-trivia sibling. + pub fn next_sibling_kind(&self) -> Option<SyntaxKind> { + Some(self.next_sibling()?.node.kind()) + } } /// Access to leafs. |
