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

Watcher events not triggered when folder is renamed or deleted from VSCode #90746

Closed
savpek opened this issue Feb 15, 2020 · 4 comments
Closed
Assignees
Labels
file-watcher File watcher info-needed Issue requires more information from poster

Comments

@savpek
Copy link

savpek commented Feb 15, 2020

During development of OmniSharp/omnisharp-roslyn#1694 i tried to figure out why removal of folders didn't send any events for backend. Tracked down that on VsCode side file watched doesn't get triggered in two cases: when folder is renamed or deleted from vscode.

There are similar issues reported when files are handled outside of vscode (like mv command) but didn't find one that matches this case when directly made from vscode UI.

  • VSCode Version: 1.42.1 c47d83b x64
  • OS Version: Win10

Steps to Reproduce:

  1. Delete folder from VsCode (or rename folder)

image

What i expect to see is all files under folder gets onDidDelete from watcher, but nothing gets triggered. Similiar thing happen if i rename folder from vscode, no events triggered and any change to files under folder after that cause onDidCreated to trigger. On rename case i think i expect to see delete->create similar for file rename event.

Does this issue occur when all extensions are disabled?: Yes

@bpasero
Copy link
Member

bpasero commented Feb 18, 2020

@savpek can you run VSCode with the verbose flag (code --verbose from command line) and check the output in developer tools around this file watcher:

image

When you do the delete, it should print a message unless there is a bug in the file watcher.

Here is what I see:

Kapture 2020-02-18 at 7 12 05

@bpasero bpasero added the info-needed Issue requires more information from poster label Feb 18, 2020
@savpek
Copy link
Author

savpek commented Feb 23, 2020

Debugged this bit deeper, indeed fie watcher gets triggered (log lines are shown etc) but glob patterns seems to work bit oddly:

Omnisharp-vscode uses glob pattern **/*.* to notice all filechanges at workspace workspace.createFileSystemWatcher('**/*.*').

Lets think theres /foo/bar/asd.cs file where /bar/ folder gets removed.

When folder gets removed no file watcher event is triggered for **/*.* pattern. I think i except to see "removed /foo/bar/asd.cs" since it's matches pattern and similar events happen for update/create.

When folder gets removed with pattern **/ event of removed folder /foo/bar/ gets triggered. I think this is working as i except to see.

When folder gets removed with pattern **/* event of removed folder /foo/bar/ gets triggered. But no event for file /foo/bar/asd.cs. I think here i except to see both /foo/bar/ and /foo/bar/asd.cs since they match to pattern.

Is this by design or bug? I can fix that on extension side by figuring out files under removed folders but for me behavior feels bit strange 🤔

@bpasero bpasero added the file-watcher File watcher label Feb 23, 2020
@bpasero
Copy link
Member

bpasero commented Feb 23, 2020

I think this is a duplicate of #60813 then.

@vscodebot vscodebot bot closed this as completed Mar 1, 2020
@vscodebot
Copy link

vscodebot bot commented Mar 1, 2020

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@github-actions github-actions bot locked and limited conversation to collaborators Apr 15, 2020
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
Projects
None yet
Development

No branches or pull requests

2 participants