rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
14.38k stars 1.62k forks source link

Is it possible to support a glob pattern or regex for "rust-analyzer.linkedProjects" values? #9659

Open jsejcksn opened 3 years ago

jsejcksn commented 3 years ago

This would make it possible to support large monorepos without needing to manually maintain a list of evolving directories.

e.g. for a monorepo with a top-level src directory containing many directories which contain crates: .vscode/settings.json:

{
  "rust-analyzer.linkedProjects": [
    "src/*/Cargo.toml"
  ]
}

If this has already been discussed and a verdict reached, feel free to link me and close. Thanks!

matklad commented 3 years ago

This is trickier than it seems -- today, linkedProjects is a static configuration. With globs, the ideal behavior would be to watch for for creation and deletion of newprojects.

I wonder if https://github.com/rust-analyzer/rust-analyzer/issues/9661 would help for this use-case?

jsejcksn commented 3 years ago

With globs, the ideal behavior would be to watch for creation and deletion of new projects.

This makes sense to me (using the glob pattern(s) as a filter)