⬆️ rust-analyzer

Merge commit '368e0bb32f'
This commit is contained in:
arcnmx 2023-01-09 10:36:22 -08:00
parent b3ef934ccb
commit 25242fe93f
395 changed files with 14569 additions and 5755 deletions

View file

@ -110,7 +110,7 @@ fn highlight_references(
.and_then(|decl| decl.focus_range)
.map(|range| {
let category =
references::decl_mutability(&def, node, range).then(|| ReferenceCategory::Write);
references::decl_mutability(&def, node, range).then_some(ReferenceCategory::Write);
HighlightedRange { range, category }
});
if let Some(hl_range) = hl_range {
@ -365,7 +365,7 @@ mod tests {
let mut expected = annotations
.into_iter()
.map(|(r, access)| (r.range, (!access.is_empty()).then(|| access)))
.map(|(r, access)| (r.range, (!access.is_empty()).then_some(access)))
.collect::<Vec<_>>();
let mut actual = hls
@ -765,6 +765,23 @@ fn foo() ->$0 u32 {
);
}
#[test]
fn test_hl_inner_tail_exit_points_loops() {
check(
r#"
fn foo() ->$0 u32 {
'foo: while { return 0; true } {
// ^^^^^^
break 'foo 0;
// ^^^^^
return 0;
// ^^^^^^
}
}
"#,
);
}
#[test]
fn test_hl_break_loop() {
check(