ScalaBuff icon indicating copy to clipboard operation
ScalaBuff copied to clipboard

When importing a proto with a package statement ScalaBuff generates incorrect Scala code

Open thesamet opened this issue 10 years ago • 4 comments

Example:

foo.proto:

 package foo;
 option java_package = "com.company.proto";

 message FooMsg {
   optional int a = 1;
 }

bar.proto:

option java_package = "com.company.proto";
import "foo.proto";
message BarMsg {
   optional foo.FooMsg foo = 1;
}

ScalaBuff will correctly generate FooMsg and BarMsg under the same package com.company.proto, and therefore the reference from BarMsg to FooMsg should be either unqualified (just FooMsg) or the full com.company.proto.FooMsg. However, currently, ScalaBuff emits foo.FooMsg which does not exist.

thesamet avatar Jul 21 '14 00:07 thesamet

Pull request #91 is an attempt to address the issue.

xflin avatar Sep 25 '14 08:09 xflin

@thesamet, can you confirm that the issue is fixed in 1.4.0? Thanks.

SandroGrzicic avatar Feb 10 '15 02:02 SandroGrzicic

@SandroGrzicic thanks for fixing this. We haven't heard anything for a while, and wanted to have a shot at addressing few other gaps (lenses, one-ofs, custom types), so we started http://trueaccord.github.io/ScalaPB/

thesamet avatar Feb 10 '15 02:02 thesamet

Looks good - having more similar projects is always a good thing, especially since your project is using protoc itself instead of having a custom parser as in ScalaBuff. Good luck!

SandroGrzicic avatar Feb 10 '15 03:02 SandroGrzicic