Skip to content

workspace/didChangeWatchedFiles #347

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

Closed
autozimu opened this issue Mar 27, 2018 · 6 comments
Closed

workspace/didChangeWatchedFiles #347

autozimu opened this issue Mar 27, 2018 · 6 comments

Comments

@autozimu
Copy link
Owner

Quote from @vorner,

The workspace/didChangeWatchedFiles would be pretty nice, as it seems it is missing for a real use case: rust-lang/rls#546. The RLS uses it to rebuild the full dependency graph when the Cargo.toml manifest changes.

@gvolpe
Copy link

gvolpe commented Apr 9, 2018

Hi, I'm interested in seeing this working and came here to offer my help (though I have not experience in Rust).

According to the protocol the client is responsible for sending a watch files notification.

Is there any work in progress on this or somebody looking at it? Thanks.

@autozimu
Copy link
Owner Author

autozimu commented Apr 9, 2018

No progress yet, at least from my side.

@Vigilans
Copy link

Just a question...does current implementation of watcher-registering supports globs like **/*.ext?:

let recursive_mode = if w.glob_pattern.ends_with("**") {
notify::RecursiveMode::Recursive
} else {
notify::RecursiveMode::NonRecursive
};
watcher
.watch(w.glob_pattern.trim_end_matches("**"), recursive_mode)?;

It seems that notify does not support glob pattern yet, and the code above just handles cases when ** is placed at the end of a pattern...

Commit rust-lang/rls@5d3665d unrolled the glob pattern, saying that it's due to glob crate problem, but I have no idea where this crate is used...

@autozimu
Copy link
Owner Author

where this crate is used

the glob pattern is used in this client side.

@Vigilans
Copy link

Oh, what I mean is that I have no idea where the glob crate is used in this client side, because the only reference of cargo dependency glob is in util::get_rootpath:

let p = p.unwrap_or_default();
match glob::glob(p) {
Ok(paths) => paths.count() > 0,
_ => false,
}

instead of registering didChangeWatchedFiles capability.

So I have the question that whether watch(w.glob_pattern.trim_end_matches("**") will behave as expected when w.glob_pattern is for example **/Cargo.toml or **/*.rs, because it seems that notify does not support a glob pattern yet (maybe I am wrong here)...

Sorry for that I am not familiar with vim to test it myself, I use vscode and is investigating the didChangeWatchedFiles related issues.

@autozimu
Copy link
Owner Author

Sorry, I meant the glob pattern (Cargo.{toml,lock}), not the glob create, is being parsed and used in this client.

No, if the glob patter is something like **/Cargo.toml, it won't be supported in this client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants