mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-19 18:10:25 +00:00
Upgrade rowan
Notably, new rowan comes with support for mutable syntax trees.
This commit is contained in:
parent
62ec04bbd5
commit
f5a81ec468
41 changed files with 376 additions and 176 deletions
|
@ -124,11 +124,7 @@ fn is_contextual_kw(text: &str) -> bool {
|
|||
fn find_reparsable_node(node: &SyntaxNode, range: TextRange) -> Option<(SyntaxNode, Reparser)> {
|
||||
let node = node.covering_element(range);
|
||||
|
||||
let mut ancestors = match node {
|
||||
NodeOrToken::Token(it) => it.parent().ancestors(),
|
||||
NodeOrToken::Node(it) => it.ancestors(),
|
||||
};
|
||||
ancestors.find_map(|node| {
|
||||
node.ancestors().find_map(|node| {
|
||||
let first_child = node.first_child_or_token().map(|it| it.kind());
|
||||
let parent = node.parent().map(|it| it.kind());
|
||||
Reparser::for_node(node.kind(), first_child, parent).map(|r| (node, r))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue