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

File explorer is not updated after many file changes occur #28432

Closed
jeremy447 opened this issue Jun 10, 2017 · 96 comments
Closed

File explorer is not updated after many file changes occur #28432

jeremy447 opened this issue Jun 10, 2017 · 96 comments
Assignees
Labels
file-watcher File watcher info-needed Issue requires more information from poster upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Milestone

Comments

@jeremy447
Copy link

jeremy447 commented Jun 10, 2017

Hello,

I noticed that sometimes (often ?) the file explorer doesn't get updated (missing files/folder) after creating new files/folders with something like a git pull or using symfony console to generate files.

Refreshing the explorer using the little refresh icon make the files/folders appear.

This is a follow up of this issue #24309

  • VSCode Version: 1.21
  • OS Version: Ubuntu 17.10 / Fedora 27

Thanks !

@ramya-rao-a ramya-rao-a added the file-explorer Explorer widget issues label Jun 12, 2017
@bpasero bpasero added the file-watcher File watcher label Jun 13, 2017
@bpasero bpasero added this to the Backlog milestone Jun 13, 2017
@bpasero bpasero added the bug Issue identified by VS Code Team member as probable bug label Jun 13, 2017
@mattflix
Copy link

mattflix commented Jun 23, 2017

VS Code used to nicely auto-refresh all external file system changes.

Now (seemingly) nothing is auto-refreshed. In the file explorer, for example, I am now forced to press the refresh icon to get externally changed folders and files to appear. If config files are changed (tasks.json, launch.json, etc.) I have to close/open VS Code to get the changes recognized.

Please fix!

Software:

  • VS Code 1.13.1
  • Windows 10

(And, yes, I have tried restarting Windows.)


EDIT:

I am only seeing this under Windows.

VS Code 1.13.1 running on Mac correctly auto-refreshes the file explorer and editors whenever the file system changes. So, seems that something broke only on Windows?

I went back to VS Code 1.11.0 and 1.12.0 on Windows and still auto-refresh was not working. So, I don't know when it broke.

EDIT 2:

Please see my comment in #24995 about VS Code ignoring changes in any folder named "node_modules". Turns out, this way my issue (see my comment #24995 for my use-case).

Please don't make the assumption that every folder named "node_modules" should be magically ignored. It can break legitimate uses of the Node Module Resolution Algorithm.

@mattflix
Copy link

mattflix commented Jun 24, 2017

I launched with Code --verbose and, whenever I change files somewhere within the folder (currently open in Code), I see lines like this fly by in the verbose output:

[5624:0623/174920.757:INFO:CONSOLE(28)] "%c[File Watcher]", source: file:///C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/electron-browser/workbench.main.js (28)
[5624:0623/174920.759:INFO:CONSOLE(28)] "%c[File Watcher]", source: file:///C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/electron-browser/workbench.main.js (28)
[5624:0623/174920.878:INFO:CONSOLE(28)] "%c[File Watcher]", source: file:///C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/electron-browser/workbench.main.js (28)

So, it seems like the VS Code process is aware of the file system changes, but the updates are not making it all the way to the user-interface.

@dmlemos
Copy link

dmlemos commented Jul 12, 2017

VSCode doesn't handle refresh properly when working on a multi-folder root. I have to manually trigger Files: Refresh Explorer

The files were not in git.

@IllNate
Copy link

IllNate commented Jul 17, 2017

I would also prefer the explorer to refresh automatically. I can't see any benefit of not.

I imagine that this is not done, because the explorer 'jumps' to the open file when refreshed. But I also don't like this behavior. I don't think the scroll should change when refreshing.

Thanks for your great work!

@jeremy447
Copy link
Author

It's an important bug that can lead to error. I hope it can be fixed as soon as possible.

@devvedNET
Copy link

I agree with @Paviluf. If I git pull, I expect my explorer within vscode to automatically be updated to reflect the latest changes of my repo. Instead, I don't see those updates reflected until I click the refresh icon in vscode. The additional step of clicking refresh shouldn't be required. 🕷

This is a standard feature in every other ide.

@Mikeysax
Copy link

Mikeysax commented Oct 18, 2017

I've also experienced this after switching branches and pulling latest code. The tree was not updated and it left me confused as to why I couldn't find specific files I knew existed.

VScode 1.17.2
Manjaro Linux, kernel 4.13

@kieferrm
Copy link
Member

kieferrm commented Nov 1, 2017

@Tyriar shouldn't the new file watcher improve the experience?

@Tyriar
Copy link
Member

Tyriar commented Nov 1, 2017

@kieferrm there are some issues with the new watcher (here) and some with the older watcher as well (eg. this issue). I think performance is generally better with the new one, supporting multiple roots was easy and it's now using the same watcher on all platforms (before we hand-wrote/owned the Windows one).

@boyangwang
Copy link

Hi, is this fixed? I'm still seeing this under macOS, 1.19.1

@mattflix
Copy link

mattflix commented Jan 2, 2018

@boyangwang, nope not yet fixed under MacOS or Windows.

@thoqbk
Copy link

thoqbk commented Jan 16, 2018

In MacOS, I press Cmd + b then Cmd + b again refresh.

@mattflix
Copy link

@thoqbk, the issue is not that you cannot refresh the explorer manually, but rather that the explorer doesn't refresh automatically (which it did used to, but that behavior broke somewhere along the way).

@thoqbk
Copy link

thoqbk commented Jan 16, 2018

@mattflix, yes I know that. I tried to find some shortcut keys to refresh manually but it doesn't work.
Finally, I found Cmd + b, which is my favorite keys, could help.

@dungle-scrubs
Copy link

dungle-scrubs commented Jan 24, 2018

@thoqbk I'm in MacOS and experiencing the same problem, but Cmd + b (twice) doesn't refresh the explorer for me. Are you aware of a menu option for refreshing?

update: Just finally saw the refresh button in the explorer, looks like a circular arrow

@ZoeVonFeng
Copy link

Linux 17.10 x64 is having same problem that file explorer is not updated.

@SamyBencherif
Copy link

High Sierra 10.13.1 (17B1003) having the same problem.

@bsendras
Copy link

Still happening in vsCode v1.19.3 macOs with High Sierra 10.13.3, even having the scm activity panel selected. Please, take care of this issue. It is annoying to have to click on the refresh button and using git integration gets confusing.

@zackify
Copy link

zackify commented Jan 29, 2018

Yep, still happens all the time. CMD + P > Reload Window is a daily thing for me.

@tapz
Copy link

tapz commented Nov 13, 2019

After installing MacOS Catalina, file changes are not reflected to the Explorer and add-ons do not get get that information either.

VSC: 1.40.0
MacOS: 10.15.1 (19B88)

@goldbergyoni
Copy link

After installing MacOS Catalina, file changes are not reflected to the Explorer and add-ons do not get get that information either.

Same here

@newmrdenis
Copy link

Any changes on this issue? I am working via ssh using sshfs (remote filesystem) and after any manipulations performed on connected computer changes doesn't appear on mine( After manually refreshing list of files using corresponding button all appears. It makes me sometimes crazy

@Kiel-H-Byrne
Copy link

i created a new file with "touch blahblah.js" and doesn't show up after changes/saving/etc....

@giulianisanches
Copy link

I'm having this issue and the behaviour is exaclty what @marvila commented above. If i open a folder that is a simbolic link, my source control file explorer does not update.

Version: 1.40.2
Commit: f359dd69833dd8800b54d458f6d37ab7c78df520
Date: 2019-11-25T14:54:40.719Z
Electron: 6.1.5
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Linux x64 4.12.14-lp151.28.32-default

@Ciantic
Copy link

Ciantic commented Jan 9, 2020

I have renamed a src folder, and now when I do "Go to File..." there is a lot of dead files there. I tried "Refresh File Explorer" and restarting/reloading VSCode. Neither works, I have to try to navigate file and get the error "Unable to read file" then it will update that file (by removing it from index), but not all files.

Is there a way to force refresh all files? I think the watcher isn't working in Windows.

@mertyuksel
Copy link

VS Code: 1.42.0
Ubuntu: 18.04

I was getting that notification "Visual Studio Code is unable to watch for file changes in this large workspace" when I opened a laravel project in VS code, and also my file explorer didn't refresh itself when I added a new file. Then I tried this quick solution here, and my file explorer problem was automatically solved.

It might help someone else that has the same problem as me.

@BernardA
Copy link

Files are not updated when pulling from origin, even after manually triggering refresh of the explorer. Only old version available, though I can diff the commits with git diff HEAD^ HEAD.

I am forced to clone origin once again.

@RichIsOnRails
Copy link

Having a similar issue. My file list does not update for any terminal actions that create new commands:

Version: 1.47.3 (user setup)
Commit: 91899dc
Date: 2020-07-23T13:12:49.994Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.19041

This is on remote WSL2. I can open the folder locally on the filesystem and it works fine. As a somewhat unrelated note, the Linux build also works fine so this issue appears to be related to the WSL remote functionality.

@iPankajrai
Copy link

I'm also facing the similar issue with the VS Code. I'm using laravel framework. and whenever I create any file using make:controller anyfilename , in terminal, the file does not get updated in file system of vs code.

Hoping for this bug to be fixed as soon as possible.

@anhlqn
Copy link

anhlqn commented Oct 15, 2020

Version: 1.50.0 (system setup)
Commit: 93c2f0f
Date: 2020-10-07T06:10:52.432Z
Electron: 9.2.1
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.19041

Windows 10 with WSL 2 and Ubuntu 18.04.
Still having the issue after trying other changes previously suggested.

@boblitex
Copy link

boblitex commented Oct 16, 2020

Version: 1.50.0 (system setup)
Commit: 93c2f0f
Date: 2020-10-07T06:10:52.432Z
Electron: 9.2.1
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.19041

Windows 10 with WSL 2 and Ubuntu 18.04.
Still having the issue after trying other changes previously suggested.

probably a wsl 2 issue, I have the same problem with Ubuntu 20.04

I also don't have IntelliSense for my node modules

@dhunt84971
Copy link

Version: 1.51.1
Commit: e5a624b
Date: 2020-11-10T23:31:29.624Z
Electron: 9.3.3
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Linux x64 5.4.0-7634-generic

I am having a similar issue using Ubuntu 20.04, but it seems to occur only if the file is named .settings

To reproduce the issue:

  1. Create a file named .settings in the root of the project folder from a terminal using touch.
  2. The VSCode explorer will not show the recently added file.
  3. Clicking the refresh button does not show the file either.

Extensions installed:
code --install-extension brenosolutions.sqlformatter
code --install-extension dbaeumer.vscode-eslint
code --install-extension DotJoshJohnson.xml
code --install-extension eg2.vscode-npm-script
code --install-extension golang.go
code --install-extension HookyQR.beautify
code --install-extension Leopotam.csharpfixformat
code --install-extension ms-azuretools.vscode-docker
code --install-extension ms-dotnettools.csharp
code --install-extension ms-mssql.mssql
code --install-extension ms-python.python
code --install-extension ms-toolsai.jupyter
code --install-extension ms-vscode.cmake-tools
code --install-extension ms-vscode.cpptools
code --install-extension redhat.java
code --install-extension sensourceinc.vscode-sql-beautify
code --install-extension uctakeoff.vscode-counter
code --install-extension VisualStudioExptTeam.vscodeintellicode
code --install-extension vscjava.vscode-java-debug
code --install-extension vscjava.vscode-java-dependency
code --install-extension vscjava.vscode-java-pack
code --install-extension vscjava.vscode-java-test
code --install-extension vscjava.vscode-maven
code --install-extension Zignd.html-css-class-completion

@flcoder
Copy link

flcoder commented Nov 29, 2020

I was having this problem because I was in ~/proj1 which was a symlink to /mnt/d/p/proj1 and I typed code . to open vscode. When I closed vscode and typed cd /mnt/d/p/proj1 && code . vscode behaved fine, so it's an issue with symlinks (for me).

@miladtsx
Copy link

I had the same issue on Fedora 33, Code 1.51.1.
when I opened a workspace, VSCODE notified me with this message:

Unable to watch for file changes in this large workspace.

this link helped me to fix it:
https://code.visualstudio.com/docs/setup/linux#_visual-studio-code-is-unable-to-watch-for-file-changes-in-this-large-workspace-error-enospc

@erayerdin
Copy link

erayerdin commented Jan 3, 2021

Having the same issue in Kubuntu 20.04.1.

I recently migrated to Kubuntu. I was using Manjaro and it did not have this problem.

BTW, I see people do "Reload Window" thing. Don't do that, it's a waste of resource and time. Instead, do "Refresh Explorer" which only, well, refreshes file explorer.

Update

This solved my problem.

@paul-vd
Copy link

paul-vd commented Feb 18, 2021

The same issue on windows 10 wsl 2 using ubuntu remote.

  1. An easy way to recreate the problem, use terminal to create a folder in the current directory:
$ mkdir test
  1. The folder does not show up in vscode untill you hit the refresh icon:
    image

Update:

In my case it was because i had my project folder on my windows file system, instead of inside the wsl

C:/Users/Paul/Projects    <-- ❌ 
\\wsl$\Ubuntu\home\paul\projects  <-- ✔ 

@Ciantic
Copy link

Ciantic commented Feb 18, 2021

@PaulPCIO That is correct, if you want to follow that issue particluarily subscribe to this: microsoft/WSL#4739

Problem is that plan9 doesn't transfer file change events through the barrier. Practically this means you have to live in WSL file system or Windows file system, trying to mix the two will cause problems with dev tools. Personally I hope Microsoft implements real ext4 or linux compatible FS driver for Windows so that it won't require that hacky Plan9, instead the WSL could appear as real lettered drive without network mapping.

@bpasero
Copy link
Member

bpasero commented Jun 21, 2021

I think this issue has grown sufficiently enough that imho it is no longer possible to figure out each individuals issue people have with the file watcher in VSCode. If there are no objections I would like to close this one and open individual issues that are then easier to track.

Since this issue is specifically around the explorer not showing changes when they happen, I opened #126817 to investigate whether we could simply refresh the explorer automatically in certain situations to make the issue less likely to occur.

Some things I want to make clear:

  • file watching over network shares or symbolic links is provided without guarantee - they may or may not work but will often most likely not work
  • operating systems may have specific limits in how many file events they can report and may drop events on pressure - this is not really something VSCode can fix without implementing a custom file watcher on each OS that does not rely on native built ins from the filesystem
  • VSCode is relying on the operating system to report file events (Windows: FileSystemWatcher, macOS: fsevents, Linux: inotify)

If people have specific issues that are easy to reproduce, then please ping here and we can convert them into individual issues top level and further discuss. Please also be aware of other issues already reported: file-watcher File watcher

Thanks!

@bpasero bpasero added the info-needed Issue requires more information from poster label Jun 21, 2021
@bpasero bpasero closed this as completed Jun 29, 2021
@pauby
Copy link

pauby commented Jun 29, 2021

@bpasero When raising the new issues can you link them to this issue, so we can keep track? As you can appreciate this issue was raised over 4 years ago with no movement.

@bpasero
Copy link
Member

bpasero commented Jun 29, 2021

I will do my best 👍

@github-actions github-actions bot locked and limited conversation to collaborators Aug 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
file-watcher File watcher info-needed Issue requires more information from poster upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests