Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External file watcher fails for editors that do atomic saves #15111

Closed
jzeferino opened this issue Nov 7, 2016 · 10 comments
Closed

External file watcher fails for editors that do atomic saves #15111

jzeferino opened this issue Nov 7, 2016 · 10 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug file-watcher File watcher verified Verification succeeded
Milestone

Comments

@jzeferino
Copy link

  • VSCode Version: 1.7.1
  • OS Version: osx 10.11.6

Steps to Reproduce:

  1. Create a file with random text.
  2. Open it with vscode and TextEdit for example.
  3. Edit the file in TextEdit and save it.
  4. The file was refreshed in vscode.
  5. Keep editing the file in TextEdit and save it.
  6. vscode don't refresh the file only the first time, after that no more refresh occur.

side note: after editing the file in vscode and try to save it, and it shows a upper popup telling that the file has some diferences from the original and open a compare window.

@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster labels Nov 8, 2016
@bpasero bpasero added this to the Backlog milestone Nov 8, 2016
@bpasero
Copy link
Member

bpasero commented Nov 8, 2016

Please see if you can find any logged output that could help us find the source of the issue:

  • run code --verbose from the command line and attach the output
  • in Code select Help | Toggle Developer Tools and select the Console
  • attach any output you see in the Console you can find

Thanks!

@jzeferino
Copy link
Author

jzeferino commented Nov 9, 2016

I did that and this is the output:

screen shot 2016-11-09 at 4 18 46 pm

I've replicated exactly what I told above. Including the save in vscode after edited the file with external application, thats why the RED text appeared.

Full log here:

@bpasero
Copy link
Member

bpasero commented Nov 10, 2016

@jzeferino and your settings?

@jzeferino
Copy link
Author

@bpasero vscode settings? Or other settings?

@bpasero
Copy link
Member

bpasero commented Nov 10, 2016

@jzeferino yeah your vscode settings.json (and if you have workspace settings in the .vscode folder). I wonder if you maybe configured the file watcher exclude rules.

@jzeferino
Copy link
Author

@bpasero settings.json is empty and I didn't configured the file watcher exclude rules.

@bpasero bpasero added upstream Issue identified as 'upstream' component related (exists outside of VS Code) and removed info-needed Issue requires more information from poster labels Nov 11, 2016
@bpasero bpasero changed the title Update file modified with external text editor External file watcher fails for editors that do atomic saves Nov 11, 2016
@bpasero
Copy link
Member

bpasero commented Nov 11, 2016

I can reproduce and it is caused by the fact that TextEdit saves the file by first renaming it to another file (something that is called atomic save). The node file watcher we are using is probably stopping to watch at that time and gets disposed.

@bpasero
Copy link
Member

bpasero commented Nov 11, 2016

I have an idea how to fix 👍

@jzeferino
Copy link
Author

Good work. I was testing in on windows and it works good. There is any way to get a popup when the file is changed via external editor? Could I define it via settings?

@bpasero
Copy link
Member

bpasero commented Nov 12, 2016

No, that is not supported atm.

@bpasero bpasero removed the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label Nov 12, 2016
@bpasero bpasero modified the milestones: November 2016, Backlog Nov 12, 2016
@Tyriar Tyriar added the verified Verification succeeded label Dec 9, 2016
@bpasero bpasero added the file-watcher File watcher label Jun 8, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug file-watcher File watcher verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants