Skip to content

Commit

Permalink
lsp: Wire up more renaming for component, structs and enums
Browse files Browse the repository at this point in the history
... and their usages and imports/exports
  • Loading branch information
hunger committed Jan 8, 2025
1 parent aa710ce commit 9b6416d
Show file tree
Hide file tree
Showing 4 changed files with 1,530 additions and 393 deletions.
11 changes: 11 additions & 0 deletions internal/compiler/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,17 @@ impl SyntaxNode {
.descendants()
.map(move |node| SyntaxNode { node, source_file: source_file.clone() })
}
pub fn decendants_with_tokens(&self) -> impl Iterator<Item = NodeOrToken> {
let source_file = self.source_file.clone();
self.node.descendants_with_tokens().map(move |token| match token {
rowan::NodeOrToken::Node(node) => {
SyntaxNode { node, source_file: source_file.clone() }.into()
}
rowan::NodeOrToken::Token(token) => {
SyntaxToken { token, source_file: source_file.clone() }.into()
}
})
}
pub fn kind(&self) -> SyntaxKind {
self.node.kind()
}
Expand Down
Loading

0 comments on commit 9b6416d

Please sign in to comment.