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

Unified Diff: lib/protobuf_field.dart

Issue 131943002: Handle protocol buffer messages with no package (Closed) Base URL: https://github.com/dart-lang/dart-protoc-plugin.git@master
Patch Set: Fix bug and updte version Created 6 years, 11 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
« no previous file with comments | « lib/file_generator.dart ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/protobuf_field.dart
diff --git a/lib/protobuf_field.dart b/lib/protobuf_field.dart
index fb0d564115260bc7c6d3f9e643a6e537e0a9974d..897de78780aaaa0c50208d7c1f93253e6dd5bad7 100644
--- a/lib/protobuf_field.dart
+++ b/lib/protobuf_field.dart
@@ -267,7 +267,11 @@ class ProtobufField {
typePackage = groupType.package;
baseType = groupType.classname;
typeString = write(groupType.classname);
- prefixedBaseType = groupType.packageImportPrefix + '.' + baseType;
+ if (groupType.packageImportPrefix.isNotEmpty) {
+ prefixedBaseType = groupType.packageImportPrefix + '.' + baseType;
+ } else {
+ prefixedBaseType = baseType;
+ }
prefixedTypeString = write(prefixedBaseType);
codedStreamType = 'Group';
} else {
@@ -282,7 +286,11 @@ class ProtobufField {
typePackage = messageType.package;
baseType = messageType.classname;
typeString = write(baseType);
- prefixedBaseType = messageType.packageImportPrefix + '.' + baseType;
+ if (messageType.packageImportPrefix.isNotEmpty) {
+ prefixedBaseType = messageType.packageImportPrefix + '.' + baseType;
+ } else {
+ prefixedBaseType = baseType;
+ }
prefixedTypeString = write(prefixedBaseType);
codedStreamType = 'Message';
} else {
@@ -298,7 +306,11 @@ class ProtobufField {
baseType = enumType.classname;
typeString = write(enumType.classname);
codedStreamType = 'Enum';
- prefixedBaseType = enumType.packageImportPrefix + '.' + baseType;
+ if (enumType.packageImportPrefix.isNotEmpty) {
+ prefixedBaseType = enumType.packageImportPrefix + '.' + baseType;
+ } else {
+ prefixedBaseType = baseType;
+ }
prefixedTypeString = write(prefixedBaseType);
packable = true;
if (!repeats) {
« no previous file with comments | « lib/file_generator.dart ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698