-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Using '**' in a GlobPattern does not match any number of path segments in Windows #65240
Comments
@allileong let me guess, you are not getting an event for your file when a delete happens in a parent folder? |
@bpasero, what do you mean by 'parent folder'? In the above example, if I delete |
@allileong trying to find out if this is a duplicate of #60813 or #65077. We have an optimization in place that will report a delete or rename of a folder as a single event on that folder and not for each file that is below that folder. |
@bpasero, this issue seems to be similar in that '**' is not successfully matching on parent directories, but it doesn't seem to be a direct duplicate of those issues since this issue is affecting the file create, change, and delete events alike rather than just delete events. |
@allileong you cannot use
|
@bpasero Thank you for the info. RelativePattern with |
I have tested this issue on both Mac and Windows and have only seen the unexpected behavior in Windows.
I would like to create a FileSystemWatcher to watch all file changes that are a variable number of levels deep inside of a specified directory. To create the globPattern passed to the
vscode.workspace.createFileSystemWatcher()
method I followed this documentation: https://code.visualstudio.com/docs/extensionAPI/vscode-api#GlobPattern.On Mac, the globString looks like:
/Users/example.user/Documents/projects/my-vscode-project/{force-app,another-app}/**
On Windows, the globString looks like:
c:\Users\exampleuser\Desktop\my-vscode-project\{force-app,another-app}\**
My example project has a structure like so:
my-vscode-project
|-- force-app
.........|-- example-file-one-level-deep.js
.........|-- main
.................|-- default
.........................|-- example-file-three-levels-deep.js
|-- another-app
........|-- another-example-file-one-level-deep.js
On Mac, changes made to
example-file-one-level-deep.js
,example-file-three-levels-deep.js
, andanother-example-file-one-level-deep.js
all trigger thefileWatcher.onDidChange()
listener, and this is the behavior that I would expect.On Windows, only changes made to files directly inside of
force-app
andanother-app
trigger thefileWatcher.onDidChange()
listener. Files nested more than one level deep will not trigger the change listener. In other words, changingexample-file-one-level-deep.js
andanother-example-file-one-level-deep.js
will trigger the change listener, but changingexample-file-three-levels-deep.js
will not.I am creating the globString and FileSystemWatcher like so:
Please let me know if I have misunderstood how to create the correct globString. This behavior is unfortunately blocking forcedotcom/salesforcedx-vscode#822 from moving forward.
Thanks!
The text was updated successfully, but these errors were encountered: