Description
Currently file watching is a global setting, e.g. using the following in VS Code's settings.json:
"rust-analyzer.files.watcher": "server",
However, we'd like the ability to specify file watching on a per-crate basis. This would be useful for projects built with buck, where generated code is written to ./buck-out/gen/abc123/__project/lib.rs
. VS Code doesn't notify r-a when this file changes (even if the user has it open), so we get stale go-to-def and code completions when the generated file has changed on disk.
Previous discussions: #556 and #433 for file watchers in general, #16913 for file watching differences between operating systems, and #19387 mentions that VS Code doesn't send all notifications. I think there was an issue discussing VS Code not sending notifications in specific circumstances, but I can't find it.
@davidbarsky's view is (I think) that this is a reasonable addition, and I'm happy to put up a PR if y'all think this makes sense.