@@ -49,6 +49,10 @@ namespace ts.projectSystem {
49
49
path : "/a/lib/lib.d.ts" ,
50
50
content : libFileContent
51
51
} ;
52
+ export const es5LibFile : FileOrFolder = {
53
+ path : "/a/lib/lib.es5.full.d.ts" ,
54
+ content : libFileContent
55
+ } ;
52
56
53
57
export class TestTypingsInstaller extends TI . TypingsInstaller implements server . ITypingsInstaller {
54
58
protected projectService : server . ProjectService ;
@@ -658,7 +662,7 @@ namespace ts.projectSystem {
658
662
path : "/a/b/c/module.d.ts" ,
659
663
content : `export let x: number`
660
664
} ;
661
- const host = createServerHost ( [ appFile , moduleFile , libFile ] ) ;
665
+ const host = createServerHost ( [ appFile , moduleFile , es5LibFile ] ) ;
662
666
const projectService = createProjectService ( host ) ;
663
667
const { configFileName } = projectService . openClientFile ( appFile . path ) ;
664
668
@@ -668,7 +672,7 @@ namespace ts.projectSystem {
668
672
669
673
const project = projectService . inferredProjects [ 0 ] ;
670
674
671
- checkFileNames ( "inferred project" , project . getFileNames ( ) , [ appFile . path , libFile . path , moduleFile . path ] ) ;
675
+ checkFileNames ( "inferred project" , project . getFileNames ( ) , [ appFile . path , es5LibFile . path , moduleFile . path ] ) ;
672
676
checkWatchedDirectories ( host , [ "/a/b/c" , "/a/b" , "/a" ] ) ;
673
677
} ) ;
674
678
@@ -1137,23 +1141,23 @@ namespace ts.projectSystem {
1137
1141
content : "let x =1;"
1138
1142
} ;
1139
1143
1140
- const host = createServerHost ( [ file1 , file2 , file3 , libFile ] ) ;
1144
+ const host = createServerHost ( [ file1 , file2 , file3 , es5LibFile ] ) ;
1141
1145
const projectService = createProjectService ( host , { useSingleInferredProject : true } ) ;
1142
1146
projectService . openClientFile ( file1 . path ) ;
1143
1147
projectService . openClientFile ( file2 . path ) ;
1144
1148
projectService . openClientFile ( file3 . path ) ;
1145
1149
1146
1150
checkNumberOfConfiguredProjects ( projectService , 0 ) ;
1147
1151
checkNumberOfInferredProjects ( projectService , 1 ) ;
1148
- checkProjectActualFiles ( projectService . inferredProjects [ 0 ] , [ file1 . path , file2 . path , file3 . path , libFile . path ] ) ;
1152
+ checkProjectActualFiles ( projectService . inferredProjects [ 0 ] , [ file1 . path , file2 . path , file3 . path , es5LibFile . path ] ) ;
1149
1153
1150
1154
1151
1155
host . reloadFS ( [ file1 , configFile , file2 , file3 , libFile ] ) ;
1152
1156
host . triggerDirectoryWatcherCallback ( getDirectoryPath ( configFile . path ) , configFile . path ) ;
1153
1157
1154
1158
checkNumberOfConfiguredProjects ( projectService , 1 ) ;
1155
1159
checkNumberOfInferredProjects ( projectService , 1 ) ;
1156
- checkProjectActualFiles ( projectService . inferredProjects [ 0 ] , [ file2 . path , file3 . path , libFile . path ] ) ;
1160
+ checkProjectActualFiles ( projectService . inferredProjects [ 0 ] , [ file2 . path , file3 . path , es5LibFile . path ] ) ;
1157
1161
} ) ;
1158
1162
1159
1163
it ( "should close configured project after closing last open file" , ( ) => {
@@ -3471,7 +3475,7 @@ namespace ts.projectSystem {
3471
3475
path : "/a/b/f1.js" ,
3472
3476
content : "function test1() { }"
3473
3477
} ;
3474
- const host = createServerHost ( [ f1 , libFile ] ) ;
3478
+ const host = createServerHost ( [ f1 , es5LibFile ] ) ;
3475
3479
const session = createSession ( host ) ;
3476
3480
openFilesForSession ( [ f1 ] , session ) ;
3477
3481
@@ -3491,14 +3495,15 @@ namespace ts.projectSystem {
3491
3495
type : "request" ,
3492
3496
command : server . CommandNames . CompilerOptionsForInferredProjects ,
3493
3497
seq : 3 ,
3494
- arguments : { options : { module : ModuleKind . CommonJS } }
3498
+ arguments : { options : { module : ModuleKind . CommonJS , target : ScriptTarget . ES5 } }
3495
3499
} ) ;
3496
3500
const diagsAfterUpdate = session . executeCommand ( < server . protocol . CompilerOptionsDiagnosticsRequest > {
3497
3501
type : "request" ,
3498
3502
command : server . CommandNames . CompilerOptionsDiagnosticsFull ,
3499
3503
seq : 4 ,
3500
3504
arguments : { projectFileName : projectName }
3501
3505
} ) . response ;
3506
+ console . log ( diagsAfterUpdate ) ;
3502
3507
assert . isTrue ( diagsAfterUpdate . length === 0 ) ;
3503
3508
} ) ;
3504
3509
0 commit comments