Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Unified Diff: test/protos/dart_options.proto

Issue 2086253002: Allow application of external mixins to generated dart protos. (Closed) Base URL: https://github.com/dart-lang/dart-protoc-plugin.git@master
Patch Set: Update from code review. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/protos/dart_options.proto
diff --git a/test/protos/dart_options.proto b/test/protos/dart_options.proto
index 7a16d818606f5a865c456b856ee29380b84ec3e5..3f75f67134e339f163ba57135ed5c03e677715b8 100644
--- a/test/protos/dart_options.proto
+++ b/test/protos/dart_options.proto
@@ -10,8 +10,31 @@ package dart_options;
import "descriptor_2_5_opensource.proto";
+// A mixin to be applied in the 'with' clause of a generated proto in dart.
+message DartMixin {
+ // Class name of the mixin class.
+ optional string name = 1;
+
+ // File from which the mixin class is imported.
skybrian 2016/06/23 19:01:42 "File" => "URI"
+ // The generated Dart code will use this in an import statement.
+ optional string import_from = 2;
+
+ // Used to apply multiple mixins to a proto.
+ // The mixin listed in parent will always be applied before this one,
+ // making the generated proto implement both mixins.
+ optional string parent = 3;
+}
+
extend google.protobuf.FileOptions {
+ // Defines the named mixins to be used on messages in this file.
+ // These mixins are in addition to internally defined mixins (e.g PbMapMixin)
+ // and may override them.
+ // Warning: there is no checking at compile time for name conflicts between
+ // identifiers defined in the mixin and proto-generated identifiers.
+ // Running dartanalyzer on the generated file might find some of them.
+ repeated DartMixin mixins = 28125061;
+
// Applies the named mixin to all messages in this file.
// (May be overridden by the "mixin" option on a message.)
// For now, "PbMapMixin" is the only available mixin.
« lib/message_generator.dart ('K') | « test/mixin_test.dart ('k') | test/protos/mixins.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698