Skip to content

Commit

Permalink
lsp: Rename structs and enums
Browse files Browse the repository at this point in the history
... but only when directly on the name of the struct
when it is declared.
  • Loading branch information
hunger committed Dec 20, 2024
1 parent ff504bd commit e249c82
Show file tree
Hide file tree
Showing 4 changed files with 1,053 additions and 139 deletions.
6 changes: 6 additions & 0 deletions internal/compiler/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,12 @@ impl SyntaxNode {
.find(|n| n.kind() == kind)
.and_then(|x| x.as_token().map(|x| x.text().into()))
}
pub fn descendants(&self) -> impl Iterator<Item = SyntaxNode> {
let source_file = self.source_file.clone();
self.node
.descendants()
.map(move |node| SyntaxNode { node, source_file: source_file.clone() })
}
pub fn kind(&self) -> SyntaxKind {
self.node.kind()
}
Expand Down
Loading

0 comments on commit e249c82

Please sign in to comment.