@@ -207,63 +207,43 @@ pub enum Notebook {
207
207
NotebookDocumentFilter ( NotebookDocumentFilter ) ,
208
208
}
209
209
210
- #[ derive( Debug , Eq , PartialEq , Clone , Deserialize , Serialize ) ]
211
- #[ serde( untagged) ]
212
- pub enum NotebookDocumentFilter {
213
- ByType ( NotebookDocumentFilterByType ) ,
214
- ByScheme ( NotebookDocumentFilterByScheme ) ,
215
- ByPattern ( NotebookDocumentFilterByPattern ) ,
216
- }
217
-
218
- /// A notebook document filter denotes a notebook document by
219
- /// different properties.
220
- ///
221
- /// @since 3.17.0
222
- #[ derive( Debug , Eq , PartialEq , Clone , Deserialize , Serialize ) ]
223
- #[ serde( rename_all = "camelCase" ) ]
224
- pub struct NotebookDocumentFilterByType {
225
- /// The type of the enclosing notebook.
226
- pub notebook_type : String ,
227
- /// A Uri [scheme](#Uri.scheme), like `file` or `untitled`.
228
- #[ serde( skip_serializing_if = "Option::is_none" ) ]
229
- pub scheme : Option < String > ,
230
- /// A glob pattern.
231
- #[ serde( skip_serializing_if = "Option::is_none" ) ]
232
- pub pattern : Option < String > ,
233
- }
234
-
235
210
/// A notebook document filter denotes a notebook document by
236
211
/// different properties.
237
212
///
238
213
/// @since 3.17.0
239
214
#[ derive( Debug , Eq , PartialEq , Clone , Deserialize , Serialize ) ]
240
215
#[ serde( rename_all = "camelCase" ) ]
241
- pub struct NotebookDocumentFilterByScheme {
242
- /// The type of the enclosing notebook.
243
- #[ serde( skip_serializing_if = "Option::is_none" ) ]
244
- pub notebook_type : Option < String > ,
245
- /// A Uri [scheme](#Uri.scheme), like `file` or `untitled`.
246
- pub scheme : String ,
247
- /// A glob pattern.
248
- #[ serde( skip_serializing_if = "Option::is_none" ) ]
249
- pub pattern : Option < String > ,
250
- }
251
-
252
- /// A notebook document filter denotes a notebook document by
253
- /// different properties.
254
- ///
255
- /// @since 3.17.0
256
- #[ derive( Debug , Eq , PartialEq , Clone , Deserialize , Serialize ) ]
257
- #[ serde( rename_all = "camelCase" ) ]
258
- pub struct NotebookDocumentFilterByPattern {
259
- /// The type of the enclosing notebook.
260
- #[ serde( skip_serializing_if = "Option::is_none" ) ]
261
- pub notebook_type : Option < String > ,
262
- /// A Uri [scheme](#Uri.scheme), like `file` or `untitled`.
263
- #[ serde( skip_serializing_if = "Option::is_none" ) ]
264
- pub scheme : Option < String > ,
265
- /// A glob pattern.
266
- pub pattern : String ,
216
+ pub enum NotebookDocumentFilter {
217
+ ByType {
218
+ /// The type of the enclosing notebook.
219
+ notebook_type : String ,
220
+ /// A Uri [scheme](#Uri.scheme), like `file` or `untitled`.
221
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
222
+ scheme : Option < String > ,
223
+ /// A glob pattern.
224
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
225
+ pattern : Option < String > ,
226
+ } ,
227
+ ByScheme {
228
+ /// The type of the enclosing notebook.
229
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
230
+ notebook_type : Option < String > ,
231
+ /// A Uri [scheme](#Uri.scheme), like `file` or `untitled`.
232
+ scheme : String ,
233
+ /// A glob pattern.
234
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
235
+ pattern : Option < String > ,
236
+ } ,
237
+ ByPattern {
238
+ /// The type of the enclosing notebook.
239
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
240
+ notebook_type : Option < String > ,
241
+ /// A Uri [scheme](#Uri.scheme), like `file` or `untitled`.
242
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
243
+ scheme : Option < String > ,
244
+ /// A glob pattern.
245
+ pattern : String ,
246
+ } ,
267
247
}
268
248
269
249
mod notification_params {
0 commit comments