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

workspace/didChangeWatchedFiles is not always sent for deleted folders #65077

Closed
LaurentTreguier opened this issue Nov 22, 2018 · 8 comments
Closed
Assignees
Labels
confirmed Issue has been confirmed by VS Code Team member *duplicate Issue identified as a duplicate of another issue(s) info-needed Issue requires more information from poster

Comments

@LaurentTreguier
Copy link

Sometimes, if I delete a folder, I won't get any workspace/didChangeWatchedFiles notification. I saw #141, which seemed somewhat similar, but here I'm somehow not even getting a notification about the folder itself being deleted.
I looked directly at the JSON-RPC requests and notifications that my server is receiving, in case I did something wrong, and saw no notification about anything being deleted in a session where I removed a folder.
I noticed this when switching branches in a project, where one branch has a folder that the other doesn't have.

If this is of any use:

  • Platform: Linux x64 (Fedora 29)
  • VSCode: 1.29.1
  • vscode-languageclient: 5.1.1

I'll see if I can reproduce this on Windows to know if this is platform-specific.
EDIT: it seems to be doing the same on Windows 10 x64.

@dbaeumer
Copy link
Member

@LaurentTreguier can you provide me with a GitHub repository with two branches that make it easy to reproduce this. I tested this locally with Windows 10 and I works for me.

@LaurentTreguier
Copy link
Author

It looks like this might not be the correct repository for this issue, I've tried a few more things and the problem seems to lie with vscode.FileSystemWatcher (or some NodeJS API it uses). Is it implemented in the main https://github.com/Microsoft/vscode repository ?

I'm experiencing this with the language server I'm developing.
The steps to reproduce it would be:

  1. Cloning https://github.com/d-language-server/dls
  2. Switching it to the dls-format branch
  3. Creating a VSCode extension with this code:
    import * as vsc from 'vscode';
    
    export function activate(context: vsc.ExtensionContext) {
        let watcher = vsc.workspace.createFileSystemWatcher('**/*.d');
        watcher.onDidChange(uri => console.log('change: ' + uri.toString()));
        watcher.onDidCreate(uri => console.log('create: ' + uri.toString()));
        watcher.onDidDelete(uri => console.log('delete: ' + uri.toString()));
        context.subscriptions.push(watcher);
    }
  4. Launching it in a debug session and opening the dls folder
  5. Switching from its dls-format branch back to its master branch, which should remove a folder named format at the root of the project containing a number of .d files

When doing this, I see some messages appearing in the debug console about files being created and changed, but no mention of files in the format folder being deleted.

@dbaeumer
Copy link
Member

@LaurentTreguier thanks. I will move the issue to the vscode repository.

@dbaeumer dbaeumer transferred this issue from microsoft/vscode-languageserver-node Dec 14, 2018
@dbaeumer
Copy link
Member

@bpasero I can reproduce this under Windows as well using the example.

Not sure if this is a watcher or API problem (@jrieken)

@dbaeumer dbaeumer added the confirmed Issue has been confirmed by VS Code Team member label Dec 14, 2018
@bpasero
Copy link
Member

bpasero commented Dec 14, 2018

@LaurentTreguier please check if this could be #60813

@bpasero bpasero added the info-needed Issue requires more information from poster label Dec 14, 2018
@dbaeumer
Copy link
Member

Looks like. We do send a delete event in the example but only for delete: file:///c%3A/Users/dirkb/Projects/mseng/VSCode/Playgrounds/dls/format

@bpasero
Copy link
Member

bpasero commented Dec 14, 2018

/duplicate #60813

@vscodebot vscodebot bot added the *duplicate Issue identified as a duplicate of another issue(s) label Dec 14, 2018
@vscodebot
Copy link

vscodebot bot commented Dec 14, 2018

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines.

Happy Coding!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
confirmed Issue has been confirmed by VS Code Team member *duplicate Issue identified as a duplicate of another issue(s) info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants