|
15 | 15 | "LSPArray", |
16 | 16 | "ChangeAnnotationIdentifier", |
17 | 17 | "Pattern", |
| 18 | + "RegularExpressionEngineKind", |
18 | 19 | "DocumentSelector", |
19 | 20 | "InitializedParams", |
20 | 21 | ] |
@@ -88,33 +89,38 @@ def generate_special_class( |
88 | 89 | ), |
89 | 90 | ) |
90 | 91 |
|
91 | | - if type_def.name == "Pattern": |
92 | | - inner = [ |
93 | | - "private string pattern;", |
94 | | - "public Pattern(string value){pattern = value;}", |
95 | | - "public static implicit operator Pattern(string value) => new Pattern(value);", |
96 | | - "public static implicit operator string(Pattern pattern) => pattern.pattern;", |
97 | | - "public override string ToString() => pattern;", |
98 | | - ] |
99 | | - lines = namespace_wrapper( |
100 | | - NAMESPACE, |
101 | | - get_usings(["JsonConverter", "DataContract"]), |
102 | | - class_wrapper( |
103 | | - type_def, |
104 | | - inner, |
105 | | - None, |
106 | | - [f"[JsonConverter(typeof(CustomStringConverter<{type_def.name}>))]"], |
107 | | - ), |
108 | | - ) |
| 92 | + if type_def.name in [ |
| 93 | + "Pattern", |
| 94 | + "RegularExpressionEngineKind", |
| 95 | + "ChangeAnnotationIdentifier", |
| 96 | + ]: |
| 97 | + if type_def.name == "Pattern": |
| 98 | + inner = [ |
| 99 | + "private string pattern;", |
| 100 | + "public Pattern(string value){pattern = value;}", |
| 101 | + "public static implicit operator Pattern(string value) => new Pattern(value);", |
| 102 | + "public static implicit operator string(Pattern pattern) => pattern.pattern;", |
| 103 | + "public override string ToString() => pattern;", |
| 104 | + ] |
| 105 | + |
| 106 | + if type_def.name == "ChangeAnnotationIdentifier": |
| 107 | + inner = [ |
| 108 | + "private string identifier;", |
| 109 | + "public ChangeAnnotationIdentifier(string value){identifier = value;}", |
| 110 | + "public static implicit operator ChangeAnnotationIdentifier(string value) => new ChangeAnnotationIdentifier(value);", |
| 111 | + "public static implicit operator string(ChangeAnnotationIdentifier identifier) => identifier.identifier;", |
| 112 | + "public override string ToString() => identifier;", |
| 113 | + ] |
| 114 | + |
| 115 | + if type_def.name == "RegularExpressionEngineKind": |
| 116 | + inner = [ |
| 117 | + "private string engineKind;", |
| 118 | + "public RegularExpressionEngineKind(string value){engineKind = value;}", |
| 119 | + "public static implicit operator RegularExpressionEngineKind(string value) => new RegularExpressionEngineKind(value);", |
| 120 | + "public static implicit operator string(RegularExpressionEngineKind engineKind) => engineKind.engineKind;", |
| 121 | + "public override string ToString() => engineKind;", |
| 122 | + ] |
109 | 123 |
|
110 | | - if type_def.name == "ChangeAnnotationIdentifier": |
111 | | - inner = [ |
112 | | - "private string identifier;", |
113 | | - "public ChangeAnnotationIdentifier(string value){identifier = value;}", |
114 | | - "public static implicit operator ChangeAnnotationIdentifier(string value) => new ChangeAnnotationIdentifier(value);", |
115 | | - "public static implicit operator string(ChangeAnnotationIdentifier identifier) => identifier.identifier;", |
116 | | - "public override string ToString() => identifier;", |
117 | | - ] |
118 | 124 | lines = namespace_wrapper( |
119 | 125 | NAMESPACE, |
120 | 126 | get_usings(["JsonConverter", "DataContract"]), |
|
0 commit comments