Commit 9f56b78
[CodeGenLib] Differentiate type names from identifying names (#1759)
Motivation:
The names of the namespaces/service/methods used in the type names in the
generated code can be different from the names identifying the namespaces/service/methods in the IDL. This is why we need to have different properties for them.
Methods also have a third name - for the function signatures.
Modifications:
- Created the Name struct which contains the name in three formats
- Added the name properties in the ServiceDescriptor and MethodDescriptor from CodeGenerationRequest
- Modified the existing tests accordingly
- Added new validation methods verifying the generated names
- Added tests for the new checks
Result:
Users will be able to set an identifying name, a generated upper case name and a generated upper case name for the namespaces, services and methods which are used in the generated code.
---------
Co-authored-by: George Barnett <[email protected]>1 parent 378b6e8 commit 9f56b78
File tree
9 files changed
+895
-451
lines changed- Sources/GRPCCodeGen
- Internal/Translator
- Tests/GRPCCodeGenTests/Internal/Translator
9 files changed
+895
-451
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
| 219 | + | |
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
224 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
225 | 227 | | |
226 | | - | |
| 228 | + | |
227 | 229 | | |
228 | | - | |
229 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
230 | 234 | | |
231 | 235 | | |
232 | 236 | | |
| |||
235 | 239 | | |
236 | 240 | | |
237 | 241 | | |
238 | | - | |
239 | | - | |
| 242 | + | |
| 243 | + | |
240 | 244 | | |
241 | 245 | | |
242 | 246 | | |
| |||
246 | 250 | | |
247 | 251 | | |
248 | 252 | | |
249 | | - | |
| 253 | + | |
250 | 254 | | |
251 | 255 | | |
252 | 256 | | |
253 | | - | |
254 | | - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
255 | 262 | | |
256 | 263 | | |
257 | 264 | | |
| |||
267 | 274 | | |
268 | 275 | | |
269 | 276 | | |
270 | | - | |
| 277 | + | |
271 | 278 | | |
272 | 279 | | |
273 | 280 | | |
| |||
282 | 289 | | |
283 | 290 | | |
284 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
285 | 320 | | |
Lines changed: 22 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
| 30 | + | |
| 31 | + | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | | - | |
36 | | - | |
| 35 | + | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
| 40 | + | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
| 164 | + | |
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
194 | 197 | | |
195 | 198 | | |
196 | 199 | | |
| |||
329 | 332 | | |
330 | 333 | | |
331 | 334 | | |
332 | | - | |
333 | | - | |
| 335 | + | |
| 336 | + | |
334 | 337 | | |
335 | 338 | | |
336 | 339 | | |
| |||
393 | 396 | | |
394 | 397 | | |
395 | 398 | | |
396 | | - | |
| 399 | + | |
397 | 400 | | |
398 | 401 | | |
399 | 402 | | |
| |||
409 | 412 | | |
410 | 413 | | |
411 | 414 | | |
412 | | - | |
| 415 | + | |
413 | 416 | | |
414 | 417 | | |
415 | 418 | | |
| |||
432 | 435 | | |
433 | 436 | | |
434 | 437 | | |
435 | | - | |
| 438 | + | |
| 439 | + | |
436 | 440 | | |
437 | 441 | | |
438 | 442 | | |
| |||
0 commit comments