-
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 feature request: improve compiling functionality #19492
Comments
If i understand the requests correctly, these are all achievable in the API today. The API is intentionally split into smaller pieces to avoid long running operations on the server. the server is single threaded, and has no way to correctly interrupt/resume long running background tasks. we defer to the host to schedule these and cancel them as needed. |
no, we cannot achieve some of the functions using current API (without a session extension). Right now I see these problems:
|
the file would change on disk, is not that sufficient to update your state? we can make it send a response with the list of files written. but seems weird that you need that to refresh your state, these files could change in an out-of-band fashion any ways, e.g. a command line build command outside the editor.
not sure what you expect here. if the user chose to disable the feature why do you want to force enable it? |
We use this information in several ways:
We use "compileOnSave" flag for compiling on the fly. But WebStorm also has the explicit button "compile"(and "before run" task for compiling ts files) and users expect that the compiling will not taking into account the "compileOnSave" option. In fact it is not "compileOnSave" it just "compile" using the service. |
Should be a simple change to add. we can return a list of files written to disk.
Seems like you have a custom setup there. we make some assumptions based on compile-on-save being set, and decide not to keep a builder for instance. it should be possible for you to override the implementation of |
Yes, we have a similar solution for the problem. But the session api (even public) is not reliable (in Anyway thank you, I will try to send a PR for the first scenario. |
Sorry about that. we have added new tests to check the API changes at build time. so hopefully we do not get these unintentional changes in future versions. |
Thanks @anstarovoyt for creating this issue. I had created a similar issue than you at #17630 @anstarovoyt I tell me how to you support the case of user save a ts file which must be excluded. I suggested
and @mhegazy answered me:
Thanks for your answer. |
@angelozerr as I said before we extend the ts session and have own commands so we can do all the required checks on the tsserver side |
I forgot about #17630. this issue seems like a duplicate of #17630 then. thanks @angelozerr . closing in favor of #17630. |
OK I understand more now, but your goal is not to use tsserver instead of implementing your own ts session? Perhaps tsserver should provide a new |
you should be able to get that with |
Sorry @mhegazy you have already suggested me this solution and I hav enot give you an answer. Indeed I could consume ProjecInfo command but I'm afraid with performances. In Eclipse builder word, we receive a list of files or folders to compile, and you need to filter it ot not. If tsserver could provide an |
maybe i do not understand what |
Ok my goal is to use tsserver to compile ts files instead of using tsc with watch mode:
When an Eclipse project is opened, an Eclipse builder is executed and loop for each files of the project. In each loop I check if ts file must be compiled by calling You suggested me to consume
But I'm a little afraid with performance when projectInfo is called with a lot of ts files (the JSON response could be big). To support compile with tsserver with clean mean and good perforamnce, I will need:
Hope you will understand my need. |
That is the part i am confused about. you have some starting point, like a list of open files for instance, get the projectInfo for these, and that all you need to build.
We could make that work. but earlier you said the build loop works on .ts files and not the tsconfig.json. |
The list of files is not necessary opened. When you open an Eclipse project the first time, ther eare none opened files, but builder is called with a list of files (closed) of the project.
You suggested me to consume
the build loops for the whole files of the project (*.java, *.ts, *.json files ), but in my case I filter only ts files. |
do you assume all projects have tsconfig.json? |
Yes, I assume even that a projct can contains several tsconfig.json files. |
so filtering the tsconfig.json files, and then calling projectInfo would be a workable solution for you? if so, as i noted earlier we can make projectInfo work on tsconfig.json as well as .ts/.js files. |
I think it can be a good solution.
It should be very cool! |
A PR would be appreciated. |
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed. |
First of all thanks for implementing the feature: #19336
It allows us to remove own implementation of the command "reload" in the next versions of WebStorm.
In the latest WebStorm release we have rewritten the service integration and now we use own extension of tssever only for compiling.
For complete removal the extension we need a couple new features:
The text was updated successfully, but these errors were encountered: