aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/compiler/plugin.proto
diff options
context:
space:
mode:
authorGravatar kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2009-12-23 07:03:06 +0000
committerGravatar kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2009-12-23 07:03:06 +0000
commit5f12164f54a12500d2d8276937b7ed4fec408b99 (patch)
tree5cce5fcecb4a3104ca33fd67e1d37f788b719576 /src/google/protobuf/compiler/plugin.proto
parent46ed74e8d456d7d2a983c6c86e2c347d8a5b4843 (diff)
Refactor the way output is handled in CommandLineInterface -- now it will be stored in-memory until all code generators have completed, then dumped to disk all at once. While this means that protoc uses more memory, the code is much simpler, and handles insertions much faster. Also, this made it easier to implement a useful feature: insertions will be indented to match the insertion point line. Therefore, when inserting into Python code, you don't have to figure out how much to indent your inserted code. The refactoring should also make it easier to implement output-to-jar at some point.
Diffstat (limited to 'src/google/protobuf/compiler/plugin.proto')
-rw-r--r--src/google/protobuf/compiler/plugin.proto7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/google/protobuf/compiler/plugin.proto b/src/google/protobuf/compiler/plugin.proto
index 2db9574c..d91c06e4 100644
--- a/src/google/protobuf/compiler/plugin.proto
+++ b/src/google/protobuf/compiler/plugin.proto
@@ -123,6 +123,13 @@ message CodeGeneratorResponse {
// insertion_point "package_level_decls" to generate additional classes or
// other declarations that should be placed in this scope.
//
+ // Note that if the line containing the insertion point begins with
+ // whitespace, the same whitespace will be added to every line of the
+ // inserted text. This is useful for languages like Python, where
+ // indentation matters. In these languages, the insertion point comment
+ // should be indented the same amount as any inserted code will need to be
+ // in order to work correctly in that context.
+ //
// If |insertion_point| is present, |name| must also be present.
optional string insertion_point = 2;