Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setting the module name #235

Open
awalterschulze opened this issue Sep 14, 2018 · 1 comment
Open

setting the module name #235

awalterschulze opened this issue Sep 14, 2018 · 1 comment

Comments

@awalterschulze
Copy link

It seems that the generated code always has module Proto.

Is there some way I could get more control?

For example inside the proto file

option haskell_package = "Data.MyPackage.MySubPackage.MyModule"

As has been done for most other languages.

@judah
Copy link
Collaborator

judah commented Sep 15, 2018

This is not currently supported. I think it might be possible, but have not looked into it deeply. Changing proto-lens-protoc (which generates the output files) should be straightforward; changing proto-lens-setup (the Cabal integration) could be tricky since I'm not sure it has the right level of visibility into the FileDescriptorProto.

One other issue is that we'd most likely want to support this option via an extension, similar to ScalaPB: https://scalapb.github.io/customizations.html
But proto-lens doesn't support extensions yet (#27). We could also upstream a change to the protobuf library itself, but I'm not sure how difficult it would be.

(If we did support this, I'd also suggest calling it haskell_module since "package" in Haskell means a collection of module files.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants