@@ -213,7 +213,7 @@ config_data! {
213213 /// also need to add the folders to Code's `files.watcherExclude`.
214214 files_excludeDirs: Vec <PathBuf > = "[]" ,
215215 /// Controls file watching implementation.
216- files_watcher: String = "\" client\" " ,
216+ files_watcher: FilesWatcherDef = "\" client\" " ,
217217
218218 /// Enables highlighting of related references while the cursor is on `break`, `loop`, `while`, or `for` keywords.
219219 highlightRelated_breakPoints_enable: bool = "true" ,
@@ -524,7 +524,7 @@ pub struct FilesConfig {
524524#[ derive( Debug , Clone ) ]
525525pub enum FilesWatcher {
526526 Client ,
527- Notify ,
527+ Server ,
528528}
529529
530530#[ derive( Debug , Clone ) ]
@@ -903,12 +903,11 @@ impl Config {
903903
904904 pub fn files ( & self ) -> FilesConfig {
905905 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 ( ) => {
909908 FilesWatcher :: Client
910909 }
911- _ => FilesWatcher :: Notify ,
910+ _ => FilesWatcher :: Server ,
912911 } ,
913912 exclude : self . data . files_excludeDirs . iter ( ) . map ( |it| self . root_path . join ( it) ) . collect ( ) ,
914913 }
@@ -1423,7 +1422,7 @@ enum ManifestOrProjectJson {
14231422
14241423#[ derive( Deserialize , Debug , Clone ) ]
14251424#[ serde( rename_all = "snake_case" ) ]
1426- pub enum ExprFillDefaultDef {
1425+ enum ExprFillDefaultDef {
14271426 Todo ,
14281427 Default ,
14291428}
@@ -1486,6 +1485,14 @@ enum ReborrowHintsDef {
14861485 Mutable ,
14871486}
14881487
1488+ #[ derive( Deserialize , Debug , Clone ) ]
1489+ #[ serde( rename_all = "snake_case" ) ]
1490+ enum FilesWatcherDef {
1491+ Client ,
1492+ Notify ,
1493+ Server ,
1494+ }
1495+
14891496#[ derive( Deserialize , Debug , Clone ) ]
14901497#[ serde( rename_all = "snake_case" ) ]
14911498enum ImportPrefixDef {
@@ -1843,6 +1850,14 @@ fn field_props(field: &str, ty: &str, doc: &[&str], default: &str) -> serde_json
18431850 "Show only the parameters."
18441851 ] ,
18451852 } ,
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+ } ,
18461861 _ => panic ! ( "missing entry for {}: {}" , ty, default ) ,
18471862 }
18481863
0 commit comments