vscode: Dangling text file models of deleted files hanging around in memory
- VSCode Version: 1.45.1
- OS Version: Windows 10
Steps to Reproduce: Screencast:
- Open sample node project below in VS Code. dnd.zip
- Set the setting “typescript.updateImportsOnFileMove.enabled”: “always” or “never”.
- Click to open multiple files (e.g. src/utils/ma.ts, src/utils/mb.ts, src/utils/mc.ts, src/utils/md.ts) in VS Code.
- In File Explorer, drag and drop these files back and forth several times, e.g.
1st dnd: utils/m*.ts -> funcs/m*.ts
2st dnd: funcs/m*.ts -> utils/m*.ts
3rd dnd: utils/m*.ts -> funcs/m*.ts
- You would see the states for these opened editors are in chaos. Some showed as “deleted”, see the screenshot below. But actually these files exist. My initial finding was that vscode didn’t clear the opened text models for the old locations after the move operation, so that the next time you move back, vscode will try to reuse the previously cached text models.
Does this issue occur when all extensions are disabled?: Yes
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 18 (15 by maintainers)
Commits related to this issue
- Dangling text file models of deleted files hanging around in memory (fix #98057) — committed to microsoft/vscode by bpasero 4 years ago
- Dangling text file models of deleted files hanging around in memory (#98154) * Dangling text file models of deleted files hanging around in memory (fix #98057) * address feedback — committed to microsoft/vscode by bpasero 4 years ago
FYI - our current plan is to add API, e.g a workspace edit can say that it can be previewed and based on user-preference the preview pane will show. Similar to how rename (symbol) preview works