142

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?

QHarr
  • 83,427
  • 12
  • 54
  • 101
Jonathan
  • 2,700
  • 4
  • 23
  • 41

4 Answers4

246

I think, I understood correct. You can follow below steps.

  1. Press Ctrl + Shift + P
  2. type command Clear Editor History
  3. Press Enter

It will solve your problem.

Sebastián Palma
  • 32,692
  • 6
  • 40
  • 59
Ankit Jain
  • 2,576
  • 1
  • 10
  • 4
12

For me on macOS the following has worked:

  1. Press Cmd + Shift + P
  2. Type command Clear Search History
  3. Press Enter

Then for the search results:

  1. Press Cmd + Shift + P
  2. Type command Clear Search Results
  3. Press Enter
esengineer
  • 9,514
  • 7
  • 45
  • 69
11

This worked for me.

Adding this task in .vscode/tasks.json:

{
  // See https://go.microsoft.com/fwlink/?LinkId=733558
  // 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"
      ...
    }
  ]
}
Ishtiaque Khan
  • 1,196
  • 1
  • 10
  • 18
0

On Windows 10 go to search box and enter "%appdata%". After, delete the folder "code"

Bissiatti
  • 1
  • 1