Description
Starting from typescript 2.6 the tsserver caches ScriptInfo-s even if there is no open projects (or files under InferredProject) with the infos.
It is a problem for us because now we cannot properly handle changed files for compilation.
Our compilation implementation (if there is no open projects / files):
- Open project (or file if there is no configured projects for the file)
- Run compiling
- Close project (or file)
In previous versions the action (1) refreshed all files so all the files always were up-to-date.
After the changes in 2.6 the action (1) doesn't load actual contents for the files if the project was open before. Of course there are file watchers that will handle the content updates but they have a gap in couple seconds.
On the other side IDE has the necessary information but we cannot reload file content without open project (see src/server/session.ts:1346).
The best solution for us is to allow to run "reload" action without open project if the script info is loaded in the service.