Make --watch mode more incremental
captbaritone opened this issue · comments
Jordan Eldredge commented
To start with, ideally we don't need to re-extract from files that have not changed
Jordan Eldredge commented
Did some research and found a few leads:
- microsoft/TypeScript#20234
- https://github.com/vlcn-io/typed-sql/blob/main/packages/cli/src/Analyzer.ts#L102
- https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#writing-an-incremental-program-watcher
- Using the Language Service API · microsoft/TypeScript Wiki · GitHub https://github.com/microsoft/TypeScript/wiki/Using-the-Language-Service-API
Jordan Eldredge commented
The most promising looking thing so far is these two methods on ts.LanguageServiceHost
:
.getProjectVersion()
.getScriptVersion()
I suspect these will let me track changes more incrementally.