@@ -1007,6 +1007,41 @@ namespace ts.projectSystem {
1007
1007
checkProjectRootFiles ( projectService . configuredProjects [ 0 ] , [ commonFile1 . path , commonFile2 . path ] ) ;
1008
1008
} ) ;
1009
1009
1010
+ it ( "should disable features when the files are too large" , ( ) => {
1011
+ const file1 = {
1012
+ path : "/a/b/f1.js" ,
1013
+ content : "let x =1;" ,
1014
+ fileSize : 10 * 1024 * 1024
1015
+ } ;
1016
+ const file2 = {
1017
+ path : "/a/b/f2.js" ,
1018
+ content : "let y =1;" ,
1019
+ fileSize : 6 * 1024 * 1024
1020
+ } ;
1021
+ const file3 = {
1022
+ path : "/a/b/f3.js" ,
1023
+ content : "let y =1;" ,
1024
+ fileSize : 6 * 1024 * 1024
1025
+ } ;
1026
+
1027
+ const proj1name = "proj1" , proj2name = "proj2" , proj3name = "proj3" ;
1028
+
1029
+ const host = createServerHost ( [ file1 , file2 , file3 ] ) ;
1030
+ const projectService = createProjectService ( host ) ;
1031
+
1032
+ projectService . openExternalProject ( { rootFiles : toExternalFiles ( [ file1 . path ] ) , options : { } , projectFileName : proj1name } ) ;
1033
+ const proj1 = projectService . findProject ( proj1name ) ;
1034
+ assert . isTrue ( proj1 . languageServiceEnabled ) ;
1035
+
1036
+ projectService . openExternalProject ( { rootFiles : toExternalFiles ( [ file2 . path ] ) , options : { } , projectFileName : proj2name } ) ;
1037
+ const proj2 = projectService . findProject ( proj2name ) ;
1038
+ assert . isTrue ( proj2 . languageServiceEnabled ) ;
1039
+
1040
+ projectService . openExternalProject ( { rootFiles : toExternalFiles ( [ file3 . path ] ) , options : { } , projectFileName : proj3name } ) ;
1041
+ const proj3 = projectService . findProject ( proj3name ) ;
1042
+ assert . isFalse ( proj3 . languageServiceEnabled ) ;
1043
+ } ) ;
1044
+
1010
1045
it ( "should use only one inferred project if 'useOneInferredProject' is set" , ( ) => {
1011
1046
const file1 = {
1012
1047
path : "/a/b/main.ts" ,
0 commit comments