Skip to content

WatchMode

reference
1 min readUpdated

Kind: Class

Source: atloria-monorepo/libs/agent-core/src/tools/watch-mode.ts

Methods

MethodSignatureReturns
startstart()MarkerResult[]
stopstop()void
scanFilescanFile(filePath: string)MarkerResult[]
scanDirectoryscanDirectory(dirPath: string)MarkerResult[]

Where it refuses work

  • WatchMode stops the work with an early return when !filename.
  • WatchMode stops the work with an early return when parts.some((p) => this.excludeDirs.includes(p)).
  • WatchMode stops the work with an early return when !this.matchesIncludePatterns(filename).
  • WatchMode stops the work with an early return when !ext.

When something fails

  • WatchMode handles failure in 3 places: it turns it into a return value in 2, and discards it silently in 1. A failure discarded silently leaves no trace for whoever debugs this later.

Was this page helpful?

Download as PDF