Closed EHotwagner closed 7 years ago
I worked on the parser but never really looked at the TypeProvider. DebugGameState
is the only enum
in that list so that may be a clue. However, I'm not sure what's wrong because the generator does appear to support enum values in a oneof (see here).
Could you try adding an unknown=0;
as the first member of DebugGameState
?
Are there any additional error details? Stack trace, line numbers, etc.?
@takemyoxygen could you add an enum
to the oneof in type_provider_test.proto
and write a unit test? Also might be useful to include the TypeProvider tests in the main Froto.sln.
@jhugard, I'll try to have a look on the weekend
I will investigate further after the weekend. Thanks for taking a look.
@EHotwagner PR #65 could probably be merged as-is to provide import
support to the parser, but it's not hooked into the TypeProvider yet. @ctaggart I'd intended to do all of Issue #48 with that PR, but might be worth merging just for what it currently does.
Sounds good @jhugard.
I did add unknown=0;
with no effect. A basic proto file with only DebugCommand as a message and only DebugGameState in the oneof does work tough.
The error mesage i get is: "The type provider 'Froto.TypeProvider.ProtocolBuffersTypeProviderCreator' reported an error: Specified method is not supported."
Parse.fromFile genereates a nice Ast List tough. Is the roslyn example the current way of working without the TypeProvider?
I would truly love to see you successful with F# and SC2: both are close to my heart. However, to be honest, while Froto may be useful for some base cases it still needs some attention to get it finished it up.
Froto has three approaches from three different authors: the TypeProvider, Roslyn code gen, and a model for source gen of either records or classes. The first two have some rough edges, and there isn't a released generator for the third.
If the TypeProvider isn't working for you, the Roslyn approach might be worth a try, but then again it might not support oneof
.
As a last-ditch effort, the serializer record model is pretty simple to generate, so you could probably hand-write everything in the SC2 API in a few hours, but that kinda defeats the purpose of having an IDL. If you do go this route, let me know and I'll try to remember how oneof
support works.
Some time back, as an experiment I wrote a plug-in for protoc.exe
in golang which generated code using the record model. The result still needed hand editing to get it to compile, so was never released. It was a bit discouraging that the resulting DLL was not significantly smaller (in bytes) than generated C++ code, which was one of my main goals. On top of that, politically there was no way I'd be able to move the prototype into production, so never finished any of this up.
Thanks a lot. This gives me enough points to start from.
@EHotwagner, @jhugard, I hope #72 should fix the NotSupported
error. I tried to use the type provider with the proto from https://github.com/Blizzard/s2client-proto (compiled in one file, with syntax
, package
and import
directives removed) and it worked fine. It still requires some work to implement import
in the type provider.
Great. Thx a lot.
I am trying to use blizzards sc2 proto files provided here: https://github.com/Blizzard/s2client-proto The first problem is the use of the not supported "import" statement. I concatenated the content of the files to fix this.
Then i got the following error in debug.proto: "Specified method is not supported" in this section:
Any ideas why and how to fix this?