Skip to content

Commit

Permalink
WIP: Wire up renaming on QualifiedNames in Elements
Browse files Browse the repository at this point in the history
Todo:

* More tests
  * as suggested by @ogoffart in slint-ui#7143
  * Rename based on InternalName and ExportName
  • Loading branch information
hunger committed Dec 20, 2024
1 parent 47188ce commit c475754
Show file tree
Hide file tree
Showing 4 changed files with 898 additions and 146 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 c475754

Please sign in to comment.