diff --git a/lib/tsc.js b/lib/tsc.js index acf97dc03edf96298e013a891cf66618d9b06118..907a9903a41087c641501a7bdc3d559a74b87dc3 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -43238,6 +43238,7 @@ var ts; deleteConstEnumRelate: function (path) { constEnumRelate && constEnumRelate.delete(path); }, clearQualifiedNameCache: function () { qualifiedNameCache && qualifiedNameCache.clear(); }, getCheckedSourceFiles: function () { return checkedSourceFiles; }, + collectHaveTsNoCheckFilesForLinter: function (sourceFile) { isTypeCheckerForLinter && checkedSourceFiles.add(sourceFile); }, getTypeArgumentsForResolvedSignature: getTypeArgumentsForResolvedSignature, }; function getTypeArgumentsForResolvedSignature(signature) { @@ -103697,6 +103698,9 @@ var ts; var includeBindAndCheckDiagnostics = !isTsNoCheck && (sourceFile.scriptKind === 3 || sourceFile.scriptKind === 4 || sourceFile.scriptKind === 5 || isPlainJs || isCheckJs || sourceFile.scriptKind === 7 || sourceFile.scriptKind === 8); var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray; + if (!includeBindAndCheckDiagnostics) { + typeChecker.collectHaveTsNoCheckFilesForLinter(sourceFile); + } var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray; if (isPlainJs) { bindDiagnostics = ts.filter(bindDiagnostics, function (d) { return ts.plainJSErrors.has(d.code); }); diff --git a/lib/tsserver.js b/lib/tsserver.js index 83e89b9d541567e6a9593c5bf5dd0ed64b5ed23c..1f8dc2acce7f22368ab59ce61b67cc81668cdee7 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -52421,6 +52421,7 @@ var ts; deleteConstEnumRelate: function (path) { constEnumRelate && constEnumRelate.delete(path); }, clearQualifiedNameCache: function () { qualifiedNameCache && qualifiedNameCache.clear(); }, getCheckedSourceFiles: function () { return checkedSourceFiles; }, + collectHaveTsNoCheckFilesForLinter: function (sourceFile) { isTypeCheckerForLinter && checkedSourceFiles.add(sourceFile); }, getTypeArgumentsForResolvedSignature: getTypeArgumentsForResolvedSignature, }; function getTypeArgumentsForResolvedSignature(signature) { @@ -124864,6 +124865,13 @@ var ts; var includeBindAndCheckDiagnostics = !isTsNoCheck && (sourceFile.scriptKind === 3 /* ScriptKind.TS */ || sourceFile.scriptKind === 4 /* ScriptKind.TSX */ || sourceFile.scriptKind === 5 /* ScriptKind.External */ || isPlainJs || isCheckJs || sourceFile.scriptKind === 7 /* ScriptKind.Deferred */ || sourceFile.scriptKind === 8 /* ScriptKind.ETS */); var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray; + if (!includeBindAndCheckDiagnostics) { + // Record that this file has @ts-nocheck directive for ArkTS linter check + typeChecker.collectHaveTsNoCheckFilesForLinter(sourceFile); + } + // Get the type checking diagnostics for this file: + // - If diagnostics are enabled: get all type checking errors/warnings + // - If disabled (due to @ts-nocheck or other reasons): return empty array var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray; if (isPlainJs) { bindDiagnostics = ts.filter(bindDiagnostics, function (d) { return ts.plainJSErrors.has(d.code); }); @@ -201354,6 +201362,7 @@ var ts; ArkTSLinter_1_1.LibraryTypeCallDiagnosticCheckerNamespace.LibraryTypeCallDiagnosticChecker.instance.clear(); } function collectChangedFilesFromProgramState(state, tsTypeChecker, arkTSVersion, compatibleSdkVersion, compatibleSdkVersionStage) { + var changedFiles = new ts.Set(state.changedFilesSet); // If old arkTSVersion from last run is not same current arkTSVersion from ets_loader, // the process all files in project. // The compatibleSdkVersion and compatibleSdkVersionStage is the same as arkTSVersion @@ -201362,6 +201371,18 @@ var ts; state.compatibleSdkVersionStage !== compatibleSdkVersionStage) { return new ts.Set(ts.arrayFrom(state.fileInfos.keys())); } + // If any source file that affects global scope has been changed, + // then process all files in project. + for (var _i = 0, _a = ts.arrayFrom(changedFiles.keys()); _i < _a.length; _i++) { + var changedFile = _a[_i]; + var fileInfo = state.fileInfos.get(changedFile); + if (fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.affectsGlobalScope) { + return new ts.Set(ts.arrayFrom(state.fileInfos.keys())); + } + } + if (!state.referencedMap) { + return changedFiles; + } var changeSources = tsTypeChecker.getCheckedSourceFiles(); var targetSet = new ts.Set(); changeSources.forEach(function (x) { return targetSet.add(x.path); }); diff --git a/lib/tsserverlibrary.d.ts b/lib/tsserverlibrary.d.ts index fd484321a48d12f3b9dccff53a00bcaa47f5be9f..b86d15474f2c16ac2348ec87a7b0f1dd871cab82 100644 --- a/lib/tsserverlibrary.d.ts +++ b/lib/tsserverlibrary.d.ts @@ -2546,6 +2546,7 @@ declare namespace ts { getTypeArgumentsForResolvedSignature(signature: Signature): readonly Type[] | undefined; clearQualifiedNameCache?(): void; getCheckedSourceFiles(): Set; + collectHaveTsNoCheckFilesForLinter(sourceFile: SourceFile): void; } export enum NodeBuilderFlags { None = 0, diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index fd0d4dfbd9e8dd2a82b1b785a62e1fa001b987bb..b4c7798f23cca48af63ddf520f41963cdb1d254c 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -52420,6 +52420,7 @@ var ts; deleteConstEnumRelate: function (path) { constEnumRelate && constEnumRelate.delete(path); }, clearQualifiedNameCache: function () { qualifiedNameCache && qualifiedNameCache.clear(); }, getCheckedSourceFiles: function () { return checkedSourceFiles; }, + collectHaveTsNoCheckFilesForLinter: function (sourceFile) { isTypeCheckerForLinter && checkedSourceFiles.add(sourceFile); }, getTypeArgumentsForResolvedSignature: getTypeArgumentsForResolvedSignature, }; function getTypeArgumentsForResolvedSignature(signature) { @@ -124863,6 +124864,13 @@ var ts; var includeBindAndCheckDiagnostics = !isTsNoCheck && (sourceFile.scriptKind === 3 /* ScriptKind.TS */ || sourceFile.scriptKind === 4 /* ScriptKind.TSX */ || sourceFile.scriptKind === 5 /* ScriptKind.External */ || isPlainJs || isCheckJs || sourceFile.scriptKind === 7 /* ScriptKind.Deferred */ || sourceFile.scriptKind === 8 /* ScriptKind.ETS */); var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray; + if (!includeBindAndCheckDiagnostics) { + // Record that this file has @ts-nocheck directive for ArkTS linter check + typeChecker.collectHaveTsNoCheckFilesForLinter(sourceFile); + } + // Get the type checking diagnostics for this file: + // - If diagnostics are enabled: get all type checking errors/warnings + // - If disabled (due to @ts-nocheck or other reasons): return empty array var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray; if (isPlainJs) { bindDiagnostics = ts.filter(bindDiagnostics, function (d) { return ts.plainJSErrors.has(d.code); }); @@ -201099,6 +201107,7 @@ var ts; ArkTSLinter_1_1.LibraryTypeCallDiagnosticCheckerNamespace.LibraryTypeCallDiagnosticChecker.instance.clear(); } function collectChangedFilesFromProgramState(state, tsTypeChecker, arkTSVersion, compatibleSdkVersion, compatibleSdkVersionStage) { + var changedFiles = new ts.Set(state.changedFilesSet); // If old arkTSVersion from last run is not same current arkTSVersion from ets_loader, // the process all files in project. // The compatibleSdkVersion and compatibleSdkVersionStage is the same as arkTSVersion @@ -201107,6 +201116,18 @@ var ts; state.compatibleSdkVersionStage !== compatibleSdkVersionStage) { return new ts.Set(ts.arrayFrom(state.fileInfos.keys())); } + // If any source file that affects global scope has been changed, + // then process all files in project. + for (var _i = 0, _a = ts.arrayFrom(changedFiles.keys()); _i < _a.length; _i++) { + var changedFile = _a[_i]; + var fileInfo = state.fileInfos.get(changedFile); + if (fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.affectsGlobalScope) { + return new ts.Set(ts.arrayFrom(state.fileInfos.keys())); + } + } + if (!state.referencedMap) { + return changedFiles; + } var changeSources = tsTypeChecker.getCheckedSourceFiles(); var targetSet = new ts.Set(); changeSources.forEach(function (x) { return targetSet.add(x.path); }); diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts index dd5db7f11f240cec721140b929e1c05676599e1c..6a74eb1412b705be2521648f8909d88717aa93e2 100644 --- a/lib/typescript.d.ts +++ b/lib/typescript.d.ts @@ -2546,6 +2546,7 @@ declare namespace ts { getTypeArgumentsForResolvedSignature(signature: Signature): readonly Type[] | undefined; clearQualifiedNameCache?(): void; getCheckedSourceFiles(): Set; + collectHaveTsNoCheckFilesForLinter(sourceFile: SourceFile): void; } export enum NodeBuilderFlags { None = 0, diff --git a/lib/typescript.js b/lib/typescript.js index ad38dd9049459ed90db2e3d4732a7891ad8122ef..66909a24d82d8175bb4461dc66a60dd055a56b57 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -52411,6 +52411,7 @@ var ts; deleteConstEnumRelate: function (path) { constEnumRelate && constEnumRelate.delete(path); }, clearQualifiedNameCache: function () { qualifiedNameCache && qualifiedNameCache.clear(); }, getCheckedSourceFiles: function () { return checkedSourceFiles; }, + collectHaveTsNoCheckFilesForLinter: function (sourceFile) { isTypeCheckerForLinter && checkedSourceFiles.add(sourceFile); }, getTypeArgumentsForResolvedSignature: getTypeArgumentsForResolvedSignature, }; function getTypeArgumentsForResolvedSignature(signature) { @@ -124854,6 +124855,13 @@ var ts; var includeBindAndCheckDiagnostics = !isTsNoCheck && (sourceFile.scriptKind === 3 /* ScriptKind.TS */ || sourceFile.scriptKind === 4 /* ScriptKind.TSX */ || sourceFile.scriptKind === 5 /* ScriptKind.External */ || isPlainJs || isCheckJs || sourceFile.scriptKind === 7 /* ScriptKind.Deferred */ || sourceFile.scriptKind === 8 /* ScriptKind.ETS */); var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray; + if (!includeBindAndCheckDiagnostics) { + // Record that this file has @ts-nocheck directive for ArkTS linter check + typeChecker.collectHaveTsNoCheckFilesForLinter(sourceFile); + } + // Get the type checking diagnostics for this file: + // - If diagnostics are enabled: get all type checking errors/warnings + // - If disabled (due to @ts-nocheck or other reasons): return empty array var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray; if (isPlainJs) { bindDiagnostics = ts.filter(bindDiagnostics, function (d) { return ts.plainJSErrors.has(d.code); }); @@ -190193,6 +190201,7 @@ var ts; ArkTSLinter_1_1.LibraryTypeCallDiagnosticCheckerNamespace.LibraryTypeCallDiagnosticChecker.instance.clear(); } function collectChangedFilesFromProgramState(state, tsTypeChecker, arkTSVersion, compatibleSdkVersion, compatibleSdkVersionStage) { + var changedFiles = new ts.Set(state.changedFilesSet); // If old arkTSVersion from last run is not same current arkTSVersion from ets_loader, // the process all files in project. // The compatibleSdkVersion and compatibleSdkVersionStage is the same as arkTSVersion @@ -190201,6 +190210,18 @@ var ts; state.compatibleSdkVersionStage !== compatibleSdkVersionStage) { return new ts.Set(ts.arrayFrom(state.fileInfos.keys())); } + // If any source file that affects global scope has been changed, + // then process all files in project. + for (var _i = 0, _a = ts.arrayFrom(changedFiles.keys()); _i < _a.length; _i++) { + var changedFile = _a[_i]; + var fileInfo = state.fileInfos.get(changedFile); + if (fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.affectsGlobalScope) { + return new ts.Set(ts.arrayFrom(state.fileInfos.keys())); + } + } + if (!state.referencedMap) { + return changedFiles; + } var changeSources = tsTypeChecker.getCheckedSourceFiles(); var targetSet = new ts.Set(); changeSources.forEach(function (x) { return targetSet.add(x.path); }); diff --git a/lib/typescriptServices.d.ts b/lib/typescriptServices.d.ts index ce5e9eab789fb203cfefa6ac53fa2d194864a5bc..a273ee24d7102879fdd3f73f1ff695b05e42e656 100644 --- a/lib/typescriptServices.d.ts +++ b/lib/typescriptServices.d.ts @@ -2546,6 +2546,7 @@ declare namespace ts { getTypeArgumentsForResolvedSignature(signature: Signature): readonly Type[] | undefined; clearQualifiedNameCache?(): void; getCheckedSourceFiles(): Set; + collectHaveTsNoCheckFilesForLinter(sourceFile: SourceFile): void; } export enum NodeBuilderFlags { None = 0, diff --git a/lib/typescriptServices.js b/lib/typescriptServices.js index 551bd495765812cf8b3ec4d9e1f36f2b18a06a99..ed6f3541faff1d4f2133495138f7a9cabe20ff21 100644 --- a/lib/typescriptServices.js +++ b/lib/typescriptServices.js @@ -52411,6 +52411,7 @@ var ts; deleteConstEnumRelate: function (path) { constEnumRelate && constEnumRelate.delete(path); }, clearQualifiedNameCache: function () { qualifiedNameCache && qualifiedNameCache.clear(); }, getCheckedSourceFiles: function () { return checkedSourceFiles; }, + collectHaveTsNoCheckFilesForLinter: function (sourceFile) { isTypeCheckerForLinter && checkedSourceFiles.add(sourceFile); }, getTypeArgumentsForResolvedSignature: getTypeArgumentsForResolvedSignature, }; function getTypeArgumentsForResolvedSignature(signature) { @@ -124854,6 +124855,13 @@ var ts; var includeBindAndCheckDiagnostics = !isTsNoCheck && (sourceFile.scriptKind === 3 /* ScriptKind.TS */ || sourceFile.scriptKind === 4 /* ScriptKind.TSX */ || sourceFile.scriptKind === 5 /* ScriptKind.External */ || isPlainJs || isCheckJs || sourceFile.scriptKind === 7 /* ScriptKind.Deferred */ || sourceFile.scriptKind === 8 /* ScriptKind.ETS */); var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray; + if (!includeBindAndCheckDiagnostics) { + // Record that this file has @ts-nocheck directive for ArkTS linter check + typeChecker.collectHaveTsNoCheckFilesForLinter(sourceFile); + } + // Get the type checking diagnostics for this file: + // - If diagnostics are enabled: get all type checking errors/warnings + // - If disabled (due to @ts-nocheck or other reasons): return empty array var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray; if (isPlainJs) { bindDiagnostics = ts.filter(bindDiagnostics, function (d) { return ts.plainJSErrors.has(d.code); }); @@ -190193,6 +190201,7 @@ var ts; ArkTSLinter_1_1.LibraryTypeCallDiagnosticCheckerNamespace.LibraryTypeCallDiagnosticChecker.instance.clear(); } function collectChangedFilesFromProgramState(state, tsTypeChecker, arkTSVersion, compatibleSdkVersion, compatibleSdkVersionStage) { + var changedFiles = new ts.Set(state.changedFilesSet); // If old arkTSVersion from last run is not same current arkTSVersion from ets_loader, // the process all files in project. // The compatibleSdkVersion and compatibleSdkVersionStage is the same as arkTSVersion @@ -190201,6 +190210,18 @@ var ts; state.compatibleSdkVersionStage !== compatibleSdkVersionStage) { return new ts.Set(ts.arrayFrom(state.fileInfos.keys())); } + // If any source file that affects global scope has been changed, + // then process all files in project. + for (var _i = 0, _a = ts.arrayFrom(changedFiles.keys()); _i < _a.length; _i++) { + var changedFile = _a[_i]; + var fileInfo = state.fileInfos.get(changedFile); + if (fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.affectsGlobalScope) { + return new ts.Set(ts.arrayFrom(state.fileInfos.keys())); + } + } + if (!state.referencedMap) { + return changedFiles; + } var changeSources = tsTypeChecker.getCheckedSourceFiles(); var targetSet = new ts.Set(); changeSources.forEach(function (x) { return targetSet.add(x.path); }); diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js index 6b21cc6c4af070bf76da2cb4732d0cc431d7e32a..0f22525e48675c688046143cf55b3a801251cd6a 100644 --- a/lib/typingsInstaller.js +++ b/lib/typingsInstaller.js @@ -52401,6 +52401,7 @@ var ts; deleteConstEnumRelate: function (path) { constEnumRelate && constEnumRelate.delete(path); }, clearQualifiedNameCache: function () { qualifiedNameCache && qualifiedNameCache.clear(); }, getCheckedSourceFiles: function () { return checkedSourceFiles; }, + collectHaveTsNoCheckFilesForLinter: function (sourceFile) { isTypeCheckerForLinter && checkedSourceFiles.add(sourceFile); }, getTypeArgumentsForResolvedSignature: getTypeArgumentsForResolvedSignature, }; function getTypeArgumentsForResolvedSignature(signature) { @@ -124844,6 +124845,13 @@ var ts; var includeBindAndCheckDiagnostics = !isTsNoCheck && (sourceFile.scriptKind === 3 /* ScriptKind.TS */ || sourceFile.scriptKind === 4 /* ScriptKind.TSX */ || sourceFile.scriptKind === 5 /* ScriptKind.External */ || isPlainJs || isCheckJs || sourceFile.scriptKind === 7 /* ScriptKind.Deferred */ || sourceFile.scriptKind === 8 /* ScriptKind.ETS */); var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray; + if (!includeBindAndCheckDiagnostics) { + // Record that this file has @ts-nocheck directive for ArkTS linter check + typeChecker.collectHaveTsNoCheckFilesForLinter(sourceFile); + } + // Get the type checking diagnostics for this file: + // - If diagnostics are enabled: get all type checking errors/warnings + // - If disabled (due to @ts-nocheck or other reasons): return empty array var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray; if (isPlainJs) { bindDiagnostics = ts.filter(bindDiagnostics, function (d) { return ts.plainJSErrors.has(d.code); }); diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 28648286be68dc17229fc483abd05954445ad2ff..0338d9ef183a7d8a1f83268f2e66ae24db4f12c7 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -769,6 +769,7 @@ namespace ts { deleteConstEnumRelate: (path: string) => {constEnumRelate && constEnumRelate.delete(path)}, clearQualifiedNameCache: () => {qualifiedNameCache && qualifiedNameCache.clear()}, getCheckedSourceFiles: () => checkedSourceFiles, + collectHaveTsNoCheckFilesForLinter: (sourceFile: SourceFile) => {isTypeCheckerForLinter && checkedSourceFiles.add(sourceFile)}, getTypeArgumentsForResolvedSignature, }; diff --git a/src/compiler/program.ts b/src/compiler/program.ts index d76f4f355808974de20a0a13145056427c118729..42823a2deaa9ff4e237f67c677c89ed16c7c7bb5 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -2347,6 +2347,13 @@ namespace ts { const includeBindAndCheckDiagnostics = !isTsNoCheck && (sourceFile.scriptKind === ScriptKind.TS || sourceFile.scriptKind === ScriptKind.TSX || sourceFile.scriptKind === ScriptKind.External || isPlainJs || isCheckJs || sourceFile.scriptKind === ScriptKind.Deferred || sourceFile.scriptKind === ScriptKind.ETS); let bindDiagnostics: readonly Diagnostic[] = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : emptyArray; + if (!includeBindAndCheckDiagnostics) { + // Record that this file has @ts-nocheck directive for ArkTS linter check + typeChecker.collectHaveTsNoCheckFilesForLinter(sourceFile); + } + // Get the type checking diagnostics for this file: + // - If diagnostics are enabled: get all type checking errors/warnings + // - If disabled (due to @ts-nocheck or other reasons): return empty array let checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : emptyArray; if (isPlainJs) { bindDiagnostics = filter(bindDiagnostics, d => plainJSErrors.has(d.code)); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 9930f8b8991d43e0e9b9c63831c1c293ed8799bb..a31fcebda4dcfafae0209fbb4d8e418de7bfcb72 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -4987,6 +4987,7 @@ namespace ts { getTypeArgumentsForResolvedSignature(signature: Signature): readonly Type[] | undefined; clearQualifiedNameCache?(): void; getCheckedSourceFiles(): Set; + collectHaveTsNoCheckFilesForLinter(sourceFile: SourceFile): void; } /* @internal */ diff --git a/src/linter/ArkTSLinter_1_1/LinterRunner.ts b/src/linter/ArkTSLinter_1_1/LinterRunner.ts index 91ee09456504b51a815bb32341183e08d2faa135..51dceada00c06de41428d1f99fa4a63034245dde 100644 --- a/src/linter/ArkTSLinter_1_1/LinterRunner.ts +++ b/src/linter/ArkTSLinter_1_1/LinterRunner.ts @@ -165,6 +165,8 @@ function collectChangedFilesFromProgramState( compatibleSdkVersion?: number, compatibleSdkVersionStage?: string ): Set { + const changedFiles = new Set(state.changedFilesSet); + // If old arkTSVersion from last run is not same current arkTSVersion from ets_loader, // the process all files in project. // The compatibleSdkVersion and compatibleSdkVersionStage is the same as arkTSVersion @@ -175,7 +177,20 @@ function collectChangedFilesFromProgramState( ) { return new Set(arrayFrom(state.fileInfos.keys())); } - + + // If any source file that affects global scope has been changed, + // then process all files in project. + for (const changedFile of arrayFrom(changedFiles.keys())) { + const fileInfo = state.fileInfos.get(changedFile); + if (fileInfo?.affectsGlobalScope) { + return new Set(arrayFrom(state.fileInfos.keys())); + } + } + + if (!state.referencedMap) { + return changedFiles; + } + const changeSources = tsTypeChecker.getCheckedSourceFiles(); const targetSet = new Set(); changeSources.forEach(x => targetSet.add(x.path)); diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index fd484321a48d12f3b9dccff53a00bcaa47f5be9f..b86d15474f2c16ac2348ec87a7b0f1dd871cab82 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -2546,6 +2546,7 @@ declare namespace ts { getTypeArgumentsForResolvedSignature(signature: Signature): readonly Type[] | undefined; clearQualifiedNameCache?(): void; getCheckedSourceFiles(): Set; + collectHaveTsNoCheckFilesForLinter(sourceFile: SourceFile): void; } export enum NodeBuilderFlags { None = 0, diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index dd5db7f11f240cec721140b929e1c05676599e1c..6a74eb1412b705be2521648f8909d88717aa93e2 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -2546,6 +2546,7 @@ declare namespace ts { getTypeArgumentsForResolvedSignature(signature: Signature): readonly Type[] | undefined; clearQualifiedNameCache?(): void; getCheckedSourceFiles(): Set; + collectHaveTsNoCheckFilesForLinter(sourceFile: SourceFile): void; } export enum NodeBuilderFlags { None = 0,