@@ -436,24 +436,27 @@ impl GlobalState {
436
436
. flat_map ( |ws| ws. to_roots ( ) )
437
437
. filter ( |it| it. is_local )
438
438
. flat_map ( |root| {
439
- root. include . into_iter ( ) . flat_map ( |it| {
440
- [
441
- format ! ( "{it}/**/*.rs" ) ,
442
- format ! ( "{it}/**/Cargo.toml" ) ,
443
- format ! ( "{it}/**/Cargo.lock" ) ,
444
- ]
445
- } )
439
+ root. include
440
+ . into_iter ( )
441
+ . flat_map ( |it| [ ( it. clone ( ) , "**/*.rs" ) , ( it, "**/Cargo.{lock,toml}" ) ] )
446
442
} )
447
- . map ( |glob_pattern| lsp_types:: FileSystemWatcher {
448
- glob_pattern : lsp_types:: GlobPattern :: String ( glob_pattern) ,
443
+ . map ( |( base, pat) | lsp_types:: FileSystemWatcher {
444
+ glob_pattern : lsp_types:: GlobPattern :: Relative (
445
+ lsp_types:: RelativePattern {
446
+ base_uri : lsp_types:: OneOf :: Right (
447
+ lsp_types:: Url :: from_file_path ( & base) . unwrap ( ) ,
448
+ ) ,
449
+ pattern : pat. to_owned ( ) ,
450
+ } ,
451
+ ) ,
449
452
kind : None ,
450
453
} )
451
454
. collect ( ) ,
452
455
} ;
453
456
let registration = lsp_types:: Registration {
454
457
id : "workspace/didChangeWatchedFiles" . to_owned ( ) ,
455
458
method : "workspace/didChangeWatchedFiles" . to_owned ( ) ,
456
- register_options : Some ( serde_json:: to_value ( registration_options) . unwrap ( ) ) ,
459
+ register_options : Some ( serde_json:: to_value ( dbg ! ( registration_options) ) . unwrap ( ) ) ,
457
460
} ;
458
461
self . send_request :: < lsp_types:: request:: RegisterCapability > (
459
462
lsp_types:: RegistrationParams { registrations : vec ! [ registration] } ,
0 commit comments