Skip to content

Commit ee4505f

Browse files
bors[bot]Veykril
andauthored
Merge #9942
9942: fix: Don't trigger related highlighting on unrelated tokens r=Veykril a=Veykril bors r+ Co-authored-by: Lukas Wirth <[email protected]>
2 parents 320bb72 + 04076bc commit ee4505f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

crates/ide/src/highlight_related.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,15 @@ pub(crate) fn highlight_related(
5151
})?;
5252

5353
match token.kind() {
54-
T![fn] | T![return] | T![?] | T![->] if config.exit_points => {
54+
T![?] if config.exit_points && token.parent().and_then(ast::TryExpr::cast).is_some() => {
5555
highlight_exit_points(sema, token)
5656
}
57+
T![fn] | T![return] | T![->] if config.exit_points => highlight_exit_points(sema, token),
5758
T![await] | T![async] if config.yield_points => highlight_yield_points(token),
58-
T![break] | T![loop] | T![for] | T![while] if config.break_points => {
59+
T![for] if config.break_points && token.parent().and_then(ast::ForExpr::cast).is_some() => {
5960
highlight_break_points(token)
6061
}
62+
T![break] | T![loop] | T![while] if config.break_points => highlight_break_points(token),
6163
_ if config.references => highlight_references(sema, &syntax, position),
6264
_ => None,
6365
}

0 commit comments

Comments
 (0)