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

fix: Some file watching related vfs fixes #16913

Merged
merged 2 commits into from Mar 21, 2024

Conversation

Veykril
Copy link
Member

@Veykril Veykril commented Mar 21, 2024

Fixes #15554, additionally it seems that client side file watching was broken on windows this entire time, this PR switches DidChangeWatchedFilesRegistrationOptions to use relative glob patterns which do work on windows in VSCode.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 21, 2024
@lnicola
Copy link
Member

lnicola commented Mar 21, 2024

Huh, it works for me 😛.

@Veykril
Copy link
Member Author

Veykril commented Mar 21, 2024

Inbefore their file watcher works differently well between linux and windows

@Veykril
Copy link
Member Author

Veykril commented Mar 21, 2024

Okay so VSCode just does not send a workspace/didChangeWatchedFiles notification when a file gets created even if it matches the glob pattern ... which I guess makes sense if you snapshot all existing files when we tell it what to watch? But at the same time, when will it ever send a created notification then ...?

@Veykril
Copy link
Member Author

Veykril commented Mar 21, 2024

And no, this does not work for me whatsoever. Running cargo add yields no events from VSCode even 😕

@lnicola
Copy link
Member

lnicola commented Mar 21, 2024

WDYM?

$ touch src/foo.rs # =>

[Trace - 9:57:23 PM] Sending notification 'workspace/didChangeWatchedFiles'.
Params: {
    "changes": [
        {
            "uri": "file:///Projects/hello/src/foo.rs",
            "type": 1
        },
        {
            "uri": "file:///Projects/hello/src/foo.rs",
            "type": 1
        }
    ]
}

@Veykril
Copy link
Member Author

Veykril commented Mar 21, 2024

I don't get any such events from vscode :)

@lnicola
Copy link
Member

lnicola commented Mar 21, 2024

Sounds like file watching is completely broken on Windows?

@Veykril
Copy link
Member Author

Veykril commented Mar 21, 2024

Looks like it, tried it on my linux machine quickly and there touching does sent an event. Though I am surprised no one seems to have reported this so far

@Veykril Veykril force-pushed the client-watched-files branch 2 times, most recently from 209a01a to 8370b81 Compare March 21, 2024 20:14
@Veykril
Copy link
Member Author

Veykril commented Mar 21, 2024

Huh, switching over to using relative patterns makes it work! That's weird.

@Veykril
Copy link
Member Author

Veykril commented Mar 21, 2024

@bors r+

@bors
Copy link
Collaborator

bors commented Mar 21, 2024

📌 Commit fe28e47 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Mar 21, 2024

⌛ Testing commit fe28e47 with merge 7ef7f44...

@bors
Copy link
Collaborator

bors commented Mar 21, 2024

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 7ef7f44 to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
4 participants