From 43afa68dab929d0d0e99eb97204d24a7ca5cd397 Mon Sep 17 00:00:00 2001 From: Michael Sloan Date: Mon, 10 Feb 2025 13:01:10 -0700 Subject: [PATCH] Make migration notification not display if some bug causes no changes (#24578) When working on #24442, I did a project wide replacement of `AcceptInlineCompletion` with `AcceptEditPrediction`, as I was updating the branch to mmain and that rename had happened. This also replaced it in the migrator, causing the migration notification to always pop up on keymap changes. Checking if the migration actually changes the text makes it behave better if this variety of bug happens in the future. Release Notes: - N/A --- Cargo.lock | 1 + crates/migrator/Cargo.toml | 1 + crates/migrator/src/migrator.rs | 16 ++++++++++++---- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c5b0bd3c77..4c9bf2c525 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7878,6 +7878,7 @@ version = "0.1.0" dependencies = [ "collections", "convert_case 0.7.1", + "log", "pretty_assertions", "streaming-iterator", "tree-sitter", diff --git a/crates/migrator/Cargo.toml b/crates/migrator/Cargo.toml index 11126016a6..865f4278fe 100644 --- a/crates/migrator/Cargo.toml +++ b/crates/migrator/Cargo.toml @@ -15,6 +15,7 @@ doctest = false [dependencies] collections.workspace = true convert_case.workspace = true +log.workspace = true streaming-iterator.workspace = true tree-sitter-json.workspace = true tree-sitter.workspace = true diff --git a/crates/migrator/src/migrator.rs b/crates/migrator/src/migrator.rs index e50b702017..72016ecdfe 100644 --- a/crates/migrator/src/migrator.rs +++ b/crates/migrator/src/migrator.rs @@ -29,11 +29,19 @@ fn migrate(text: &str, patterns: MigrationPatterns, query: &Query) -> Option