Unnamed repository; edit this file 'description' to name the repository.
-rw-r--r--crates/ide/src/highlight_related.rs12
-rw-r--r--crates/ide/src/references.rs2
-rw-r--r--crates/rust-analyzer/src/config.rs4
-rw-r--r--docs/book/src/configuration_generated.md2
-rw-r--r--editors/code/package.json2
5 files changed, 11 insertions, 11 deletions
diff --git a/crates/ide/src/highlight_related.rs b/crates/ide/src/highlight_related.rs
index 28447005c1..77b8599fd0 100644
--- a/crates/ide/src/highlight_related.rs
+++ b/crates/ide/src/highlight_related.rs
@@ -37,7 +37,7 @@ pub struct HighlightRelatedConfig {
pub break_points: bool,
pub closure_captures: bool,
pub yield_points: bool,
- pub branches: bool,
+ pub branch_exit_points: bool,
}
type HighlightMap = FxHashMap<EditionedFileId, FxHashSet<HighlightedRange>>;
@@ -81,8 +81,8 @@ pub(crate) fn highlight_related(
T![fn] | T![return] | T![->] if config.exit_points => {
highlight_exit_points(sema, token).remove(&file_id)
}
- T![match] | T![=>] | T![if] if config.branches => {
- highlight_branches(sema, token).remove(&file_id)
+ T![match] | T![=>] | T![if] if config.branch_exit_points => {
+ highlight_branch_exit_points(sema, token).remove(&file_id)
}
T![await] | T![async] if config.yield_points => {
highlight_yield_points(sema, token).remove(&file_id)
@@ -306,7 +306,7 @@ fn highlight_references(
if res.is_empty() { None } else { Some(res.into_iter().collect()) }
}
-pub(crate) fn highlight_branches(
+pub(crate) fn highlight_branch_exit_points(
sema: &Semantics<'_, RootDatabase>,
token: SyntaxToken,
) -> FxHashMap<EditionedFileId, Vec<HighlightedRange>> {
@@ -871,7 +871,7 @@ mod tests {
references: true,
closure_captures: true,
yield_points: true,
- branches: true,
+ branch_exit_points: true,
};
#[track_caller]
@@ -2298,7 +2298,7 @@ fn main() {
#[test]
fn no_branches_when_disabled() {
- let config = HighlightRelatedConfig { branches: false, ..ENABLED_CONFIG };
+ let config = HighlightRelatedConfig { branch_exit_points: false, ..ENABLED_CONFIG };
check_with_config(
r#"
fn main() {
diff --git a/crates/ide/src/references.rs b/crates/ide/src/references.rs
index 900f49910d..205e93d7a2 100644
--- a/crates/ide/src/references.rs
+++ b/crates/ide/src/references.rs
@@ -411,7 +411,7 @@ fn handle_control_flow_keywords(
T![for] if token.parent().and_then(ast::ForExpr::cast).is_some() => {
highlight_related::highlight_break_points(sema, token)
}
- T![if] | T![=>] | T![match] => highlight_related::highlight_branches(sema, token),
+ T![if] | T![=>] | T![match] => highlight_related::highlight_branch_exit_points(sema, token),
_ => return None,
}
.into_iter()
diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs
index cc8711f2c0..e716d14075 100644
--- a/crates/rust-analyzer/src/config.rs
+++ b/crates/rust-analyzer/src/config.rs
@@ -95,7 +95,7 @@ config_data! {
/// Enables highlighting of related return values while the cursor is on any `match`, `if`, or match arm arrow (`=>`).
- highlightRelated_branches_enable: bool = true,
+ highlightRelated_branchExitPoints_enable: bool = true,
/// Enables highlighting of related references while the cursor is on `break`, `loop`, `while`, or `for` keywords.
highlightRelated_breakPoints_enable: bool = true,
/// Enables highlighting of all captures of a closure while the cursor is on the `|` or move keyword of a closure.
@@ -1631,7 +1631,7 @@ impl Config {
exit_points: self.highlightRelated_exitPoints_enable().to_owned(),
yield_points: self.highlightRelated_yieldPoints_enable().to_owned(),
closure_captures: self.highlightRelated_closureCaptures_enable().to_owned(),
- branches: self.highlightRelated_branches_enable().to_owned(),
+ branch_exit_points: self.highlightRelated_branchExitPoints_enable().to_owned(),
}
}
diff --git a/docs/book/src/configuration_generated.md b/docs/book/src/configuration_generated.md
index 587c09234c..ebac26e1d6 100644
--- a/docs/book/src/configuration_generated.md
+++ b/docs/book/src/configuration_generated.md
@@ -612,7 +612,7 @@ Default: `"client"`
Controls file watching implementation.
-## rust-analyzer.highlightRelated.branches.enable {#highlightRelated.branches.enable}
+## rust-analyzer.highlightRelated.branchExitPoints.enable {#highlightRelated.branchExitPoints.enable}
Default: `true`
diff --git a/editors/code/package.json b/editors/code/package.json
index c792ef0ffd..3cb4c21ee1 100644
--- a/editors/code/package.json
+++ b/editors/code/package.json
@@ -1532,7 +1532,7 @@
{
"title": "highlightRelated",
"properties": {
- "rust-analyzer.highlightRelated.branches.enable": {
+ "rust-analyzer.highlightRelated.branchExitPoints.enable": {
"markdownDescription": "Enables highlighting of related return values while the cursor is on any `match`, `if`, or match arm arrow (`=>`).",
"default": true,
"type": "boolean"