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 Jul 23, 2024
1 parent ee8062f commit 3b35636
Show file tree
Hide file tree
Showing 107 changed files with 9 additions and 878 deletions.
14 changes: 9 additions & 5 deletions src/server/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,9 @@ function compilerOptionsChanged(opt1: CompilerOptions, opt2: CompilerOptions): b
}

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);
}
const disabledTypeAcquisition: TypeAcquisition = {};
Expand Down Expand Up @@ -1520,10 +1520,14 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo
this.typingsCache = {
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.projectService.typingsInstaller.enqueueInstallTypingsRequest(
this,
typeAcquisition,
this.typingsCache.unresolvedImports,
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,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 @@ -170,7 +168,6 @@ TI:: [hh:mm:ss:mss] Sending response:
"noEmitForJsFiles": true
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
Info seq [hh:mm:ss:mss] event:
Expand All @@ -193,7 +190,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 @@ -455,14 +455,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 @@ -504,7 +502,6 @@ TI:: [hh:mm:ss:mss] Sending response:
"noEmitForJsFiles": true
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
Info seq [hh:mm:ss:mss] event:
Expand All @@ -527,7 +524,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 @@ -118,14 +118,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 @@ -172,7 +170,6 @@ TI:: [hh:mm:ss:mss] Sending response:
"noEmitForJsFiles": true
},
"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:
"noEmitForJsFiles": true
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,13 +282,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 @@ -328,7 +326,6 @@ TI:: [hh:mm:ss:mss] Sending response:
"maxNodeModuleJsDepth": 2
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
Info seq [hh:mm:ss:mss] event:
Expand All @@ -352,7 +349,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 @@ -290,13 +290,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 @@ -336,7 +334,6 @@ TI:: [hh:mm:ss:mss] Sending response:
"maxNodeModuleJsDepth": 2
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
Info seq [hh:mm:ss:mss] event:
Expand All @@ -360,7 +357,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 @@ -139,13 +139,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 @@ -185,7 +183,6 @@ TI:: [hh:mm:ss:mss] Sending response:
"maxNodeModuleJsDepth": 2
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
Info seq [hh:mm:ss:mss] event:
Expand All @@ -209,7 +206,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 @@ -140,13 +140,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 @@ -186,7 +184,6 @@ TI:: [hh:mm:ss:mss] Sending response:
"maxNodeModuleJsDepth": 2
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
Info seq [hh:mm:ss:mss] event:
Expand All @@ -210,7 +207,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 @@ -411,13 +411,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 @@ -457,7 +455,6 @@ TI:: [hh:mm:ss:mss] Sending response:
"maxNodeModuleJsDepth": 2
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
Info seq [hh:mm:ss:mss] event:
Expand All @@ -481,7 +478,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 @@ -368,13 +368,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 @@ -413,7 +411,6 @@ TI:: [hh:mm:ss:mss] Sending response:
"noEmitForJsFiles": true
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
Info seq [hh:mm:ss:mss] event:
Expand All @@ -436,7 +433,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 @@ -123,13 +123,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 @@ -175,7 +173,6 @@ TI:: [hh:mm:ss:mss] Sending response:
"maxNodeModuleJsDepth": 2
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
Info seq [hh:mm:ss:mss] event:
Expand All @@ -199,7 +196,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 @@ -117,13 +117,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 @@ -169,7 +167,6 @@ TI:: [hh:mm:ss:mss] Sending response:
"maxNodeModuleJsDepth": 2
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
Info seq [hh:mm:ss:mss] event:
Expand All @@ -193,7 +190,6 @@ Info seq [hh:mm:ss:mss] event:
"maxNodeModuleJsDepth": 2
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
}
Expand Down Expand Up @@ -304,12 +300,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 @@ -355,7 +349,6 @@ TI:: [hh:mm:ss:mss] Sending response:
"maxNodeModuleJsDepth": 2
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
Info seq [hh:mm:ss:mss] event:
Expand All @@ -379,7 +372,6 @@ Info seq [hh:mm:ss:mss] event:
"maxNodeModuleJsDepth": 2
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
}
Expand Down
Loading

0 comments on commit 3b35636

Please sign in to comment.