Visual Studio Code: Auto-refresh file changes

Working with Visual Studio Code I have noticed if a file you are working with change, whenever that file get focused in a code panel it will be reloaded from the disk (if you don't have changes in the file through VSCode).

However, if you are on that file there is no alert to warning you about file changes.

I've been reviewing the settings and I cannot find anything like the visual studio option:

Detect when file is changed outside the environment

So my question: Is there any hidden setting or some hack to make that warning happen.

Update

Solved in version 0.3.0 of Visual Studio Code.

  1. The file will be updated from disk if there is no changes through the editor. (very useful to read log files during a process execution)
  2. If there are changes on both sides (from disk and through the editor) when ever you try to save the file using VSCode, the editor will warn you about that situation (i.e. "dirty writes") and a file comparison will allow you to decide what to do.

Solution 1:

VSCode will never refresh the file if you have changes in that file that are not saved to disk. However, if the file is open and does not have changes, it will replace with the changes on disk, that is true.

There is currently no way to disable this behaviour.

Solution 2:

{
    "files.useExperimentalFileWatcher" : true
}

in Code -> Preferences -> Settings

Tested with Visual Studio Code Version 1.26.1 on mac and win

Solution 3:

SUPER-SHIFT-p > File: Revert File is the only way

(where SUPER is Command on Mac and Ctrl on PC)

Solution 4:

In version 1.57.1 (June 2021) there is still no setting like Detect when file is changed outside the environment. But if the file was accidentally changed outside, you can easily revert the changes with just the Undo (Ctrl+Z) command