mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
make enum bitflag and add trace message
This commit is contained in:
1 parent
044152e50f
commit
7966c08cc4
3 files changed
+87
-22
No files matched your search
@@ -3199,9 +3199,12 @@
|
||||
},
|
||||
"Scoped package detected, looking in '{0}'": {
|
||||
"category": "Message",
|
||||
"code": "6182"
|
||||
"code": 6182
|
||||
},
|
||||
"Reusing module resolutions originating in '{0}' since this file was not modified.": {
|
||||
"category": "Message",
|
||||
"code": 6183
|
||||
},
|
||||
|
||||
"Variable '{0}' implicitly has an '{1}' type.": {
|
||||
"category": "Error",
|
||||
"code": 7005
|
||||
|
||||
+14
-15
@@ -8,17 +8,17 @@ namespace ts {
|
||||
|
||||
|
||||
const enum StructuralChangesFromOldProgram {
|
||||
None = 0,
|
||||
NoOldProgram = 1,
|
||||
ModuleResolutionOptions = 2,
|
||||
RootNames = 3,
|
||||
TypesOptions = 4,
|
||||
SourceFileRemoved = 5,
|
||||
HasNoDefaultLib = 6,
|
||||
TripleSlashReferences = 7,
|
||||
Imports = 8,
|
||||
ModuleAugmentations = 9,
|
||||
TripleSlashTypesReferences = 10,
|
||||
None = 0,
|
||||
NoOldProgram = 1 << 1,
|
||||
ModuleResolutionOptions = 1 << 2,
|
||||
RootNames = 1 << 3,
|
||||
TypesOptions = 1 << 4,
|
||||
SourceFileRemoved = 1 << 5,
|
||||
HasNoDefaultLib = 1 << 6,
|
||||
TripleSlashReferences = 1 << 7,
|
||||
Imports = 1 << 8,
|
||||
ModuleAugmentations = 1 << 9,
|
||||
TripleSlashTypesReferences = 1 << 10,
|
||||
|
||||
CannotReuseResolution = NoOldProgram | ModuleResolutionOptions | RootNames | TypesOptions | SourceFileRemoved
|
||||
}
|
||||
@@ -520,6 +520,9 @@ namespace ts {
|
||||
const oldSourceFile = oldProgramState.program && oldProgramState.program.getSourceFile(containingFile);
|
||||
if (oldSourceFile === file) {
|
||||
// `file` is unchanged from the old program, so we can reuse old module resolutions.
|
||||
if (isTraceEnabled(options, host)) {
|
||||
trace(host, Diagnostics.Reusing_module_resolutions_originating_in_0_since_this_file_was_not_modified, file.path);
|
||||
}
|
||||
const oldSourceFileResult: ResolvedModuleFull[] = [];
|
||||
for (const moduleName of moduleNames) {
|
||||
const resolvedModule = oldSourceFile.resolvedModules.get(moduleName);
|
||||
@@ -710,10 +713,6 @@ namespace ts {
|
||||
// tentatively approve the file
|
||||
modifiedSourceFiles.push({ oldFile: oldSourceFile, newFile: newSourceFile });
|
||||
}
|
||||
else {
|
||||
// file has no changes - use it as is
|
||||
newSourceFile = oldSourceFile;
|
||||
}
|
||||
|
||||
// if file has passed all checks it should be safe to reuse it
|
||||
newSourceFiles.push(newSourceFile);
|
||||
|
||||
Reference in new issue
Block a user