lsp: Rename structs and enums

... but only when directly on the name of the struct
when it is declared.
This commit is contained in:
Tobias Hunger 2024-12-17 15:21:17 +01:00 committed by Tobias Hunger
parent 7893c5a00c
commit cfb2324526
4 changed files with 1018 additions and 139 deletions

View file

@ -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()
}