2

Using VS Code and I noticed that files changed externally were not being noticed or picked up by VS Code. Googled and found that the setting for it is files.useExperimentalFileWatcher = true.

I set that up and now changes are refreshed but there is no warning or even indication in VS Code that file was changed externally (and therefore refreshed.)

If I have some unsaved changes in VS Code and the file on disk is changed externally, VS Code neither refreshes (which is good, would lose edits) nor warns (which is bad - you could lose what was changed externally.)

There seems to be no way to force Code to refresh or otherwise deal with the issue. This SO question (Visual Studio Code: Auto-refresh file changes) seems to imply that some diff type window/dialog opens but I don't see that.

Is there a setting for this or is this a bug?.

Currently on v1.25.1, W10 x64

JoelAZ
  • 3,875
  • 1
  • 11
  • 15

1 Answers1

-1

I'm using 1.26.1 on Windows 10, and though I can't get files.useExperimentalFileWatcher = true to do anything, I do get a notification in the lower-right corner: if I start editing a file and in the meanwhile it is modified by another program, there's no warning at first, but when I try to save it I get this popup:

VS Code Failed to save please compare

And by clicking on Compare I get to this screen:

VS Code Compare files

Notice the buttons on the right to accept or discard the change.

If you don't get this option, it's likely a bug. Try updating to the latest version, it's possible it's already been solved.

  • So you only get a warning if/when you try to save the file over an external edit? That's an odd behavior. I mean, better than clobbering but a little too late to be actually useful. Especially if I'd want to view the changed file or monitor for changes. What I expect is the same behavior of most editors I've encountered (pop up as soon as a file changes (and VSC is in focus.) NPP, Atom, Eclipse for example behave that way.) It's odd imo (and less useful) for VSC not to do it the same. – JoelAZ Sep 02 '18 at 18:59
  • I completely agree with you, that's why I left [a comment](https://stackoverflow.com/questions/30078077/visual-studio-code-auto-refresh-file-changes/30083688#comment91186367_30083688) under the accepted answer to the same question that you linked to, asking whether anyone has already opened an issue. Let's see... – Fabio says Reinstate Monica Sep 02 '18 at 20:29
  • Upvoted both your comments. Also @warrenp (2nd comment in first answer) saying same thing – JoelAZ Sep 03 '18 at 22:41