Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,15 @@ impl<L: Language> SyntaxNode<L> {
}

/// Find a token in the subtree corresponding to this node, which covers the offset.
/// Precondition: offset must be withing node's range.
/// Precondition: offset must be within node's range.
pub fn token_at_offset(&self, offset: TextSize) -> TokenAtOffset<SyntaxToken<L>> {
self.raw.token_at_offset(offset).map(SyntaxToken::from)
}

/// Return the deepest node or token in the current subtree that fully
/// contains the range. If the range is empty and is contained in two leaf
/// nodes, either one can be returned. Precondition: range must be contained
/// withing the current node
/// within the current node
pub fn covering_element(&self, range: TextRange) -> SyntaxElement<L> {
NodeOrToken::from(self.raw.covering_element(range))
}
Expand Down
2 changes: 1 addition & 1 deletion src/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ impl NodeData {

match self.green() {
NodeOrToken::Node(green) => {
// Child is root, so it ownes the green node. Steal it!
// Child is root, so it owns the green node. Steal it!
let child_green = match &child.green {
Green::Node { ptr } => unsafe { GreenNode::from_raw(ptr.get()).into() },
Green::Token { ptr } => unsafe { GreenToken::from_raw(*ptr).into() },
Expand Down