From 85e2583295b5a0c4eaea95bbe9f83be6e936c6ab Mon Sep 17 00:00:00 2001 From: Max schwenk Date: Fri, 3 Oct 2025 15:42:45 -0400 Subject: [PATCH 1/2] On snapshot --- internal/project/session.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/project/session.go b/internal/project/session.go index 0b6e537d54..8d3d30fef6 100644 --- a/internal/project/session.go +++ b/internal/project/session.go @@ -8,6 +8,7 @@ import ( "sync" "sync/atomic" "time" + "runtime" "github.com/microsoft/typescript-go/internal/ast" "github.com/microsoft/typescript-go/internal/collections" @@ -371,6 +372,7 @@ func (s *Session) GetLanguageService(ctx context.Context, uri lsproto.DocumentUr } func (s *Session) UpdateSnapshot(ctx context.Context, overlays map[tspath.Path]*overlay, change SnapshotChange) *Snapshot { + defer runtime.GC() s.snapshotMu.Lock() oldSnapshot := s.snapshot newSnapshot := oldSnapshot.Clone(ctx, change, overlays, s) From be84917f5b39008cde9ca639afa2d6dd1a0dacdb Mon Sep 17 00:00:00 2001 From: Max schwenk Date: Fri, 3 Oct 2025 15:46:09 -0400 Subject: [PATCH 2/2] Formatting --- internal/project/session.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/project/session.go b/internal/project/session.go index 8d3d30fef6..5f4898ebfc 100644 --- a/internal/project/session.go +++ b/internal/project/session.go @@ -3,12 +3,12 @@ package project import ( "context" "fmt" + "runtime" "slices" "strings" "sync" "sync/atomic" "time" - "runtime" "github.com/microsoft/typescript-go/internal/ast" "github.com/microsoft/typescript-go/internal/collections"