Repository navigation
TSServer updates entire project when adding a new file #38210
Description
Activity
Also note that in composite projects it is not maintainable to use "Files" because we would need to specify every single file.
sheetalkamat commented
on Apr 27, 2020 MemberMore actionsThis 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.
- addedWorking as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
on Apr 27, 2020 Thank you Sheetal Nandi (@sheetalkamat) for the quick answer.
A bit a context:
Our repository contains 250+ packages/projects. We chose to use project references for the better IntelliSense experience it brings in most scenarios. Developers working on our repo as well as other large repos report that the IntelliSense experience when refactoring is way better in the repos that don't use project references.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.
sheetalkamat commented
on Apr 29, 2020 MemberMore actionsOur repository contains 250+ packages/projects. We chose to use project references for the better IntelliSense experience it brings in most scenarios. Developers working on our repo as well as other large repos report that the IntelliSense experience when refactoring is way better in the repos that don't use project references.
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.
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.
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
cc: Ryan Cavanaugh (@RyanCavanaugh) Daniel Rosenwasser (@DanielRosenwasser)
typescript-bot commented
on May 1, 2020 ContributorMore actionsThis issue has been marked 'Working as Intended' and has seen no recent activity. It has been automatically closed for house-keeping purposes.
Sheetal Nandi (@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.
Reacted by Sheetal Nandi- locked as resolved and limited conversation to collaborators
on Oct 21, 2025
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"] }