@@ -124,8 +124,9 @@ namespace ts.server {
124
124
names : string [ ] ,
125
125
containingFile : string ,
126
126
cache : ts . FileMap < Map < T > > ,
127
- loader : ( name : string , containingFile : string , options : CompilerOptions , host : ModuleResolutionHost ) => T ,
128
- getResult : ( s : T ) => R ) : R [ ] {
127
+ loader : ( name : string , containingFile : string , options : CompilerOptions , host : ModuleResolutionHost , loadJs ?: boolean ) => T ,
128
+ getResult : ( s : T ) => R ,
129
+ loadJs : boolean ) : R [ ] {
129
130
130
131
const path = toPath ( containingFile , this . host . getCurrentDirectory ( ) , this . getCanonicalFileName ) ;
131
132
const currentResolutionsInFile = cache . get ( path ) ;
@@ -144,7 +145,7 @@ namespace ts.server {
144
145
resolution = existingResolution ;
145
146
}
146
147
else {
147
- resolution = loader ( name , containingFile , compilerOptions , this . moduleResolutionHost ) ;
148
+ resolution = loader ( name , containingFile , compilerOptions , this . moduleResolutionHost , loadJs ) ;
148
149
resolution . lastCheckTime = Date . now ( ) ;
149
150
newResolutions [ name ] = resolution ;
150
151
}
@@ -177,11 +178,11 @@ namespace ts.server {
177
178
}
178
179
179
180
resolveTypeReferenceDirectives ( typeDirectiveNames : string [ ] , containingFile : string ) : ResolvedTypeReferenceDirective [ ] {
180
- return this . resolveNamesWithLocalCache ( typeDirectiveNames , containingFile , this . resolvedTypeReferenceDirectives , resolveTypeReferenceDirective , m => m . resolvedTypeReferenceDirective ) ;
181
+ return this . resolveNamesWithLocalCache ( typeDirectiveNames , containingFile , this . resolvedTypeReferenceDirectives , resolveTypeReferenceDirective , m => m . resolvedTypeReferenceDirective , /*loadJs*/ false ) ;
181
182
}
182
183
183
- resolveModuleNames ( moduleNames : string [ ] , containingFile : string ) : ResolvedModule [ ] {
184
- return this . resolveNamesWithLocalCache ( moduleNames , containingFile , this . resolvedModuleNames , resolveModuleName , m => m . resolvedModule ) ;
184
+ resolveModuleNames ( moduleNames : string [ ] , containingFile : string , loadJs ?: boolean ) : ResolvedModule [ ] {
185
+ return this . resolveNamesWithLocalCache ( moduleNames , containingFile , this . resolvedModuleNames , resolveModuleName , m => m . resolvedModule , loadJs ) ;
185
186
}
186
187
187
188
getDefaultLibFileName ( ) {
@@ -1377,6 +1378,13 @@ namespace ts.server {
1377
1378
return false ;
1378
1379
}
1379
1380
1381
+ loadExtension ( name : string ) {
1382
+ if ( ! sys . loadExtension ) {
1383
+ throw new Error ( "Extension loading not implemented on the active host!" ) ;
1384
+ }
1385
+ return sys . loadExtension ( name ) ;
1386
+ }
1387
+
1380
1388
openConfigFile ( configFilename : string , clientFileName ?: string ) : { success : boolean , project ?: Project , errors ?: Diagnostic [ ] } {
1381
1389
const { succeeded, projectOptions, errors } = this . configFileToProjectOptions ( configFilename ) ;
1382
1390
if ( ! succeeded ) {
0 commit comments