question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow to configure editor auto reload behaviour

See original GitHub issue

VSCode Version: 1.10.2 OS Version: macOS 10.12.3

Steps to Reproduce:

  1. Open editor
  2. Modify a file in your git repository, but don’t save it
  3. Checkout a different branch that touches the same file
  4. Go back to the editor and try to save
  5. ERROR: “Failed to save ‘file1’: The content on disk is newer. Click on Compare to compare your version with the one on disk.”

Personally I would like to see the files being reload from the disk every time without prompt. With git I don’t have to worry about losing history. Similar to how SublimeText works. When the files change in disk (ex: change of branches), they get automatically reloaded, independently of their current state in the editor. I prefer this behaviour, rather than having to confirm reloads.

With that said however, there must be options for all the use cases. Many people prefer to be notified of changes in their files! Suggestion to add an editor.autoReload parameter in order to control this behaviour. Possible values:

  • Always - reload from disk without prompt
  • Confirm - show a prompt confirmation to either accept or discard the changes
  • Backup - show the file with the new changes automatically, but always backup the old state to ‘filename.bak’
  • Never - current behaviour?

Evolved the idea from @rmunn on #23043 issue. Decided it was best to create a separate issue for this.

EDIT: Made it clear that it is mandatory to implement this feature with all the use cases in mind, and added new options.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:52
  • Comments:77 (19 by maintainers)

github_iconTop GitHub Comments

9reactions
BillDentoncommented, Sep 25, 2018

This is how Visual Studio 2017 handles files changed in the background: image This is the kind of behaviour I would like to see Visual Studio Code.

8reactions
jeffwright13commented, Mar 18, 2021

Wow, looks like this feature request has fallen into a black hole. This is a shame. I really like the look and feel of VSCode, but not having it prompt me when a file is about to be updated is a deal breaker for me. Back to Notepad++ 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

Edit running code with Hot Reload - JetBrains Rider
When Hot Reload is enabled for debugging, there are two ways to apply changes that you made. You can choose one of them...
Read more >
Visual Studio Code: Auto-refresh file changes - Stack Overflow
Working with Visual Studio Code I have noticed if a file you are working with change, whenever that file get focused in a...
Read more >
XAML Hot Reload for Xamarin.Forms - Microsoft Learn
Even with a rude edit, you can continue to reload without restarting the app - make another change elsewhere in the XAML file...
Read more >
VS Code Live Server – How to Auto-Refresh Your Browser ...
Once you make changes in your code or write something new, after saving it, the browser will auto-refresh itself. Then you will be...
Read more >
User and Workspace Settings - Visual Studio Code
Each setting can be edited by either a checkbox, an input or a dropdown. Edit the text or select the option you want...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found