@@ -297,6 +297,9 @@ pub struct Config {
297297 pub experimental_features : Option < HashMap < ExperimentalFeature , bool > > ,
298298 #[ serde( rename = "gentypeconfig" ) ]
299299 pub gentype_config : Option < GenTypeConfig > ,
300+ // Used by the VS Code extension; ignored by rewatch but should not emit warnings.
301+ // Payload is not validated here, only in the VS Code extension.
302+ pub editor : Option < serde_json:: Value > ,
300303 // this is a new feature of rewatch, and it's not part of the rescript.json spec
301304 #[ serde( rename = "namespace-entry" ) ]
302305 pub namespace_entry : Option < String > ,
@@ -698,7 +701,6 @@ impl Config {
698701
699702 fn is_unsupported_field ( & self , field : & str ) -> bool {
700703 const UNSUPPORTED_TOP_LEVEL_FIELDS : & [ & str ] = & [
701- "version" ,
702704 "ignored-dirs" ,
703705 "generators" ,
704706 "cut-generators" ,
@@ -779,6 +781,7 @@ pub mod tests {
779781 namespace : None ,
780782 jsx : None ,
781783 gentype_config : None ,
784+ editor : None ,
782785 namespace_entry : None ,
783786 deprecation_warnings : vec ! [ ] ,
784787 experimental_features : None ,
@@ -1114,6 +1117,28 @@ pub mod tests {
11141117 assert ! ( config. get_unknown_fields( ) . is_empty( ) ) ;
11151118 }
11161119
1120+ #[ test]
1121+ fn test_editor_field_supported ( ) {
1122+ let json = r#"
1123+ {
1124+ "name": "testrepo",
1125+ "sources": {
1126+ "dir": "src",
1127+ "subdirs": true
1128+ },
1129+ "editor": {
1130+ "reason": {
1131+ "profile": "development"
1132+ }
1133+ }
1134+ }
1135+ "# ;
1136+
1137+ let config = Config :: new_from_json_string ( json) . expect ( "a valid json string" ) ;
1138+ assert ! ( config. get_unsupported_fields( ) . is_empty( ) ) ;
1139+ assert ! ( config. get_unknown_fields( ) . is_empty( ) ) ;
1140+ }
1141+
11171142 #[ test]
11181143 fn test_compiler_flags ( ) {
11191144 let json = r#"
0 commit comments