MCPcopy Create free account
hub / github.com/microsoft/typescript-go / DidCloseFile

Method DidCloseFile

internal/project/session.go:320–330  ·  view source on GitHub ↗
(ctx context.Context, uri lsproto.DocumentUri)

Source from the content-addressed store, hash-verified

318}
319
320func (s *Session) DidCloseFile(ctx context.Context, uri lsproto.DocumentUri) {
321 s.cancelWarmAutoImportCache()
322 s.scheduleIdleCacheClean()
323 s.pendingFileChangesMu.Lock()
324 s.pendingFileChanges = append(s.pendingFileChanges, FileChange{
325 Kind: FileChangeKindClose,
326 URI: uri,
327 })
328 s.pendingFileChangesMu.Unlock()
329 s.ScheduleSnapshotUpdate(UpdateReasonDidCloseFile)
330}
331
332func (s *Session) DidChangeFile(ctx context.Context, uri lsproto.DocumentUri, version int32, changes []lsproto.TextDocumentContentChangePartialOrWholeDocument) {
333 s.cancelDiagnosticsRefresh()

Callers 9

TestRefCountingCachesFunction · 0.95
TestSnapshotFunction · 0.95
handleDidCloseMethod · 0.80
TestRegistryLifecycleFunction · 0.80
TestProjectLifetimeFunction · 0.80
session_test.goFile · 0.80
TestPushDiagnosticsFunction · 0.80

Calls 6

appendFunction · 0.50
LockMethod · 0.45
UnlockMethod · 0.45

Tested by 7

TestRefCountingCachesFunction · 0.76
TestSnapshotFunction · 0.76
TestRegistryLifecycleFunction · 0.64
TestProjectLifetimeFunction · 0.64
TestPushDiagnosticsFunction · 0.64