From bd485146fe68bcc9b5850f1f407a3bf91c34fcf1 Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Thu, 27 Mar 2025 22:23:31 -0700 Subject: [PATCH] Add support for FixIt.Change.textualReplacement --- .../Sources/MacroEvaluation/SourceManager.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/ASTGen/Sources/MacroEvaluation/SourceManager.swift b/lib/ASTGen/Sources/MacroEvaluation/SourceManager.swift index cea6fef7f9867..380aace8ade29 100644 --- a/lib/ASTGen/Sources/MacroEvaluation/SourceManager.swift +++ b/lib/ASTGen/Sources/MacroEvaluation/SourceManager.swift @@ -216,6 +216,17 @@ extension SourceManager { at: replacementRange.upperBound ) newText = replacingChildData.newChild.description + + case .textualReplacement(replacementRange: let replacementRange, sourceFile: let sourceFile, newText: let replacementText): + replaceStartLoc = bridgedSourceLoc( + for: sourceFile, + at: replacementRange.lowerBound + ) + replaceEndLoc = bridgedSourceLoc( + for: sourceFile, + at: replacementRange.upperBound + ) + newText = replacementText } newText.withBridgedString { bridgedMessage in