Skip to content

createFileSystemWatcher API not fired when parents renamed #60813

@NTaylorMullen

Description

@NTaylorMullen
  • VSCode Version: 1.28.0
  • OS Version: Win10-x64

Steps to Reproduce:

  1. Create a file system watcher that monitors adds/removes:
...
        const watcher = vscode.workspace.createFileSystemWatcher('**/*.csproj*');
        const createRegistration = watcher.onDidCreate(async (uri: vscode.Uri) => {
            console.log('CSProj added: ' + uri.toString());
        });

        const deleteRegistration = watcher.onDidDelete(async (uri: vscode.Uri) => {
            console.log('CSProj removed: ' + uri.toString());
        });
...
  1. Change the parent folder of a csproj

Expected: remove => create gets called on the watched files
Actual: Nothing fires

Additional Notes

Seeing this in practice in the Razor VSCode extension: https://github.com/aspnet/Razor.VSCode/blob/05b60813dd446fc4a21529a3513aeec186886465/src/Microsoft.AspNetCore.Razor.VSCode/src/RazorProjectTracker.ts#L25-L32

Metadata

Metadata

Assignees

Labels

*out-of-scopePosted issue is not in scope of VS CodedebtCode quality issuesfile-watcherFile watcher

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions