From b17b0d710bbbfec1e3b7f2946c44ebe316ef0309 Mon Sep 17 00:00:00 2001 From: catloversg <152669316+catloversg@users.noreply.github.com> Date: Mon, 2 Jun 2025 16:22:25 +0700 Subject: [PATCH] BUGFIX: API break detector does not detect affected code in some cases (#2172) --- src/utils/APIBreaks/APIBreak.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utils/APIBreaks/APIBreak.ts b/src/utils/APIBreaks/APIBreak.ts index 3139e4c70..8cba9498e 100644 --- a/src/utils/APIBreaks/APIBreak.ts +++ b/src/utils/APIBreaks/APIBreak.ts @@ -58,7 +58,10 @@ function detectImpactAndMigrateLines(script: Script, brokenFunctions: APIBreakIn const lines = script.content.split("\n"); for (let i = 0; i < lines.length; ++i) { for (const brokenFunction of brokenFunctions) { - if (!lines[i].includes(brokenFunction.name)) { + if ( + !lines[i].includes(brokenFunction.name) && + (!brokenFunction.migration || !lines[i].match(brokenFunction.migration.searchValue)) + ) { continue; } impactedLines.push(i + 1);