@@ -1776,11 +1776,8 @@ namespace ts.projectSystem {
1776
1776
try {
1777
1777
projectService . openExternalProject ( { projectFileName : "project" , options : { } , rootFiles : toExternalFiles ( [ file1 . path , office . path ] ) } ) ;
1778
1778
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 ) ;
1783
1779
assert . deepEqual ( proj . getFileNames ( /*excludeFilesFromExternalLibraries*/ true ) , [ file1 . path ] ) ;
1780
+ assert . deepEqual ( proj . getTypeAcquisition ( ) . include , [ "duck-types" ] ) ;
1784
1781
} finally {
1785
1782
projectService . resetSafeList ( ) ;
1786
1783
}
@@ -1821,11 +1818,8 @@ namespace ts.projectSystem {
1821
1818
try {
1822
1819
projectService . openExternalProject ( { projectFileName : "project" , options : { } , rootFiles : toExternalFiles ( files . map ( f => f . path ) ) } ) ;
1823
1820
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 ) ;
1828
1821
assert . deepEqual ( proj . getFileNames ( /*excludeFilesFromExternalLibraries*/ true ) , [ file1 . path ] ) ;
1822
+ assert . deepEqual ( proj . getTypeAcquisition ( ) . include , [ "kendo-ui" , "office" ] ) ;
1829
1823
} finally {
1830
1824
projectService . resetSafeList ( ) ;
1831
1825
}
@@ -1865,9 +1859,6 @@ namespace ts.projectSystem {
1865
1859
try {
1866
1860
projectService . openExternalProject ( { projectFileName : "project" , options : { } , rootFiles : toExternalFiles ( [ file1 . path , file2 . path ] ) , typeAcquisition : { enable : true } } ) ;
1867
1861
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 ) ;
1871
1862
assert . deepEqual ( proj . getFileNames ( ) , [ file2 . path ] ) ;
1872
1863
} finally {
1873
1864
projectService . resetSafeList ( ) ;
@@ -2083,9 +2074,6 @@ namespace ts.projectSystem {
2083
2074
2084
2075
projectService . openExternalProject ( { projectFileName : "project" , options : { } , rootFiles : toExternalFiles ( [ file1 . path ] ) } ) ;
2085
2076
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 ) ;
2089
2077
checkProjectActualFiles ( projectService . externalProjects [ 0 ] , [ file1 . path ] ) ;
2090
2078
2091
2079
projectService . openExternalProject ( { projectFileName : "project" , options : { } , rootFiles : toExternalFiles ( [ file1 . path , file2 . path ] ) } ) ;
@@ -2113,17 +2101,11 @@ namespace ts.projectSystem {
2113
2101
projectService . openExternalProject ( { projectFileName : "project" , options : { moduleResolution : ModuleResolutionKind . NodeJs } , rootFiles : toExternalFiles ( [ file1 . path , file2 . path ] ) } ) ;
2114
2102
checkNumberOfProjects ( projectService , { externalProjects : 1 } ) ;
2115
2103
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 ) ;
2119
2104
checkProjectActualFiles ( projectService . externalProjects [ 0 ] , [ file1 . path , file2 . path ] ) ;
2120
2105
2121
2106
projectService . openExternalProject ( { projectFileName : "project" , options : { moduleResolution : ModuleResolutionKind . Classic } , rootFiles : toExternalFiles ( [ file1 . path , file2 . path ] ) } ) ;
2122
2107
checkNumberOfProjects ( projectService , { externalProjects : 1 } ) ;
2123
2108
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 ( ) ;
2127
2109
checkProjectActualFiles ( projectService . externalProjects [ 0 ] , [ file1 . path , file2 . path , file3 . path ] ) ;
2128
2110
} ) ;
2129
2111
@@ -2425,10 +2407,6 @@ namespace ts.projectSystem {
2425
2407
projectService . openExternalProject ( { projectFileName, options : { } , rootFiles : [ { fileName : file1 . path , scriptKind : ScriptKind . JS , hasMixedContent : true } ] } ) ;
2426
2408
2427
2409
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 ( ) ;
2432
2410
checkWatchedFiles ( host , [ libFile . path ] ) ; // watching the "missing" lib file
2433
2411
2434
2412
const project = projectService . externalProjects [ 0 ] ;
@@ -3013,9 +2991,6 @@ namespace ts.projectSystem {
3013
2991
projectService . openExternalProjects ( [ externalProject ] ) ;
3014
2992
3015
2993
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 ( ) ;
3019
2994
checkProjectActualFiles ( projectService . externalProjects [ 0 ] , [ site . path , libFile . path ] ) ;
3020
2995
} ) ;
3021
2996
@@ -4019,8 +3994,6 @@ namespace ts.projectSystem {
4019
3994
} ) ;
4020
3995
4021
3996
projectService . checkNumberOfProjects ( { externalProjects : 1 } ) ;
4022
- checkProjectActualFiles ( projectService . externalProjects [ 0 ] , emptyArray ) ; // external project created but not updated till actually needed
4023
- projectService . ensureInferredProjectsUpToDate_TestOnly ( ) ;
4024
3997
checkProjectActualFiles ( projectService . externalProjects [ 0 ] , [ f1 . path , f2 . path ] ) ;
4025
3998
} ) ;
4026
3999
@@ -4058,8 +4031,6 @@ namespace ts.projectSystem {
4058
4031
} ) ;
4059
4032
4060
4033
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 ( ) ;
4063
4034
checkProjectActualFiles ( projectService . externalProjects [ 0 ] , [ f1 . path ] ) ;
4064
4035
4065
4036
// add two config file as root files
@@ -4093,8 +4064,6 @@ namespace ts.projectSystem {
4093
4064
} ) ;
4094
4065
4095
4066
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 ( ) ;
4098
4067
checkProjectActualFiles ( projectService . externalProjects [ 0 ] , [ f1 . path ] ) ;
4099
4068
4100
4069
// open two config files
0 commit comments