Skip to content

Compile on Save not triggered when adding or removing files #143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lorenzodallavecchia opened this issue Feb 9, 2017 · 2 comments
Open

Comments

@lorenzodallavecchia
Copy link
Contributor

lorenzodallavecchia commented Feb 9, 2017

With compile on save enabled, adding or removing entire files in Eclipse is not triggering correct recompilation of other files that may be affected.

This problems applies to the new compilation performed by tsserver.

Investigation and thoughts

When a file is removed in Eclipse, no notification is sent to tsserver.
When a file is added in Eclipse, the client is asking for compileOnSaveAffectedFileList, but the server is responding that no files are affected. I think this is caused by the fact that the server was not informed about any actual "change", so it considers the new file unchanged.

The overall supporto for project-level changes seems completely lacking from tsserver: this is probably a result of it being used as backend for tools like VSCode that are still not providing the level of project scope you can see in Eclipse. For example, it is still normal in VSCode to not expect error to be listed for closed files.

Unfortunately, for CoS to be realiable, each delta in the Eclipse workspace must be communicated to tsserver. The client cannot risk to have its incremental state misaligned with the server's.
If there is no way of overcoming this in tsserver (is there, Angelo?) the only option I see is to force a compileOnSave of all files when a delta cannot be sent to the server. The price would be worse performance for some operations, but at least the developer could rely on the IDE.

@probert94
Copy link
Contributor

@lorenzodallavecchia Is microsoft/TypeScript#17493 somehow related to this?
This should be in Typescript 2.6 in October

@lorenzodallavecchia
Copy link
Contributor Author

Is microsoft/TypeScript#17493 somehow related to this?

@Springrbua it probably is! It looks like something that would make integration with Eclipse a lot easier.
When that feature is released we should probably review how builder deltas are communicated to the server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants