Search code examples
visual-studio-code

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

  • 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.