-
Notifications
You must be signed in to change notification settings - Fork 12.8k
TSServer updates entire project when adding a new file #38210
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
Comments
Also note that in composite projects it is not maintainable to use "Files" because we would need to specify every single file. |
This is working as intended since when you are not specifying include file, the new file is part of the existing project so that project is updated. |
Thank you @sheetalkamat for the quick answer. A bit a context: So we are isolating scenarios that are slow when refactoring; creating a new file is one of them. It is not clear why TSServer needs to do a lot of work when we create a new empty file. Without using project references, we would specify in our tsconfig the list of entry files of the project. With this setup creating a new empty file and opening it is super fast but we can't get this experience with project references. Would it be prioritized to improve some refactoring scenarios to make them as fast as without project-references? If so we are willing to provide you with a number of small repros for problems which contribute to the overall frustration of our developers. |
Would like to know more about why the refactoring experience is better without project references. We have made lot of changes to ensure refactoring with project references is more complete.
New file when created as mentioned earlier is part of the existing project and hence that needs to be updated. We also made some changes recently to our resolution cache to handle new file creation specifically #37055 and #37121 and are part of 3.9 so would like feedback and/or repro with latest changes to be able to see what more needs to be done |
This issue has been marked 'Working as Intended' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
@sheetalkamat We are currently on TS 3.8, The perf improvement brought by 3.9 are exciting. We are going to re-evaluate the perf of refactoring in our repo once we move to 3.9. If the issues we have been experiencing persist then we will open other bugs with specific repro. |
When using { "include" : ["."] } in tsconfig, TSServer takes a lot of time when adding a new file compared to when using { "files": ["./index.ts"] }.
It would be tedious to have to maintain a list of exported modules in tsconfig.json simply to get faster refactoring experience.
TypeScript Version: 3.9.0-dev.20200427
Search Terms:
VSCode
IntelliSense
Include
Files
TSServer
Code
See repro here
Expected behavior:
When adding a new file to a project the amount of work done by TSServer is independent of the amount of code present in the project.
Actual behavior:
When using { "include": ["."] } adding a new file seems to trigger a lot of work for TSServer, and this work seems to depend on the amount of code already in this project.
Note that this does not happen when we use { "files": ["./index.ts"] }
The text was updated successfully, but these errors were encountered: