Skip to content

Commit f6b1667

Browse files
authored
Fix TestContentMapperOpenFileExcludedByConfigChange race (#64137)
1 parent 6ed67b6 commit f6b1667

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

tsc/internal/project/contentmapper_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,13 @@ func TestContentMapperOpenFileExcludedByConfigChange(t *testing.T) {
679679
Uri: "file:///home/project/tsconfig.json",
680680
Type: lsproto.FileChangeTypeChanged,
681681
}})
682+
session.WaitForBackgroundTasks()
683+
684+
// The background update removes app.box from the configured project, but inferred
685+
// project cleanup is deferred until the next file open.
686+
assert.Assert(t, session.Snapshot().GetDefaultProject(boxURI) == nil)
687+
mainURI := lsproto.DocumentUri("file:///home/project/src/main.ts")
688+
session.DidOpenFile(ctx, mainURI, 1, files["/home/project/src/main.ts"].(string), lsproto.LanguageKindTypeScript)
682689

683690
languageService, err = session.GetLanguageService(ctx, boxURI)
684691
assert.NilError(t, err)

0 commit comments

Comments
 (0)