@@ -213,7 +213,7 @@ config_data! {
213
213
/// also need to add the folders to Code's `files.watcherExclude`.
214
214
files_excludeDirs: Vec <PathBuf > = "[]" ,
215
215
/// Controls file watching implementation.
216
- files_watcher: String = "\" client\" " ,
216
+ files_watcher: FilesWatcherDef = "\" client\" " ,
217
217
218
218
/// Enables highlighting of related references while the cursor is on `break`, `loop`, `while`, or `for` keywords.
219
219
highlightRelated_breakPoints_enable: bool = "true" ,
@@ -524,7 +524,7 @@ pub struct FilesConfig {
524
524
#[ derive( Debug , Clone ) ]
525
525
pub enum FilesWatcher {
526
526
Client ,
527
- Notify ,
527
+ Server ,
528
528
}
529
529
530
530
#[ derive( Debug , Clone ) ]
@@ -903,12 +903,11 @@ impl Config {
903
903
904
904
pub fn files ( & self ) -> FilesConfig {
905
905
FilesConfig {
906
- watcher : match self . data . files_watcher . as_str ( ) {
907
- "notify" => FilesWatcher :: Notify ,
908
- "client" if self . did_change_watched_files_dynamic_registration ( ) => {
906
+ watcher : match self . data . files_watcher {
907
+ FilesWatcherDef :: Client if self . did_change_watched_files_dynamic_registration ( ) => {
909
908
FilesWatcher :: Client
910
909
}
911
- _ => FilesWatcher :: Notify ,
910
+ _ => FilesWatcher :: Server ,
912
911
} ,
913
912
exclude : self . data . files_excludeDirs . iter ( ) . map ( |it| self . root_path . join ( it) ) . collect ( ) ,
914
913
}
@@ -1423,7 +1422,7 @@ enum ManifestOrProjectJson {
1423
1422
1424
1423
#[ derive( Deserialize , Debug , Clone ) ]
1425
1424
#[ serde( rename_all = "snake_case" ) ]
1426
- pub enum ExprFillDefaultDef {
1425
+ enum ExprFillDefaultDef {
1427
1426
Todo ,
1428
1427
Default ,
1429
1428
}
@@ -1486,6 +1485,14 @@ enum ReborrowHintsDef {
1486
1485
Mutable ,
1487
1486
}
1488
1487
1488
+ #[ derive( Deserialize , Debug , Clone ) ]
1489
+ #[ serde( rename_all = "snake_case" ) ]
1490
+ enum FilesWatcherDef {
1491
+ Client ,
1492
+ Notify ,
1493
+ Server ,
1494
+ }
1495
+
1489
1496
#[ derive( Deserialize , Debug , Clone ) ]
1490
1497
#[ serde( rename_all = "snake_case" ) ]
1491
1498
enum ImportPrefixDef {
@@ -1843,6 +1850,14 @@ fn field_props(field: &str, ty: &str, doc: &[&str], default: &str) -> serde_json
1843
1850
"Show only the parameters."
1844
1851
] ,
1845
1852
} ,
1853
+ "FilesWatcherDef" => set ! {
1854
+ "type" : "string" ,
1855
+ "enum" : [ "client" , "server" ] ,
1856
+ "enumDescriptions" : [
1857
+ "Use the client (editor) to watch files for changes" ,
1858
+ "Use server-side file watching" ,
1859
+ ] ,
1860
+ } ,
1846
1861
_ => panic ! ( "missing entry for {}: {}" , ty, default ) ,
1847
1862
}
1848
1863
0 commit comments