Refresh Visual Studio Code list of files

Visual Studio-Code

Visual Studio-Code Problem Overview


Visual Studio Code (Version 0.10.11, on OSX) does not refresh the files in a folder. Is there any way to force it to refresh. Currently I have to close and reopen the whole program.

Visual Studio-Code Solutions


Solution 1 - Visual Studio-Code

EDIT: In the meanwhile a reload button has been added to the file explorer widget.

Use the workbench.action.reloadWindow command. Go to File -> Preferences -> Keyboard Shotcuts and define a shortcut for this command. On my system it's placed on Ctrl+F5. The entry in keybindings.json looks like this:

{
  "key": "ctrl+f5",
  "command": "workbench.action.reloadWindow",
  "when": "editorTextFocus"
}

Solution 2 - Visual Studio-Code

If you hover over the workspace root in the navigator, four icons appear to the right of it. The third of those icons, a circular arrow, is Refresh -- it reloads the file list.

enter image description here

Solution 3 - Visual Studio-Code

You can use the command palette to reload the window:

  1. Open the command palette with View > Command Palette... (or Shift+Cmd+P on OS X)

  2. Type reload window and press enter

Solution 4 - Visual Studio-Code

You shouldn't need to reload the entire window, just the folder list. Reloading the window will kill terminals, lose undo history, etc. You can do this using the refresh button in the explorer (second from the right):

enter image description here

If you find you need to do this a lot you can add a keybinding for it, for example:

{
  "key": "ctrl+f5",
  "command": "workbench.files.action.refreshFilesExplorer"
}

Solution 5 - Visual Studio-Code

Ran across this today with VS Code 1.13.0 and in Keyboard Shortcuts I see

workbench.files.action.refreshFilesExplorer

Solution 6 - Visual Studio-Code

If you use the SFTP extension you can do this for refreshing the SFTP:EXPLORER list (tested on Windows with VSC 1.40.2):

File => Preferences => Keyboard Shortcuts => Search for: refresh

Then you have to find "Refresh / sftp.remoteExplorer.refresh" in the result list. Click the entry, then click the plus sign before the entry, then press your desired shortcut and hit "enter". I took "Ctrl + Alt + F5" because this has not been used for other commands already.

Solution 7 - Visual Studio-Code

To reload a single file:

  • ⇧⌘P
  • type "Revert File"

On Windows:

  • Ctrl + Shift + P
  • type "Revert File"

Tested in VSCode v1.18.1 on Windows

Solution 8 - Visual Studio-Code

Right-Click your sln (Will say 0/n solutions) In the bottom row of dialog it will say reload project solutions. If it's not present, then it was just reloaded most likely. Try to run build again.

Solution 9 - Visual Studio-Code

When search.maintainFileSearchCache option is enabled I started to find the files with I'm using Ctrl-P shortcut

enter image description here

Solution 10 - Visual Studio-Code

"Ctrl + Alt + R" on v 1.27.1 as of 9/11/18

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAJPView Question on Stackoverflow
Solution 1 - Visual Studio-CodeWosiView Answer on Stackoverflow
Solution 2 - Visual Studio-CodeAmigoNicoView Answer on Stackoverflow
Solution 3 - Visual Studio-CodeJason AndersonView Answer on Stackoverflow
Solution 4 - Visual Studio-CodeDaniel ImmsView Answer on Stackoverflow
Solution 5 - Visual Studio-CodeJack ClickView Answer on Stackoverflow
Solution 6 - Visual Studio-CodegagaView Answer on Stackoverflow
Solution 7 - Visual Studio-CodeDaveView Answer on Stackoverflow
Solution 8 - Visual Studio-CodeatreyHazelHispanicView Answer on Stackoverflow
Solution 9 - Visual Studio-Codeuzay95View Answer on Stackoverflow
Solution 10 - Visual Studio-CodegfunkjeffView Answer on Stackoverflow