Delay the calculation of common source root if it would be needed when calculation dts files (#59070)

This commit is contained in:
Sheetal Nandi
2024-06-28 14:29:11 -07:00
committed by GitHub
parent 22bbe867fd
commit 6c68fdd4b5
8 changed files with 703 additions and 31 deletions
+1 -1
View File
@@ -117,7 +117,7 @@ export function getSourceMapper(host: SourceMapperHost): SourceMapper {
const declarationPath = outPath ?
removeFileExtension(outPath) + Extension.Dts :
getDeclarationEmitOutputFilePathWorker(info.fileName, program.getCompilerOptions(), currentDirectory, program.getCommonSourceDirectory(), getCanonicalFileName);
getDeclarationEmitOutputFilePathWorker(info.fileName, program.getCompilerOptions(), program);
if (declarationPath === undefined) return undefined;
const newLoc = getDocumentPositionMapper(declarationPath, info.fileName).getGeneratedPosition(info);