vscode-remote-workspace icon indicating copy to clipboard operation
vscode-remote-workspace copied to clipboard

some directories empty after refresh

Open student020341 opened this issue 6 years ago • 12 comments

When refreshing the workspace, sometimes (75% of the time) a random directory that was open will now be empty. I can work around the issue by closing and opening vs code (or running the reload command).

The issue frequency is lower if I collapse everything before I refresh, but multiple refreshes do not fix it. Sometimes the contents of the directory appear for a second after an additional refresh, but they quickly disappear. I relaunched vscode with debug=1 in the connection uri and there was no output,

steps to reproduce (does not happen consistently though)

  • have multiple workspace folders open that each have sub directories
  • create a new file server side in 1 of the sub folders
  • refresh to see the new file
  • 1 of the sub directories may now have no contents in vscode
  • additional refresh may cause the empty directory to show contents before being empty again

Low priority since the work around is to reload vscode, but that initial connection takes longer than the refresh, so that time will eventually add up.

student020341 avatar Dec 13 '18 18:12 student020341

I'm experiencing the same issue. Some directories collapse on their own. Clicking the triangle next to the directory then does nothing.

nikhilweee avatar Feb 11 '19 14:02 nikhilweee

I'm having the same issue, and it looks to me it happens when switching editor tabs of files in different folders. I guess the explorer tries to find the folder of the current visible file to bring it in sight, and for any reasons it lose the content.

espositofulvio avatar Feb 18 '19 12:02 espositofulvio

any other code plug-in to recommend? This issue is really annoying. Thinking of switching to something else...

wandonye avatar Feb 23 '19 02:02 wandonye

Same here, specially when you create a new file in a folder connected by ftp.

fmalekpour avatar Mar 03 '19 09:03 fmalekpour

This problem lets me stop use this. I hope the problem will be resolved soon.

fukasugi avatar Mar 03 '19 09:03 fukasugi

Same problem. Makes this extension unusable.

Pahvi67 avatar Mar 04 '19 08:03 Pahvi67

Another option I've found for refreshing the view of the folder while it is open is to try creating a new folder in the directory that is the problem. If the folder is expanded but seems empty, and I right click it to create a new folder, I briefly see the other files. If I cancel that and try to create a new folder again, the contents of the expanded directory will stay until I switch editor tabs.

This is using SFTP.

colegleason avatar Mar 12 '19 21:03 colegleason

A workaround I've found is to set explorer.autoReveal to false. It prevents the file explorer to bring in sight the current visible file and, at least for me, files don't disappear anymore.

espositofulvio avatar Mar 27 '19 16:03 espositofulvio

A workaround I've found is to set explorer.autoReveal to false. It prevents the file explorer to bring in sight the current visible file and, at least for me, files don't disappear anymore.

Very interesting workaround, it also works in my setup too. I've checked the logfile, and there is nothing of relevance to this issue in there.

aboulfad avatar Mar 28 '19 12:03 aboulfad

@espositofulvio that work around did not work for me, unfortunately. In fact, after a recent update, this issue seems to be even worse. When I reload vs code, the bugged folders don't reload!

I notice that clicking the refresh button doesn't seem to do anything now until you actually change the state of your editor. If I open a folder and reload, nothing happens. If I open a file from that folder and then refresh, you'll see it actually start refreshing and then the bug has a chance to happen again.

The work around if it does happen is unfortunate, but I've found success with changing the state of the editor (by opening a random file I don't need to work on) and then trying a refresh again. It seems like the directory I opened that file from loses its content, but the other directory I'm trying to access regains its content.

It could be related to auto reveal trying to focus on / find that file in the directory. That might explain the behavior I'm seeing. But for whatever reason, disabling all 3 auto reveal did not fix it for me.

student020341 avatar Mar 28 '19 12:03 student020341

@espositofulvio that work around did not work for me, unfortunately. In fact, after a recent update, this issue seems to be even worse. When I reload vs code, the bugged folders don't reload!

I notice that clicking the refresh button doesn't seem to do anything now until you actually change the state of your editor. If I open a folder and reload, nothing happens. If I open a file from that folder and then refresh, you'll see it actually start refreshing and then the bug has a chance to happen again.

The work around if it does happen is unfortunate, but I've found success with changing the state of the editor (by opening a random file I don't need to work on) and then trying a refresh again. It seems like the directory I opened that file from loses its content, but the other directory I'm trying to access regains its content.

It could be related to auto reveal trying to focus on / find that file in the directory. That might explain the behavior I'm seeing. But for whatever reason, disabling all 3 auto reveal did not fix it for me.

@student020341 Unfortunately I don't have anything else to try. I didn't look at the code of this extension nor vscode itself, but given the way the extension behaves my hunch is that something is wrong with the browser "reveal". I don't know if the extension tries somehow to refresh the revealed folder and something bad happens or whatever. The refresh trick usually works for me if I close all the files in the disappeared directory and then click refresh. If you have more than one folder disappearing you need to close all files in those and try to refresh. I hope this help and really hope this issue will be fixed soon as it's really annoying.

espositofulvio avatar Mar 28 '19 14:03 espositofulvio

Maybe having files open from different directories when I tried to refresh is the issue, then. It's not a huge deal since there are work arounds that still work. We just need to be glad the sftp issue was fixed, hah. If that didn't work I was going to move to VIM because I really like the idea of remote editing.

My other concern was that each vs code window was causing like 50 connections to our development server. But after a recent update that's down to like 16 or something. So I'm still considering other options, but this is probably the best vs code plugin for this sort of thing.

student020341 avatar Mar 28 '19 14:03 student020341