Conversation
experimental/fdp/generator.go
Outdated
| if prefixed := fieldAST.Type.AsPrefixed(); !prefixed.IsZero() { | ||
| return prefixed.PrefixToken().ID() | ||
| } | ||
| return token.ID(fieldAST.Type.ID()) |
There was a problem hiding this comment.
^^" How so? This is just a small refactor for the previous logic using the field AST's type token or its prefix token as starts for the field definition...? Unless you're saying the previous logic is also wrong?
There was a problem hiding this comment.
oh uh. the cast seems redudant...? This does not seem obviously correct is what I mean. Wouldn't it be more robust to pull the span and then use stream.Around?
There was a problem hiding this comment.
the cast seems redudant...?
So it doesn't seem to want to compile without it... and I think it's because it's the ID for TypeAny... o_o That being said, it's kind of moot because...
Wouldn't it be more robust to pull the span and then use stream.Around?
Honestly, yeah, this is better, I refactored all of the logic here to just do that and ensured that the tests are still passing/correct. So this helper is no longer needed.
This fixes the source code info for
groupfields,where the comments for group fields should be attributed
to the synthetic message type rather than the field.
This behaviour has been checked against
protoc.