-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scrooge: support fully-qualified type name for fields
Problem Currently scrooge-generator does not support more than one dot in thrift file name. Suppose we have a thrift file with the name com.whatever.product.module1.thrift: ``` struct Foo { 1: i32 foo_field; } ``` and another thrift file that includes com.whatever.product.module1.thrift: ``` include "com.whatever.product.module1.thrift" struct Bar { 1: com.whatever.product.module1.Foo bar_field; } ``` This doesn't work with the current version of scrooge-generator. Solution Changing the `scopePrefix` to `Identifier` & other related places fixes this problem. Signed-off-by: Bryce Anderson <[email protected]> Differential Revision: https://phabricator.twitter.biz/D467516
- Loading branch information
1 parent
2189d28
commit 4fad471
Showing
8 changed files
with
38 additions
and
16 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
scrooge-generator-tests/src/test/thrift/namespace/namespace_full.qualified.filename.thrift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
namespace java foo.qualified.included | ||
|
||
struct Bar { | ||
1: i32 x; | ||
} |
7 changes: 7 additions & 0 deletions
7
scrooge-generator-tests/src/test/thrift/namespace/namespace_qualified.thrift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace java foo.qualified | ||
|
||
include "namespace_full.qualified.filename.thrift" | ||
|
||
struct Foo { | ||
1: namespace_full.qualified.filename.Bar bar; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters