Description
Background
Project wide diagnostics are the most requested VS Code JS/TS feature. However, we've been blocked on implementing them by the fact that TS server is single threaded. This means that computing these diagnostics could interrupt normal user operations like completions.
We currently recommend that people use tasks to get around this limitation (since tasks always run as separate process) however few people actually use tasks.
With microsoft/vscode@f094278, I've added a new setting that spins up a new TS Server just for diagnostics. This accomplishes much the same thing as using a task.
Problem
In the prototype, I'm using the geterrForProject
command. This works ok for smaller projects but triggers a huge number of events for larger projects like the VS Code source. Instead, we need an API that: given a file, returns a list of inverse dependencies (i.e. the files that need to be rechecked after the file changes)
I believe that this API more or less already exists with compileOnSaveAffectedFileList
? But that command only works if compileOnSave
is enabled. We'd like to enable project wide error reporting even when users have not enabled compileOnSave.
/cc @sheetalkamat For background on compileOnSaveAffectedFileList
/cc @amcasey As you suggested using a separate diagnostics only server