@@ -454,49 +454,6 @@ func TestProjectCollectionBuilder(t *testing.T) {
454454 })
455455 })
456456
457- t .Run ("closing file from inferred project does not corrupt old snapshot" , func (t * testing.T ) {
458- t .Parallel ()
459- files := map [string ]any {
460- "/project/a.ts" : `export const a = 1;` ,
461- "/project/b.ts" : `export const b = 1;` ,
462- }
463-
464- session , _ := projecttestutil .Setup (files )
465-
466- // Open two files with no tsconfig → inferred project
467- session .DidOpenFile (context .Background (), "file:///project/a.ts" , 1 , files ["/project/a.ts" ].(string ), lsproto .LanguageKindTypeScript )
468- session .DidOpenFile (context .Background (), "file:///project/b.ts" , 1 , files ["/project/b.ts" ].(string ), lsproto .LanguageKindTypeScript )
469-
470- // Force snapshot creation via GetLanguageService
471- _ , err := session .GetLanguageService (context .Background (), "file:///project/a.ts" )
472- assert .NilError (t , err )
473-
474- oldSnapshot := session .Snapshot ()
475- oldInferred := oldSnapshot .ProjectCollection .InferredProject ()
476- assert .Assert (t , oldInferred != nil )
477- oldFileNames := oldInferred .CommandLine .FileNames ()
478- assert .DeepEqual (t , oldFileNames , []string {
479- "/project/a.ts" ,
480- "/project/b.ts" ,
481- })
482-
483- // Close one file and trigger a new snapshot
484- session .DidCloseFile (context .Background (), "file:///project/b.ts" )
485- _ , err = session .GetLanguageService (context .Background (), "file:///project/a.ts" )
486- assert .NilError (t , err )
487-
488- newSnapshot := session .Snapshot ()
489- assert .Assert (t , newSnapshot != oldSnapshot , "snapshot should have changed" )
490-
491- // The old snapshot's inferred project FileNames must not have been mutated
492- // by processing the close. slices.Delete in DidChangeFiles currently corrupts
493- // the shared underlying array.
494- assert .DeepEqual (t , oldFileNames , []string {
495- "/project/a.ts" ,
496- "/project/b.ts" ,
497- })
498- })
499-
500457 t .Run ("project lookup terminates" , func (t * testing.T ) {
501458 t .Parallel ()
502459 files := map [string ]any {
0 commit comments