-
-
Notifications
You must be signed in to change notification settings - Fork 395
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
Avoid using chokidar (Fix #762) #763
Avoid using chokidar (Fix #762) #763
Conversation
ignoreInitial: true | ||
}); | ||
Commons.configWatcher = chokidar.watch(this.en.PATH + "/User/", { | ||
depth: 2, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are you handling the depth
as 2 in File System Watcher
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean the watcher should not watch under directories in workspaceStorage
.
OK, I'll try handling it! Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shanalikhan
Fixed by 758baf7
But it's not beautiful way... umm...
}); | ||
Commons.configWatcher = chokidar.watch(this.en.PATH + "/User/", { | ||
depth: 2, | ||
ignoreInitial: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great if you can write details how are you handling these situations on FileSystemWatcher
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The watcher doesn't watch the add
event now, so I think it's not problem to ignore this option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, I checked this behavior.
FileSystemWatcher and chokidar with ignoreInitial: true
are same. 😄
Add the following code for check, and Added:
logs are not appeared when the window reloads.
Commons.configWatcher.onDidCreate(async (uri: vscode.Uri) => {
const path: string = uri.path;
console.log("Added: " + path);
});
I also checked the case of ignoreInitial: false
. nekonenene@5941286
A much easier fix would be to bump chokidar to 2.1.0, as the problem is fixed in that release. |
@fuzzy76 |
It would personally recommend using vscode own file change events rather chokidar, when i developed this feature there were no api developed by code team thats why Settings Sync is using chokidar itself. If new update of chokidar fix this problem, send new PR and i will accept that to push new version. |
@shanalikhan Thanks! So, should i close this PR? |
No, Keep this open, I will merge it soon. |
Oh, I misunderstood your comment. I hope that |
Note: chokidar v2.1.1 is released yesterday, but, it includes fsevents v1.2.7 same as v2.1.0. I tried v2.1.1, and error occured. |
Short description of what this resolves:
Fix "Extension host terminated unexpectedly" in Visual Studio Code v1.31.0 with Settings Sync.
( microsoft/vscode#64981 )
It causes by
fsevents
, alsochokidar
.microsoft/vscode#65335
So, I remove
chokidar
from this repository, and use FileSystemWatcher .Thanks: fabiospampinato/vscode-projects-plus@8357ab7#diff-b9cfc7f2cdf78a7f4b91a753d10865a2
Changes proposed in this pull request:
Fixes: #762
How Has This Been Tested?
console.log
to check if pass through StartWatch, onDidChange, CloseWatch.Screenshots (if appropriate):
Checklist: