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

Method DidChangeFile

internal/project/session.go:332–344  ·  view source on GitHub ↗
(ctx context.Context, uri lsproto.DocumentUri, version int32, changes []lsproto.TextDocumentContentChangePartialOrWholeDocument)

Source from the content-addressed store, hash-verified

330}
331
332func (s *Session) DidChangeFile(ctx context.Context, uri lsproto.DocumentUri, version int32, changes []lsproto.TextDocumentContentChangePartialOrWholeDocument) {
333 s.cancelDiagnosticsRefresh()
334 s.cancelWarmAutoImportCache()
335 s.scheduleIdleCacheClean()
336 s.pendingFileChangesMu.Lock()
337 defer s.pendingFileChangesMu.Unlock()
338 s.pendingFileChanges = append(s.pendingFileChanges, FileChange{
339 Kind: FileChangeKindChange,
340 URI: uri,
341 Version: version,
342 Changes: changes,
343 })
344}
345
346func (s *Session) DidSaveFile(ctx context.Context, uri lsproto.DocumentUri) {
347 s.scheduleIdleCacheClean()

Callers 13

TestRefCountingCachesFunction · 0.95
TestSnapshotFunction · 0.95
handleDidChangeMethod · 0.80
TestRegistryLifecycleFunction · 0.80
TestSessionFunction · 0.80
session_test.goFile · 0.80

Calls 6

appendFunction · 0.50
LockMethod · 0.45
UnlockMethod · 0.45

Tested by 11

TestRefCountingCachesFunction · 0.76
TestSnapshotFunction · 0.76
TestRegistryLifecycleFunction · 0.64
TestSessionFunction · 0.64
TestProjectFunction · 0.64