Commit 6145631
authored
[CodeGenLib] Typealias translator configuration for client and server (#1750)
Motivation:
The typealias translator should generate typealias for the client and server protocols only if the associated code (client/server code) will be generated as well. Also, at the moment the Typealias translator doesn't generate the ClientProtocol typealias.
Modifications:
- added a new initialiser for the TypealiasTranslator that sets the client and server property.
- Based on the client and server properties' values the typealias translator generates or not the protocol typealiases.
- created method gor client protocol typalias generation.
- modified tests, so they include the client code.
- added new tests for generating only client or server code.
Result:
The typealias translator will generate typealiases for client and server protocols only when the associated code is also generated, getting rid of the possibility of an error (when the protocol doesn't exist).1 parent 717e3f8 commit 6145631
File tree
3 files changed
+211
-34
lines changed- Sources/GRPCCodeGen/Internal/Translator
- Tests/GRPCCodeGenTests/Internal/Translator
3 files changed
+211
-34
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
Lines changed: 45 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
56 | 64 | | |
57 | 65 | | |
58 | 66 | | |
| |||
169 | 177 | | |
170 | 178 | | |
171 | 179 | | |
172 | | - | |
173 | | - | |
174 | | - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
175 | 195 | | |
176 | 196 | | |
177 | 197 | | |
| |||
236 | 256 | | |
237 | 257 | | |
238 | 258 | | |
239 | | - | |
| 259 | + | |
240 | 260 | | |
241 | 261 | | |
242 | 262 | | |
| |||
277 | 297 | | |
278 | 298 | | |
279 | 299 | | |
280 | | - | |
| 300 | + | |
281 | 301 | | |
282 | 302 | | |
283 | 303 | | |
284 | 304 | | |
285 | 305 | | |
286 | 306 | | |
287 | 307 | | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | 308 | | |
298 | 309 | | |
299 | | - | |
| 310 | + | |
300 | 311 | | |
301 | | - | |
302 | | - | |
303 | 312 | | |
304 | 313 | | |
305 | | - | |
| 314 | + | |
306 | 315 | | |
307 | 316 | | |
308 | 317 | | |
309 | 318 | | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
310 | 337 | | |
0 commit comments