Skip to content

Update imports takes too long to show on large projects (up to 2 minutes) #41508

Closed
@OliverJAsh

Description

@OliverJAsh

TypeScript Version: 4.0.2

Search Terms: rename move file update imports

Code

Unfortunately I cannot provide a reduced test case as I can only reproduce this on our very large project, but I can provide the following:

  • screen recording
  • tsserver verbose.log
  • access to the project along with steps to reproduce:
    1. Clone and checkout https://github.com/unsplash/unsplash-web/tree/typescript-rename-issue, branch typescript-rename-issue. This is a private repository but I believe some members of the TS team already have access from debugging previous issues. If you don't have access, please send me your email address so I can provide access (TS team members only).
    2. Run yarn to install TS
    3. Open VS Code
    4. Select workspace TS version
    5. Open app/components/VisualSearchFormPopover/VisualSearchFormPopover.tsx
    6. Rename this file

I had a quick look through the TSServer log to see if anything obvious stood out. It looks like getEditsForFileRename is taking too long:

Info 2081 [11:33:26.251] FileWatcher:: Added:: WatchInfo: /Users/oliverash/Development/unsplash-web/node_modules/@sentry/utils/dist/instrument.d.ts.map 2000 undefined Project:  WatchType: Missing source map file
Info 2082 [11:33:26.252] FileWatcher:: Added:: WatchInfo: /Users/oliverash/Development/unsplash-web/node_modules/@sentry/utils/dist/dsn.d.ts.map 2000 undefined Project:  WatchType: Missing source map file
Info 2083 [11:33:26.252] FileWatcher:: Added:: WatchInfo: /Users/oliverash/Development/unsplash-web/node_modules/@sentry/utils/dist/index.d.ts.map 2000 undefined Project:  WatchType: Missing source map file
Perf 2084 [11:34:43.151] 45::getEditsForFileRename: elapsed time (in milliseconds) 92021.5584
Info 2085 [11:34:43.152] response:
    {"seq":0,"type":"response","command":"getEditsForFileRename","request_seq":45,"success":true,"performanceData":{"updateGraphDurationMs":5089},"body":[{"fileName":"/Users/oliverash/Development/unsplash-web/app/components/VisualSearchFormPopover/index.ts","textChanges":[{"start":{"line":1,"offset":16},"end":{"line":1,"offset":41},"newText":"./VisualSearchFormPopover2"}]}]}

Potentially related: this project uses project references and the root tsconfig.json is a "solution" style project. I tried disabling project references but the problem remained.

Expected behavior:

Actual behavior:

Playground Link:

Related Issues:

I've ran into this before but it was fixed. For some reason, it seems to be broken again. Whether that's due to a change in TS or a change in our codebase, I do not know.

Related:

Metadata

Metadata

Assignees

Labels

Needs InvestigationThis issue needs a team member to investigate its status.Needs More InfoThe issue still hasn't been fully clarified

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions