purescript-protobuf icon indicating copy to clipboard operation
purescript-protobuf copied to clipboard

Don't generate unparseable files for services

Open i-am-the-slime opened this issue 8 months ago • 1 comments

syntax = "proto3";

package whatever;

import "should/not/matter.proto";

service SomeService {
  rpc SomeRPC(SomeRequest) returns (SomeResponse) {}
}

A file somewhat like the above leads to a file that looks like this:

module Whatever.Service
( 
)
where
import Protobuf.Internal.Prelude
import Protobuf.Internal.Prelude as Prelude

-- some imports...

The PureScript parser doesn't like empty export lists like that. Ideally of course there'd be some RPC definition in the result, but maybe something non-broken (no parens for empty export lists?) would be a good start?

i-am-the-slime avatar Feb 28 '25 08:02 i-am-the-slime

That should be fixed, thanks for the bug report.

jamesdbrock avatar Mar 25 '25 15:03 jamesdbrock