From 407266629b6f7ebd04c6ffe6acfd79b9367bca81 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 15 Jul 2025 03:37:46 +0000 Subject: [PATCH] Apply formatting changes Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com> --- src/services/refactors/helpers.ts | 36 +++++++++++++++---------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/services/refactors/helpers.ts b/src/services/refactors/helpers.ts index b1810cd1b5b..2f748dc69d2 100644 --- a/src/services/refactors/helpers.ts +++ b/src/services/refactors/helpers.ts @@ -75,24 +75,24 @@ export function addTargetFileImports( * but sometimes it fails because of unresolved imports from files, or when a source file is not available for the target file (in this case when creating a new file). * So in that case, fall back to copying the import verbatim. */ - importsToCopy.forEach(([isValidTypeOnlyUseSite, declaration], symbol) => { - const targetSymbol = skipAlias(symbol, checker); - if (checker.isUnknownSymbol(targetSymbol)) { - importAdder.addVerbatimImport(Debug.checkDefined(declaration ?? findAncestor(symbol.declarations?.[0], isAnyImportOrRequireStatement))); - } - else if (targetSymbol.parent === undefined) { - if (targetSymbol.flags & SymbolFlags.Module) { - Debug.assert(declaration !== undefined, "expected module symbol to have a declaration"); - importAdder.addImportForModuleSymbol(symbol, isValidTypeOnlyUseSite, declaration); - } - else { - // If the target symbol has no parent but isn't a module, fall back to verbatim import - importAdder.addVerbatimImport(Debug.checkDefined(declaration ?? findAncestor(symbol.declarations?.[0], isAnyImportOrRequireStatement))); - } - } - else { - importAdder.addImportFromExportedSymbol(targetSymbol, isValidTypeOnlyUseSite, declaration); - } + importsToCopy.forEach(([isValidTypeOnlyUseSite, declaration], symbol) => { + const targetSymbol = skipAlias(symbol, checker); + if (checker.isUnknownSymbol(targetSymbol)) { + importAdder.addVerbatimImport(Debug.checkDefined(declaration ?? findAncestor(symbol.declarations?.[0], isAnyImportOrRequireStatement))); + } + else if (targetSymbol.parent === undefined) { + if (targetSymbol.flags & SymbolFlags.Module) { + Debug.assert(declaration !== undefined, "expected module symbol to have a declaration"); + importAdder.addImportForModuleSymbol(symbol, isValidTypeOnlyUseSite, declaration); + } + else { + // If the target symbol has no parent but isn't a module, fall back to verbatim import + importAdder.addVerbatimImport(Debug.checkDefined(declaration ?? findAncestor(symbol.declarations?.[0], isAnyImportOrRequireStatement))); + } + } + else { + importAdder.addImportFromExportedSymbol(targetSymbol, isValidTypeOnlyUseSite, declaration); + } }); addImportsForMovedSymbols(targetFileImportsFromOldFile, oldFile.fileName, importAdder, program);