mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +00:00
Use relative glob patterns in DidChangeWatchedFilesRegistrationOptions
This commit is contained in:
parent
23613a9de7
commit
fe28e470cd
@ -436,16 +436,19 @@ impl GlobalState {
|
|||||||
.flat_map(|ws| ws.to_roots())
|
.flat_map(|ws| ws.to_roots())
|
||||||
.filter(|it| it.is_local)
|
.filter(|it| it.is_local)
|
||||||
.flat_map(|root| {
|
.flat_map(|root| {
|
||||||
root.include.into_iter().flat_map(|it| {
|
root.include
|
||||||
[
|
.into_iter()
|
||||||
format!("{it}/**/*.rs"),
|
.flat_map(|it| [(it.clone(), "**/*.rs"), (it, "**/Cargo.{lock,toml}")])
|
||||||
format!("{it}/**/Cargo.toml"),
|
|
||||||
format!("{it}/**/Cargo.lock"),
|
|
||||||
]
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
.map(|glob_pattern| lsp_types::FileSystemWatcher {
|
.map(|(base, pat)| lsp_types::FileSystemWatcher {
|
||||||
glob_pattern: lsp_types::GlobPattern::String(glob_pattern),
|
glob_pattern: lsp_types::GlobPattern::Relative(
|
||||||
|
lsp_types::RelativePattern {
|
||||||
|
base_uri: lsp_types::OneOf::Right(
|
||||||
|
lsp_types::Url::from_file_path(base).unwrap(),
|
||||||
|
),
|
||||||
|
pattern: pat.to_owned(),
|
||||||
|
},
|
||||||
|
),
|
||||||
kind: None,
|
kind: None,
|
||||||
})
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user