I am looking to instrument TypeScript initialization performance in VSCode, similar to the TypeTrack extension mentioned in this blog post.
Unfortunately, I'm having a hard time figuring out exactly how to subscribe to the events I need to do this instrumentation.
One thing I've tried is to get a reference to VSCode's TypeScript language features extension:
vscode.extensions.getExtension('vscode.typescript-language-features');
Unfortunately, the API it exposes is very minimal and the only thing it seems to have is onCompletionAccepted, which is not too helpful for me here.
I've looked through VSCode's API events but none of them seem to quite be what I'm looking for. I think these are the events that I need (projectLoadingStart and projectLoadingFinish), which tsserver emits internally, but I don't know how to listen to them. And here I can see vscode.typescript-language-features using these events to update its loading indicator.
It seems like maybe this could be done with a TypeScript Language Service plugin? Or maybe I need to make my own TypeScript service client? Where should I start digging?