@@ -9020,6 +9020,51 @@ export const x = 10;`
90209020 } ) ;
90219021 } ) ;
90229022
9023+ describe ( "tsserverProjectSystem with large file" , ( ) => {
9024+ const projectRoot = "/user/username/projects/project" ;
9025+ const largeFile : File = {
9026+ path : `${ projectRoot } /src/large.ts` ,
9027+ content : "export var x = 10;" ,
9028+ fileSize : server . maxFileSize + 1
9029+ } ;
9030+
9031+ it ( "when large file is included by tsconfig" , ( ) => {
9032+ const file : File = {
9033+ path : `${ projectRoot } /src/file.ts` ,
9034+ content : "export var y = 10;"
9035+ } ;
9036+ const tsconfig : File = {
9037+ path : `${ projectRoot } /tsconfig.json` ,
9038+ content : JSON . stringify ( { files : [ "src/file.ts" , "src/large.ts" ] } )
9039+ } ;
9040+ const files = [ file , largeFile , libFile , tsconfig ] ;
9041+ const host = createServerHost ( files ) ;
9042+ const service = createProjectService ( host ) ;
9043+ service . openClientFile ( file . path ) ;
9044+ service . checkNumberOfProjects ( { configuredProjects : 1 } ) ;
9045+ const project = service . configuredProjects . get ( tsconfig . path ) ! ;
9046+ checkProjectActualFiles ( project , [ file . path , libFile . path , largeFile . path , tsconfig . path ] ) ;
9047+ const info = service . getScriptInfo ( largeFile . path ) ! ;
9048+ assert . equal ( info . cacheSourceFile . sourceFile . text , "" ) ;
9049+ } ) ;
9050+
9051+ it ( "when large file is included by module resolution" , ( ) => {
9052+ const file : File = {
9053+ path : `${ projectRoot } /src/file.ts` ,
9054+ content : `export var y = 10;import {x} from "./large"`
9055+ } ;
9056+ const files = [ file , largeFile , libFile ] ;
9057+ const host = createServerHost ( files ) ;
9058+ const service = createProjectService ( host ) ;
9059+ service . openClientFile ( file . path ) ;
9060+ service . checkNumberOfProjects ( { inferredProjects : 1 } ) ;
9061+ const project = service . inferredProjects [ 0 ] ;
9062+ checkProjectActualFiles ( project , [ file . path , libFile . path , largeFile . path ] ) ;
9063+ const info = service . getScriptInfo ( largeFile . path ) ! ;
9064+ assert . equal ( info . cacheSourceFile . sourceFile . text , "" ) ;
9065+ } ) ;
9066+ } ) ;
9067+
90239068 describe ( "tsserverProjectSystem syntax operations" , ( ) => {
90249069 function navBarFull ( session : TestSession , file : File ) {
90259070 return JSON . stringify ( session . executeCommandSeq < protocol . FileRequest > ( {
@@ -9575,7 +9620,7 @@ export function Test2() {
95759620 } ) ;
95769621 } ) ;
95779622
9578- describe ( "duplicate packages" , ( ) => {
9623+ describe ( "tsserverProjectSystem duplicate packages" , ( ) => {
95799624 // Tests that 'moduleSpecifiers.ts' will import from the redirecting file, and not from the file it redirects to, if that can provide a global module specifier.
95809625 it ( "works with import fixes" , ( ) => {
95819626 const packageContent = "export const foo: number;" ;
0 commit comments