Include the source file name in the generated header (#125)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index b3faaa9..dfaa61f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,8 +1,11 @@
+## 0.10.2
+
+* Add link to source file in generated code.
+
 ## 0.10.1
 
-* Breaking change: Prefix generated Dart proto imports by proto file path instead of by package.
+* Prefix generated Dart proto imports by proto file path instead of by package.
   Tighten up member name checks for generated enum classes.
-  Requires package:protobuf version 0.10.2 or newer.
 
 ## 0.10.0
 
diff --git a/lib/file_generator.dart b/lib/file_generator.dart
index eeecdfb..783ae92 100644
--- a/lib/file_generator.dart
+++ b/lib/file_generator.dart
@@ -510,6 +510,7 @@
     out.println('''
 ///
 //  Generated code. Do not modify.
+//  source: ${descriptor.name}
 ///
 // ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import
 ''');
diff --git a/lib/src/dart_options.pb.dart b/lib/src/dart_options.pb.dart
index 0f20e07..055399b 100644
--- a/lib/src/dart_options.pb.dart
+++ b/lib/src/dart_options.pb.dart
@@ -1,5 +1,6 @@
 ///
 //  Generated code. Do not modify.
+//  source: dart_options.proto
 ///
 // ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import
 
diff --git a/lib/src/descriptor.pb.dart b/lib/src/descriptor.pb.dart
index 0be6201..9f317df 100644
--- a/lib/src/descriptor.pb.dart
+++ b/lib/src/descriptor.pb.dart
@@ -1,5 +1,6 @@
 ///
 //  Generated code. Do not modify.
+//  source: descriptor.proto
 ///
 // ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import
 
diff --git a/lib/src/descriptor.pbenum.dart b/lib/src/descriptor.pbenum.dart
index 00b0491..b0c06b7 100644
--- a/lib/src/descriptor.pbenum.dart
+++ b/lib/src/descriptor.pbenum.dart
@@ -1,5 +1,6 @@
 ///
 //  Generated code. Do not modify.
+//  source: descriptor.proto
 ///
 // ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import
 
diff --git a/lib/src/plugin.pb.dart b/lib/src/plugin.pb.dart
index 7a8ea75..38a9de0 100644
--- a/lib/src/plugin.pb.dart
+++ b/lib/src/plugin.pb.dart
@@ -1,5 +1,6 @@
 ///
 //  Generated code. Do not modify.
+//  source: plugin.proto
 ///
 // ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import
 
diff --git a/pubspec.yaml b/pubspec.yaml
index 85cc31a..0ac32e9 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
 name: protoc_plugin
-version: 0.10.1
+version: 0.10.2
 author: Dart Team <misc@dartlang.org>
 description: Protoc compiler plugin to generate Dart code
 homepage: https://github.com/dart-lang/dart-protoc-plugin
diff --git a/test/goldens/grpc_service.pb b/test/goldens/grpc_service.pb
index 84d08bb..d2bab4b 100644
--- a/test/goldens/grpc_service.pb
+++ b/test/goldens/grpc_service.pb
@@ -1,5 +1,6 @@
 ///
 //  Generated code. Do not modify.
+//  source: test
 ///
 // ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import
 
diff --git a/test/goldens/grpc_service.pbgrpc b/test/goldens/grpc_service.pbgrpc
index 3877a3c..2a91b25 100644
--- a/test/goldens/grpc_service.pbgrpc
+++ b/test/goldens/grpc_service.pbgrpc
@@ -1,5 +1,6 @@
 ///
 //  Generated code. Do not modify.
+//  source: test
 ///
 // ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import
 
diff --git a/test/goldens/header_in_package.pb b/test/goldens/header_in_package.pb
index e77372f..7b74077 100644
--- a/test/goldens/header_in_package.pb
+++ b/test/goldens/header_in_package.pb
@@ -1,5 +1,6 @@
 ///
 //  Generated code. Do not modify.
+//  source: test
 ///
 // ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import
 
diff --git a/test/goldens/header_with_fixnum.pb b/test/goldens/header_with_fixnum.pb
index dbb4437..4d353b1 100644
--- a/test/goldens/header_with_fixnum.pb
+++ b/test/goldens/header_with_fixnum.pb
@@ -1,5 +1,6 @@
 ///
 //  Generated code. Do not modify.
+//  source: test
 ///
 // ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import
 
diff --git a/test/goldens/imports.pb b/test/goldens/imports.pb
index cc0b0f1..aed53ad 100644
--- a/test/goldens/imports.pb
+++ b/test/goldens/imports.pb
@@ -1,5 +1,6 @@
 ///
 //  Generated code. Do not modify.
+//  source: test.proto
 ///
 // ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import
 
diff --git a/test/goldens/imports.pbjson b/test/goldens/imports.pbjson
index 5792ad6..02eb3e2 100644
--- a/test/goldens/imports.pbjson
+++ b/test/goldens/imports.pbjson
@@ -1,5 +1,6 @@
 ///
 //  Generated code. Do not modify.
+//  source: test.proto
 ///
 // ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import
 
diff --git a/test/goldens/oneMessage.pb b/test/goldens/oneMessage.pb
index 32aac30..bd0a423 100644
--- a/test/goldens/oneMessage.pb
+++ b/test/goldens/oneMessage.pb
@@ -1,5 +1,6 @@
 ///
 //  Generated code. Do not modify.
+//  source: test
 ///
 // ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import
 
diff --git a/test/goldens/oneMessage.pbjson b/test/goldens/oneMessage.pbjson
index 6491be2..15f916b 100644
--- a/test/goldens/oneMessage.pbjson
+++ b/test/goldens/oneMessage.pbjson
@@ -1,5 +1,6 @@
 ///
 //  Generated code. Do not modify.
+//  source: test
 ///
 // ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import
 
diff --git a/test/goldens/service.pb b/test/goldens/service.pb
index c2a72c5..5972079 100644
--- a/test/goldens/service.pb
+++ b/test/goldens/service.pb
@@ -1,5 +1,6 @@
 ///
 //  Generated code. Do not modify.
+//  source: test
 ///
 // ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import
 
diff --git a/test/goldens/service.pbserver b/test/goldens/service.pbserver
index 9e67e8a..c1dc3c4 100644
--- a/test/goldens/service.pbserver
+++ b/test/goldens/service.pbserver
@@ -1,5 +1,6 @@
 ///
 //  Generated code. Do not modify.
+//  source: test
 ///
 // ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import
 
diff --git a/test/goldens/topLevelEnum.pb b/test/goldens/topLevelEnum.pb
index c69577f..af9ca99 100644
--- a/test/goldens/topLevelEnum.pb
+++ b/test/goldens/topLevelEnum.pb
@@ -1,5 +1,6 @@
 ///
 //  Generated code. Do not modify.
+//  source: test
 ///
 // ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import
 
diff --git a/test/goldens/topLevelEnum.pbenum b/test/goldens/topLevelEnum.pbenum
index 2559b05..147d13d 100644
--- a/test/goldens/topLevelEnum.pbenum
+++ b/test/goldens/topLevelEnum.pbenum
@@ -1,5 +1,6 @@
 ///
 //  Generated code. Do not modify.
+//  source: test
 ///
 // ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import
 
diff --git a/test/goldens/topLevelEnum.pbjson b/test/goldens/topLevelEnum.pbjson
index dfda97d..56520fd 100644
--- a/test/goldens/topLevelEnum.pbjson
+++ b/test/goldens/topLevelEnum.pbjson
@@ -1,5 +1,6 @@
 ///
 //  Generated code. Do not modify.
+//  source: test
 ///
 // ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import