grats icon indicating copy to clipboard operation
grats copied to clipboard

Make --watch mode more incremental

Open captbaritone opened this issue 1 year ago • 3 comments

To start with, ideally we don't need to re-extract from files that have not changed

captbaritone avatar Dec 23 '23 05:12 captbaritone

Did some research and found a few leads:

  1. https://github.com/microsoft/TypeScript/pull/20234
  2. https://github.com/vlcn-io/typed-sql/blob/main/packages/cli/src/Analyzer.ts#L102
  3. https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#writing-an-incremental-program-watcher
  4. Using the Language Service API · microsoft/TypeScript Wiki · GitHub https://github.com/microsoft/TypeScript/wiki/Using-the-Language-Service-API

captbaritone avatar Dec 23 '23 17:12 captbaritone

The most promising looking thing so far is these two methods on ts.LanguageServiceHost:

  1. .getProjectVersion()
  2. .getScriptVersion()

I suspect these will let me track changes more incrementally.

captbaritone avatar Dec 28 '23 01:12 captbaritone

https://github.com/vlcn-io/typed-sql/blob/main/packages/cli/src/Analyzer.ts

captbaritone avatar Jan 24 '24 00:01 captbaritone