Does this issue occur when all extensions are disabled?: Yes/No
- VS Code Version: (ex: 1.89.1)
- OS Version: (ex: Windows 10 / Windows 11)
Steps to Reproduce:
- Open a single-folder workspace containing many
.htm files.
(Note: several dozen files were open in the editor.)
- Live Server extension active.
- Perform a global Replace All from the search panel.
Replacement pattern used:
.css?v=c" → .css?v=d"
- Observe that many
.htm files are unexpectedly emptied.
Description:
During a global Replace All operation in Visual Studio Code, I encountered a severe issue:
➡️ VS Code emptied the entire content of hundreds of my .htm files.
Only .htm files were affected, but the impact was extremely damaging.
Context:
- Workspace: a single folder opened directly (not multi-root)
- Several dozen files were open in the editor
- Extensions active: Live Server
- Git was not initialized
- Regex was disabled
- Replace All was triggered from the global search panel
- Replacement pattern:
.css?v=c" → .css?v=d"
Observed behavior:
- After clicking Replace All, VS Code emptied the content of a very large number of
.htm files
- No warning or confirmation dialog appeared
- Fortunately, not all files were emptied, but almost half of them
Expected behavior:
- Replace All should never delete the entire content of files
- A confirmation dialog should appear when many files will be modified
- Replace All should only modify matched text, not wipe files
- VS Code should not silently corrupt or empty files under any circumstances
Impact:
This resulted in the loss of hundreds of HTML files and required manual recovery.
This behavior is extremely dangerous for users working on large projects.
Additional notes:
I can provide more details or logs if needed.
Thank you note:
Despite this incident, I want to sincerely thank the VS Code team for this amazing tool.
I use it every day and it has become essential to my work.
Your work is truly appreciated — thank you for building and maintaining such a powerful and inspiring editor.
Does this issue occur when all extensions are disabled?: Yes/No
Steps to Reproduce:
.htmfiles.(Note: several dozen files were open in the editor.)
Replacement pattern used:
.css?v=c"→.css?v=d".htmfiles are unexpectedly emptied.Description:
During a global Replace All operation in Visual Studio Code, I encountered a severe issue:
➡️ VS Code emptied the entire content of hundreds of my
.htmfiles.Only
.htmfiles were affected, but the impact was extremely damaging.Context:
.css?v=c"→.css?v=d"Observed behavior:
.htmfilesExpected behavior:
Impact:
This resulted in the loss of hundreds of HTML files and required manual recovery.
This behavior is extremely dangerous for users working on large projects.
Additional notes:
I can provide more details or logs if needed.
Thank you note:
Despite this incident, I want to sincerely thank the VS Code team for this amazing tool.
I use it every day and it has become essential to my work.
Your work is truly appreciated — thank you for building and maintaining such a powerful and inspiring editor.