Skip to content

Commit

Permalink
unresolved imports of empty array and undefined are same
Browse files Browse the repository at this point in the history
  • Loading branch information
sheetalkamat committed Nov 28, 2023
1 parent a705d20 commit ec26f33
Show file tree
Hide file tree
Showing 106 changed files with 5 additions and 870 deletions.
10 changes: 5 additions & 5 deletions src/server/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,9 @@ function compilerOptionsChangeRequiresRefresh(opt1: CompilerOptions, opt2: Compi
}

function unresolvedImportsChanged(imports1: SortedReadonlyArray<string> | undefined, imports2: SortedReadonlyArray<string> | undefined): boolean {
if (imports1 === imports2) {
return false;
}
if (imports1 === imports2) return false;
// undefined and 0 length array are same
if (!imports1?.length === !imports2?.length) return false;
return !arrayIsEqualTo(imports1, imports2);
}

Expand Down Expand Up @@ -1500,13 +1500,13 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo
this.typingsCacheEntry = {
compilerOptions: this.getCompilationSettings(),
typeAcquisition,
unresolvedImports: this.lastCachedUnresolvedImportsList,
unresolvedImports: this.lastCachedUnresolvedImportsList?.length ? this.lastCachedUnresolvedImportsList : undefined,
};
// something has been changed, issue a request to update typings
this.projectService.typingsInstaller.enqueueInstallTypingsRequest(
this,
typeAcquisition,
this.lastCachedUnresolvedImportsList,
this.typingsCacheEntry.unresolvedImports,
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,12 @@ TI:: [hh:mm:ss:mss] Got install request
"include": [],
"exclude": []
},
"unresolvedImports": [],
"projectRootPath": "/node_modules/@angular/forms",
"kind": "discover"
}
TI:: [hh:mm:ss:mss] Failed to load safelist from types map file '/typesMap.json'
TI:: [hh:mm:ss:mss] Explicitly included types: []
TI:: [hh:mm:ss:mss] Typing names in '/node_modules/@angular/forms/package.json' dependencies: []
TI:: [hh:mm:ss:mss] Inferred typings from unresolved imports: []
TI:: [hh:mm:ss:mss] Finished typings discovery:
{
"cachedTypingPaths": [],
Expand Down Expand Up @@ -136,7 +134,6 @@ TI:: [hh:mm:ss:mss] Sending response:
"noEmitForJsFiles": true
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
Info seq [hh:mm:ss:mss] event:
Expand All @@ -159,7 +156,6 @@ Info seq [hh:mm:ss:mss] event:
"noEmitForJsFiles": true
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,14 +361,12 @@ TI:: [hh:mm:ss:mss] Got install request
"include": [],
"exclude": []
},
"unresolvedImports": [],
"projectRootPath": "/node_modules/@angular/forms",
"kind": "discover"
}
TI:: [hh:mm:ss:mss] Failed to load safelist from types map file '/typesMap.json'
TI:: [hh:mm:ss:mss] Explicitly included types: []
TI:: [hh:mm:ss:mss] Typing names in '/node_modules/@angular/forms/package.json' dependencies: []
TI:: [hh:mm:ss:mss] Inferred typings from unresolved imports: []
TI:: [hh:mm:ss:mss] Finished typings discovery:
{
"cachedTypingPaths": [],
Expand Down Expand Up @@ -410,7 +408,6 @@ TI:: [hh:mm:ss:mss] Sending response:
"noEmitForJsFiles": true
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
Info seq [hh:mm:ss:mss] event:
Expand All @@ -433,7 +430,6 @@ Info seq [hh:mm:ss:mss] event:
"noEmitForJsFiles": true
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,12 @@ TI:: [hh:mm:ss:mss] Got install request
"include": [],
"exclude": []
},
"unresolvedImports": [],
"projectRootPath": "/node_modules/@angular/forms",
"kind": "discover"
}
TI:: [hh:mm:ss:mss] Failed to load safelist from types map file '/typesMap.json'
TI:: [hh:mm:ss:mss] Explicitly included types: []
TI:: [hh:mm:ss:mss] Typing names in '/node_modules/@angular/forms/package.json' dependencies: ["@angular/core"]
TI:: [hh:mm:ss:mss] Inferred typings from unresolved imports: []
TI:: [hh:mm:ss:mss] Finished typings discovery:
{
"cachedTypingPaths": [],
Expand Down Expand Up @@ -138,7 +136,6 @@ TI:: [hh:mm:ss:mss] Sending response:
"noEmitForJsFiles": true
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
Info seq [hh:mm:ss:mss] event:
Expand All @@ -161,7 +158,6 @@ Info seq [hh:mm:ss:mss] event:
"noEmitForJsFiles": true
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,11 @@ TI:: [hh:mm:ss:mss] Got install request
"include": [],
"exclude": []
},
"unresolvedImports": [],
"projectRootPath": "/",
"kind": "discover"
}
TI:: [hh:mm:ss:mss] Failed to load safelist from types map file '/typesMap.json'
TI:: [hh:mm:ss:mss] Explicitly included types: []
TI:: [hh:mm:ss:mss] Inferred typings from unresolved imports: []
TI:: [hh:mm:ss:mss] Finished typings discovery:
{
"cachedTypingPaths": [],
Expand Down Expand Up @@ -248,7 +246,6 @@ TI:: [hh:mm:ss:mss] Sending response:
"maxNodeModuleJsDepth": 2
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
Info seq [hh:mm:ss:mss] event:
Expand All @@ -272,7 +269,6 @@ Info seq [hh:mm:ss:mss] event:
"maxNodeModuleJsDepth": 2
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,11 @@ TI:: [hh:mm:ss:mss] Got install request
"include": [],
"exclude": []
},
"unresolvedImports": [],
"projectRootPath": "e:/myproject/src",
"kind": "discover"
}
TI:: [hh:mm:ss:mss] Failed to load safelist from types map file '/typesMap.json'
TI:: [hh:mm:ss:mss] Explicitly included types: []
TI:: [hh:mm:ss:mss] Inferred typings from unresolved imports: []
TI:: [hh:mm:ss:mss] Finished typings discovery:
{
"cachedTypingPaths": [],
Expand Down Expand Up @@ -281,7 +279,6 @@ TI:: [hh:mm:ss:mss] Sending response:
"maxNodeModuleJsDepth": 2
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
Info seq [hh:mm:ss:mss] event:
Expand All @@ -305,7 +302,6 @@ Info seq [hh:mm:ss:mss] event:
"maxNodeModuleJsDepth": 2
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,11 @@ TI:: [hh:mm:ss:mss] Got install request
"include": [],
"exclude": []
},
"unresolvedImports": [],
"projectRootPath": "/root/teams/VSCode68/Shared Documents/General/jt-ts-test-workspace",
"kind": "discover"
}
TI:: [hh:mm:ss:mss] Failed to load safelist from types map file '/typesMap.json'
TI:: [hh:mm:ss:mss] Explicitly included types: []
TI:: [hh:mm:ss:mss] Inferred typings from unresolved imports: []
TI:: [hh:mm:ss:mss] Finished typings discovery:
{
"cachedTypingPaths": [],
Expand Down Expand Up @@ -171,7 +169,6 @@ TI:: [hh:mm:ss:mss] Sending response:
"maxNodeModuleJsDepth": 2
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
Info seq [hh:mm:ss:mss] event:
Expand All @@ -195,7 +192,6 @@ Info seq [hh:mm:ss:mss] event:
"maxNodeModuleJsDepth": 2
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,11 @@ TI:: [hh:mm:ss:mss] Got install request
"include": [],
"exclude": []
},
"unresolvedImports": [],
"projectRootPath": "/root/teams/VSCode68/Shared Documents/General/jt-ts-test-workspace",
"kind": "discover"
}
TI:: [hh:mm:ss:mss] Failed to load safelist from types map file '/typesMap.json'
TI:: [hh:mm:ss:mss] Explicitly included types: []
TI:: [hh:mm:ss:mss] Inferred typings from unresolved imports: []
TI:: [hh:mm:ss:mss] Finished typings discovery:
{
"cachedTypingPaths": [],
Expand Down Expand Up @@ -172,7 +170,6 @@ TI:: [hh:mm:ss:mss] Sending response:
"maxNodeModuleJsDepth": 2
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
Info seq [hh:mm:ss:mss] event:
Expand All @@ -196,7 +193,6 @@ Info seq [hh:mm:ss:mss] event:
"maxNodeModuleJsDepth": 2
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,13 +338,11 @@ TI:: [hh:mm:ss:mss] Got install request
"include": [],
"exclude": []
},
"unresolvedImports": [],
"projectRootPath": "/",
"kind": "discover"
}
TI:: [hh:mm:ss:mss] Failed to load safelist from types map file '/typesMap.json'
TI:: [hh:mm:ss:mss] Explicitly included types: []
TI:: [hh:mm:ss:mss] Inferred typings from unresolved imports: []
TI:: [hh:mm:ss:mss] Finished typings discovery:
{
"cachedTypingPaths": [],
Expand Down Expand Up @@ -384,7 +382,6 @@ TI:: [hh:mm:ss:mss] Sending response:
"maxNodeModuleJsDepth": 2
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
Info seq [hh:mm:ss:mss] event:
Expand All @@ -408,7 +405,6 @@ Info seq [hh:mm:ss:mss] event:
"maxNodeModuleJsDepth": 2
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,13 +316,11 @@ TI:: [hh:mm:ss:mss] Got install request
"include": [],
"exclude": []
},
"unresolvedImports": [],
"projectRootPath": "/",
"kind": "discover"
}
TI:: [hh:mm:ss:mss] Failed to load safelist from types map file '/typesMap.json'
TI:: [hh:mm:ss:mss] Explicitly included types: []
TI:: [hh:mm:ss:mss] Inferred typings from unresolved imports: []
TI:: [hh:mm:ss:mss] Finished typings discovery:
{
"cachedTypingPaths": [],
Expand Down Expand Up @@ -361,7 +359,6 @@ TI:: [hh:mm:ss:mss] Sending response:
"noEmitForJsFiles": true
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
Info seq [hh:mm:ss:mss] event:
Expand All @@ -384,7 +381,6 @@ Info seq [hh:mm:ss:mss] event:
"noEmitForJsFiles": true
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,11 @@ TI:: [hh:mm:ss:mss] Got install request
"include": [],
"exclude": []
},
"unresolvedImports": [],
"projectRootPath": "/",
"kind": "discover"
}
TI:: [hh:mm:ss:mss] Failed to load safelist from types map file '/typesMap.json'
TI:: [hh:mm:ss:mss] Explicitly included types: []
TI:: [hh:mm:ss:mss] Inferred typings from unresolved imports: []
TI:: [hh:mm:ss:mss] Finished typings discovery:
{
"cachedTypingPaths": [],
Expand Down Expand Up @@ -158,7 +156,6 @@ TI:: [hh:mm:ss:mss] Sending response:
"maxNodeModuleJsDepth": 2
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
Info seq [hh:mm:ss:mss] event:
Expand All @@ -182,7 +179,6 @@ Info seq [hh:mm:ss:mss] event:
"maxNodeModuleJsDepth": 2
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,11 @@ TI:: [hh:mm:ss:mss] Got install request
"include": [],
"exclude": []
},
"unresolvedImports": [],
"projectRootPath": "/user/username/projects/myproject",
"kind": "discover"
}
TI:: [hh:mm:ss:mss] Failed to load safelist from types map file '/typesMap.json'
TI:: [hh:mm:ss:mss] Explicitly included types: []
TI:: [hh:mm:ss:mss] Inferred typings from unresolved imports: []
TI:: [hh:mm:ss:mss] Finished typings discovery:
{
"cachedTypingPaths": [],
Expand Down Expand Up @@ -155,7 +153,6 @@ TI:: [hh:mm:ss:mss] Sending response:
"maxNodeModuleJsDepth": 2
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
Info seq [hh:mm:ss:mss] event:
Expand All @@ -179,7 +176,6 @@ Info seq [hh:mm:ss:mss] event:
"maxNodeModuleJsDepth": 2
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
}
Expand Down Expand Up @@ -280,12 +276,10 @@ TI:: [hh:mm:ss:mss] Got install request
"include": [],
"exclude": []
},
"unresolvedImports": [],
"projectRootPath": "/",
"kind": "discover"
}
TI:: [hh:mm:ss:mss] Explicitly included types: []
TI:: [hh:mm:ss:mss] Inferred typings from unresolved imports: []
TI:: [hh:mm:ss:mss] Finished typings discovery:
{
"cachedTypingPaths": [],
Expand Down Expand Up @@ -331,7 +325,6 @@ TI:: [hh:mm:ss:mss] Sending response:
"maxNodeModuleJsDepth": 2
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
Info seq [hh:mm:ss:mss] event:
Expand All @@ -355,7 +348,6 @@ Info seq [hh:mm:ss:mss] event:
"maxNodeModuleJsDepth": 2
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
}
Expand Down
Loading

0 comments on commit ec26f33

Please sign in to comment.