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

Specify csharp_namespace option in daml_lf* proto files to provide consistency with Java namespace #1900

Closed
AndrewDCDrummond opened this issue Jun 26, 2019 · 0 comments

Comments

Projects
None yet
2 participants
@AndrewDCDrummond
Copy link

commented Jun 26, 2019

The daml_lf proto files in daml\daml-lf\archive\da specify a java namespace with the option :

option java_package = "com.digitalasset.daml_lf";

This leads java code to import the namespaces as :

import com.digitalasset.daml_lf.DamlLf;
import com.digitalasset.daml_lf.DamlLf1;

When the protoc compiler generates C# it however puts them in namespaces that are just the shortened package names, such as DamlLf and DamlLf1,

so to import them would look like this :

using DamlLf;
using DamlLf1;

It would be nice if these namespaces mimiced the Java namespaces more closely, which can be accomplished by adding the option to set the csharp namespace :

option csharp_namespace = "Com.DigitalAsset.Daml_lf.DamlLf";

in the file daml_lf.proto

option csharp_namespace = "Com.DigitalAsset.Daml_lf.DamlLf0";

in the file daml_lf_0.proto

and

option csharp_namespace = "Com.DigitalAsset.Daml_lf.DamlLf1";

in the file daml_lf_1.proto

The different namespaces in each file account for the outer class Java generates.

@remyhaemmerle-da remyhaemmerle-da self-assigned this Jun 27, 2019

@remyhaemmerle-da remyhaemmerle-da added this to the Maintenance milestone Jun 27, 2019

remyhaemmerle-da added a commit that referenced this issue Jun 27, 2019

remyhaemmerle-da added a commit that referenced this issue Jun 27, 2019

@mergify mergify bot closed this in c412d4e Jun 27, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.