Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(language-service): use tsLSHost to do module resolution
This is a patch PR for #32479 This PR fixes a critical performance issue where the language service makes a MASSIVE number of filesystem calls when performing module resolution. This is because there is no caching. To make matters worse, module resolution is performed for every program change (which means every few keystrokes trigger a massive number of fs calls). There are two solutions here: Provide a cache to ts.resolveModuleName() Use ts.LanguageServiceHost.resolveModuleNames() Since every Project (and by extension ConfiguredProject) implements ts.LanguageServiceHost interface, (2) is the preferred solution here. i.e. the TypeScript LanguageServiceHost always has the resolveModuleNames() defined even though it's optional in the interface.
- Loading branch information