Skip to content

vscode.Filesystem watcher does not watch nested subdirectories created with mkdir -p #227252

Closed

Description

Type: Bug

  1. Create a vscode.FileSystemWatcher to watch all files in a workspace. Subscribe to all event types:
    createFilesystemWatcher(workspaceFolder: vscode.WorkspaceFolder): void {
        const fileSystemWatcher = vscode.workspace.createFileSystemWatcher(
            new vscode.RelativePattern(workspaceFolder, "**/*")
        );
        fileSystemWatcher.onDidCreate((e: vscode.Uri) => this._handleFileChanged(e));
        fileSystemWatcher.onDidChange((e: vscode.Uri) => this._handleFileChanged(e));
        fileSystemWatcher.onDidDelete((e: vscode.Uri) => this._handleFileDeleted(e));
    }
  1. Somewhere within the workspace, using the shell, create a nested directory with mkdir -p, as in mkdir -p abc/def, where abc does not already exist.
  2. Create a file under abc, such as with touch abc/file1
  3. Create a file under abc/def, such as with touch abc/def/file2.

Expected results:

  1. The watcher will notify about the creation of abc in Step 2 above. This works correctly. The expected notification is received.
  2. The watcher will notify about the creation of abc/def in Step 2 above. This does not work correctly. No notification is received for def.
  3. The watcher will notify about the creation of abc/file1 in Step 3 above. This works correctly. The expected notification is received.
  4. The watcher will notify about the creation of abc/def/file2 in Step 4 above. This does not work correctly. No notification is received for file1.

VS Code version: Code 1.92.2 (fee1edb, 2024-08-14T17:29:30.058Z)
OS version: Darwin arm64 23.5.0
Modes:
Remote OS version: Linux x64 5.15.0-1062-gcp
Remote OS version: Linux x64 5.15.0-1062-gcp
Connection to 'SSH: dev-mlm1' could not be established Canceled

System Info
Item Value
CPUs Apple M2 (8 x 2400)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) 2, 2, 2
Memory (System) 16.00GB (0.07GB free)
Process Argv --crash-reporter-id 4ac5d7cd-3a65-4608-9ba5-c7fd862e0744
Screen Reader no
VM 0%
Item Value
Remote SSH: dev-mlm1
OS Linux x64 5.15.0-1062-gcp
CPUs Intel(R) Xeon(R) CPU @ 2.20GHz (16 x 0)
Memory (System) 62.79GB (48.55GB free)
VM 0%
Item Value
Remote SSH: dev-mlm1
OS Linux x64 5.15.0-1062-gcp
CPUs Intel(R) Xeon(R) CPU @ 2.20GHz (16 x 0)
Memory (System) 62.79GB (48.55GB free)
VM 0%

Connection to 'SSH: dev-mlm1' could not be established Canceled

Extensions (23)
Extension Author (truncated) Version
quitcontrol-vscode art 4.0.0
rust-syntax dus 0.6.1
jupyter-keymap ms- 1.1.2
remote-containers ms- 0.380.0
remote-ssh ms- 0.113.1
remote-ssh-edit ms- 0.86.0
vscode-remote-extensionpack ms- 0.25.0
remote-explorer ms- 0.4.3
remote-server ms- 1.5.2
vscode-augment Aug 0.205.0
vscode-eslint dba 3.0.10
vscode-jsonnet Gra 0.6.1
debugpy ms- 2024.10.0
python ms- 2024.12.3
vscode-pylance ms- 2024.8.2
jupyter ms- 2024.7.0
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.0.19
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
cpptools ms- 1.21.6
cpptools-extension-pack ms- 1.3.0
gitblame wad 11.0.1

(2 theme extensions excluded)

A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
vscod805cf:30301675
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyonecf:30548226
962ge761:30959799
pythongtdpath:30769146
welcomedialog:30910333
pythonnoceb:30805159
asynctok:30898717
pythonregdiag2:30936856
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
accentitlementst:30995554
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
jg8ic977:31013176
pythoncenvpt:31062603
a69g1124:31058053
dvdeprecation:31068756
dwnewjupyter:31046869
impr_priority:31102340
nativerepl1:31104043
refactort:31108082
pythonrstrctxt:31112756
wkspc-onlycs-c:31111717
wkspc-ranged-c:31125598
pme_test_c:31118331
fje88620:31121564
aajjf12562cf:31125794

Activity

  1. bpasero commented on Aug 31, 2024

    @bpasero
    Contributor

    Would be great to try to distill a repro for https://github.com/parcel-bundler/watcher, the watcher we are using and then report it upstream if it turns out to be.

  2. bpasero commented on Aug 31, 2024

    @bpasero
    Contributor

    Oh nevermind, this is reported by me already as parcel-bundler/watcher#97

  3. added
    upstream
    and removed on Aug 31, 2024
  4. added
    upstream-issue-linked
    on Sep 22, 2024
  5. bpasero commented on Dec 19, 2024

    @bpasero
    Contributor

    I am closing this issue, given the reported upstream. As we stay with parcel watcher, fixes have to go there and we are actively contributing.

  6. locked and limited conversation to collaborators on Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

file-watcherupstreamupstream-issue-linked

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions