@@ -1776,11 +1776,8 @@ namespace ts.projectSystem {
17761776 try {
17771777 projectService . openExternalProject ( { projectFileName : "project" , options : { } , rootFiles : toExternalFiles ( [ file1 . path , office . path ] ) } ) ;
17781778 const proj = projectService . externalProjects [ 0 ] ;
1779- // Since the file is not yet open, the project wont have program yet
1780- assert . deepEqual ( proj . getFileNames ( /*excludeFilesFromExternalLibraries*/ true ) , emptyArray ) ;
1781- assert . deepEqual ( proj . getTypeAcquisition ( ) . include , [ "duck-types" ] ) ;
1782- projectService . openClientFile ( file1 . path ) ;
17831779 assert . deepEqual ( proj . getFileNames ( /*excludeFilesFromExternalLibraries*/ true ) , [ file1 . path ] ) ;
1780+ assert . deepEqual ( proj . getTypeAcquisition ( ) . include , [ "duck-types" ] ) ;
17841781 } finally {
17851782 projectService . resetSafeList ( ) ;
17861783 }
@@ -1821,11 +1818,8 @@ namespace ts.projectSystem {
18211818 try {
18221819 projectService . openExternalProject ( { projectFileName : "project" , options : { } , rootFiles : toExternalFiles ( files . map ( f => f . path ) ) } ) ;
18231820 const proj = projectService . externalProjects [ 0 ] ;
1824- // Since the file is not yet open, the project wont have program yet
1825- assert . deepEqual ( proj . getFileNames ( /*excludeFilesFromExternalLibraries*/ true ) , emptyArray ) ;
1826- assert . deepEqual ( proj . getTypeAcquisition ( ) . include , [ "kendo-ui" , "office" ] ) ;
1827- projectService . openClientFile ( file1 . path ) ;
18281821 assert . deepEqual ( proj . getFileNames ( /*excludeFilesFromExternalLibraries*/ true ) , [ file1 . path ] ) ;
1822+ assert . deepEqual ( proj . getTypeAcquisition ( ) . include , [ "kendo-ui" , "office" ] ) ;
18291823 } finally {
18301824 projectService . resetSafeList ( ) ;
18311825 }
@@ -1865,9 +1859,6 @@ namespace ts.projectSystem {
18651859 try {
18661860 projectService . openExternalProject ( { projectFileName : "project" , options : { } , rootFiles : toExternalFiles ( [ file1 . path , file2 . path ] ) , typeAcquisition : { enable : true } } ) ;
18671861 const proj = projectService . externalProjects [ 0 ] ;
1868- // Since the file is not yet open, the project wont have program yet
1869- assert . deepEqual ( proj . getFileNames ( ) , emptyArray ) ;
1870- projectService . openClientFile ( file2 . path ) ;
18711862 assert . deepEqual ( proj . getFileNames ( ) , [ file2 . path ] ) ;
18721863 } finally {
18731864 projectService . resetSafeList ( ) ;
@@ -2083,9 +2074,6 @@ namespace ts.projectSystem {
20832074
20842075 projectService . openExternalProject ( { projectFileName : "project" , options : { } , rootFiles : toExternalFiles ( [ file1 . path ] ) } ) ;
20852076 checkNumberOfProjects ( projectService , { externalProjects : 1 } ) ;
2086- // Since the file is not yet open, the project wont have program yet
2087- assert . deepEqual ( projectService . externalProjects [ 0 ] . getFileNames ( ) , emptyArray ) ;
2088- projectService . openClientFile ( file1 . path ) ;
20892077 checkProjectActualFiles ( projectService . externalProjects [ 0 ] , [ file1 . path ] ) ;
20902078
20912079 projectService . openExternalProject ( { projectFileName : "project" , options : { } , rootFiles : toExternalFiles ( [ file1 . path , file2 . path ] ) } ) ;
@@ -2113,17 +2101,11 @@ namespace ts.projectSystem {
21132101 projectService . openExternalProject ( { projectFileName : "project" , options : { moduleResolution : ModuleResolutionKind . NodeJs } , rootFiles : toExternalFiles ( [ file1 . path , file2 . path ] ) } ) ;
21142102 checkNumberOfProjects ( projectService , { externalProjects : 1 } ) ;
21152103 checkProjectRootFiles ( projectService . externalProjects [ 0 ] , [ file1 . path , file2 . path ] ) ;
2116- // Since the file is not yet open, the project wont have program yet
2117- checkProjectActualFiles ( projectService . externalProjects [ 0 ] , emptyArray ) ;
2118- projectService . openClientFile ( file1 . path ) ;
21192104 checkProjectActualFiles ( projectService . externalProjects [ 0 ] , [ file1 . path , file2 . path ] ) ;
21202105
21212106 projectService . openExternalProject ( { projectFileName : "project" , options : { moduleResolution : ModuleResolutionKind . Classic } , rootFiles : toExternalFiles ( [ file1 . path , file2 . path ] ) } ) ;
21222107 checkNumberOfProjects ( projectService , { externalProjects : 1 } ) ;
21232108 checkProjectRootFiles ( projectService . externalProjects [ 0 ] , [ file1 . path , file2 . path ] ) ;
2124- // The update doesnt happen right away until needed, so either open a file or ensure projects uptodate
2125- checkProjectActualFiles ( projectService . externalProjects [ 0 ] , [ file1 . path , file2 . path ] ) ;
2126- projectService . ensureInferredProjectsUpToDate_TestOnly ( ) ;
21272109 checkProjectActualFiles ( projectService . externalProjects [ 0 ] , [ file1 . path , file2 . path , file3 . path ] ) ;
21282110 } ) ;
21292111
@@ -2425,10 +2407,6 @@ namespace ts.projectSystem {
24252407 projectService . openExternalProject ( { projectFileName, options : { } , rootFiles : [ { fileName : file1 . path , scriptKind : ScriptKind . JS , hasMixedContent : true } ] } ) ;
24262408
24272409 checkNumberOfProjects ( projectService , { externalProjects : 1 } ) ;
2428- // Since the external project is not updated till needed (eg opening client file/ensuringProjectStructureUptodate)
2429- // watched files will be empty at first
2430- checkWatchedFiles ( host , emptyArray ) ;
2431- projectService . ensureInferredProjectsUpToDate_TestOnly ( ) ;
24322410 checkWatchedFiles ( host , [ libFile . path ] ) ; // watching the "missing" lib file
24332411
24342412 const project = projectService . externalProjects [ 0 ] ;
@@ -3013,9 +2991,6 @@ namespace ts.projectSystem {
30132991 projectService . openExternalProjects ( [ externalProject ] ) ;
30142992
30152993 checkNumberOfProjects ( projectService , { configuredProjects : 0 , externalProjects : 1 , inferredProjects : 0 } ) ;
3016- // Since the external project is not updated till needed (eg opening client file/ensuringProjectStructureUptodate)
3017- checkProjectActualFiles ( projectService . externalProjects [ 0 ] , emptyArray ) ;
3018- projectService . ensureInferredProjectsUpToDate_TestOnly ( ) ;
30192994 checkProjectActualFiles ( projectService . externalProjects [ 0 ] , [ site . path , libFile . path ] ) ;
30202995 } ) ;
30212996
@@ -4019,8 +3994,6 @@ namespace ts.projectSystem {
40193994 } ) ;
40203995
40213996 projectService . checkNumberOfProjects ( { externalProjects : 1 } ) ;
4022- checkProjectActualFiles ( projectService . externalProjects [ 0 ] , emptyArray ) ; // external project created but not updated till actually needed
4023- projectService . ensureInferredProjectsUpToDate_TestOnly ( ) ;
40243997 checkProjectActualFiles ( projectService . externalProjects [ 0 ] , [ f1 . path , f2 . path ] ) ;
40253998 } ) ;
40263999
@@ -4058,8 +4031,6 @@ namespace ts.projectSystem {
40584031 } ) ;
40594032
40604033 projectService . checkNumberOfProjects ( { externalProjects : 1 } ) ;
4061- checkProjectActualFiles ( projectService . externalProjects [ 0 ] , emptyArray ) ; // external project created but program is not created till its needed
4062- projectService . ensureInferredProjectsUpToDate_TestOnly ( ) ;
40634034 checkProjectActualFiles ( projectService . externalProjects [ 0 ] , [ f1 . path ] ) ;
40644035
40654036 // add two config file as root files
@@ -4093,8 +4064,6 @@ namespace ts.projectSystem {
40934064 } ) ;
40944065
40954066 projectService . checkNumberOfProjects ( { externalProjects : 1 } ) ;
4096- checkProjectActualFiles ( projectService . externalProjects [ 0 ] , emptyArray ) ; // external project created but program is not created till its needed
4097- projectService . ensureInferredProjectsUpToDate_TestOnly ( ) ;
40984067 checkProjectActualFiles ( projectService . externalProjects [ 0 ] , [ f1 . path ] ) ;
40994068
41004069 // open two config files
0 commit comments