[Feat] Refresh tsserver file state after deleting
As for right now, when we remove the file the tsserver doesn't automatically know that something happened - therefore it doesn't know that something changed and cannot provide correct diagnostics. I'll try to investigate on how to provide such functionality to somehow notify tsserver that the file was removed.
I've checked and such thing works in VSCode, but they don't send any request to tsserver and it doesn't work in webstorm so it may be a bit tricky, but maybe we will be able to do that.
Basically I know how to track deletions (e.g. using workspace/didChangeWatchedFiles) but don't know on how to notify tsserver yet.
https://github.com/pmizio/typescript-tools.nvim/assets/35625949/4266f9e9-764d-4b7e-8dca-762d15db9989
https://github.com/microsoft/TypeScript/blob/e89d42d373a570f12510429e13ec45a9eccd9ed0/src/server/protocol.ts#L105 This is key imo when, I delete file in vscode this request is send and then project is reloaded.
Ye this request is sent, but only if the removed file was previously opened. If the file is not in the tsserver open files, then no request is sent for the removed file but still import error is shown.
And I've tried this projectInfo and unfortunately it does not work
Hmm idk, we probably need to do more reverse engineering on vscode :D
I've added an issue to the Typescript repo: https://github.com/microsoft/TypeScript/issues/54986