-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
TSServer: how does compile on save work in 2.0.6 #11526
Comments
One addition question: how would we find out if compileOnSave is enabled on a specific project. Currently we don't actively monitor project info or tsconfig.json file. Would we need to do so to find out if a certain file needs to be compiled on save or is this something CompileOnSaveAffectedFileListRequest would take into consideration by reporting no files or by signaling this otherwise. |
The |
It is not a builder queue, it is just a request queue. The server is single threaded, and can only cancel one request at a time. this allows the client to cancel the request and restart it as needed. |
I used the term builder queue since it is somehow strange to compile a TS file to JS without doing a syntax and semantic check as well. Consider the case where you save a file a.ts which causes a compile error in a file b.ts which could result in exceptions when executing b.js. I as a user would expect that if we write b.js we inform the user of potential problems in b.ts as well. Wouldn't it make more sense the server does this. It is a lot of traffic for something the server can implement a lot better. |
Sure. But not for this release. |
any news on this? |
+1 compileOnSave: seeing the effects of my bungling on closed files would be marvellous |
I'm implementing compile on save inside Eclipse, it starts working but I have a question when tss files have some errors. Imagine you have a export let PI = 3.14; and a import {PI} from "./a"
console.log(PI) In other words Now I changed export let PIXXXXXXXXXXXXXX = 3.14; and I save the file. The uses of I tell me if |
ping for status on this, can we expect this in the near future? |
Why are errors relevant here? Compile on Save should honor |
@movedoa not sure i understand what you are looking for |
@mhegazy Oh sry if that wasn't clear. |
I was following this too, not as a Question but as a bug/feature I expected to be fixed. Is that not the case? |
It is a question, and i believe it has been answered. From an tsserver API perspective, CoS is implemented already. if you have any issues with the API please file a new issue. |
@mhegazy when referring to CoS are you referring to a builder or to the CoS API to implement a builder in VS Code itself. As we discussed in various other situations implementing a builder in VS Code simply using the CoS API to travers the dependencies is not very efficient. |
Since this is now closed what is the appropriate bug to follow for compileonsave in vsc? |
TypeScript Version: 2.0.6-insider
I looked at the requests and it looks like that clients are responsible to trigger compile from the outside. My understanding is the following assuming that file a.ts changed.
If this is true then basically the client now implements a builder queue to make this performant. This is especially true if compileOnSave goes with auto save.
And how should I use the force flag. If a file requires n files to be recompiled do I have to call these n files with force= true. The files are usually unchanged.
The text was updated successfully, but these errors were encountered: