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

FileSystemWatcher does not trigger onDidDelete() for file when folder is deleted #8961

Open
liorfr opened this issue Jan 17, 2021 · 1 comment
Labels
file-watchers issues related to filesystem watchers - nsfw

Comments

@liorfr
Copy link

liorfr commented Jan 17, 2021

I've created a FileSystemWatcher for two files in the following manner:

  const MTA_YAML = "mta.yaml";
  const DEV_MTA_EXT = "dev.mtaext";
  const fileSystemWatcher = workspace.createFileSystemWatcher(
    `**/{${MTA_YAML},${DEV_MTA_EXT}}`
  );

  fileSystemWatcher.onDidDelete(
    (uri) => {
      console.log("*********File deleted:  " + uri.fsPath);
    },
    undefined,
    disposables
  );

When I delete a folder that contains the watched files, the onDidDelete() is not triggered.

Please note

  1. When the folder is deleted via the terminal with rm -rf <folder name>, the onDidDelete() does get triggered
  2. When the file is open in the editor, the onDidDelete() does get triggered

Steps to Reproduce:

  1. Create a folder
  2. Under the new folder, add a file named "mta.yaml" (the new file is opened in the editor)
  3. Close the new file so that it will not be visible in the editor
  4. Click on the folder and press "delete" (approve the deletion)
@amiramw
Copy link
Member

amiramw commented Jan 17, 2021

Probably due to Axosoft/nsfw#60

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
file-watchers issues related to filesystem watchers - nsfw
Projects
None yet
Development

No branches or pull requests

3 participants