mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Fix body selection in while loops
This commit is contained in:
parent
a2cc1d6b7b
commit
87c4a4104d
4 changed files with 34 additions and 3 deletions
|
@ -85,8 +85,9 @@ fn generate_nodes(kinds: KindsSrc<'_>, grammar: &AstSrc) -> String {
|
|||
.traits
|
||||
.iter()
|
||||
.filter(|trait_name| {
|
||||
// For loops have two expressions so this might collide, therefor manual impl it
|
||||
node.name != "ForExpr" || trait_name.as_str() != "HasLoopBody"
|
||||
// Loops have two expressions so this might collide, therefor manual impl it
|
||||
node.name != "ForExpr" && node.name != "WhileExpr"
|
||||
|| trait_name.as_str() != "HasLoopBody"
|
||||
})
|
||||
.map(|trait_name| {
|
||||
let trait_name = format_ident!("{}", trait_name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue