Clear File Content Cache in Visual Studio Code
My Visual Studio Code, on a Windows Machine, Keeps on Showing Me the Previous Content of a File Even After This One Has Been Updated, While Notepad ++ Doesn't...
My Visual Studio code, on a Windows machine, keeps on showing me the previous content of a file even after this one has been updated, while notepad ++ doesn't behave in the same way.
Is there a way to somehow clean the cache so as to receive fresh content every time?
3 Answers
I think, I understood correct. You can follow below steps.
- Press Ctrl + Shift + P
- type command Clear Editor History
- Press Enter
It will solve your problem.
For me on macOS the following has worked:
- Press Cmd + Shift + P
- Type command Clear Search History
- Press Enter
Then for the search results:
- Press Cmd + Shift + P
- Type command Clear Search Results
- Press Enter
This worked for me.
Adding this task in .vscode/tasks.json:
{
// See
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "clear-editor-history",
"command": "${command:workbench.action.clearEditorHistory}"
}
]
}
And using the task in launch configuration (.vscode/launch)
{
"version": "0.2.0",
"configurations": [
{
...
"preLaunchTask": "clear-editor-history"
...
}
]
}