Skip to content

Typescript 2.6 service (tsserver): cannot reload files without open projects #19336

Closed
@anstarovoyt

Description

@anstarovoyt

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):

  1. Open project (or file if there is no configured projects for the file)
  2. Run compiling
  3. 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.

Metadata

Metadata

Assignees

Labels

APIRelates to the public API for TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions