From 5f12164f54a12500d2d8276937b7ed4fec408b99 Mon Sep 17 00:00:00 2001 From: "kenton@google.com" Date: Wed, 23 Dec 2009 07:03:06 +0000 Subject: 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. --- src/google/protobuf/compiler/plugin.proto | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/google/protobuf/compiler/plugin.proto') 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; -- cgit v1.2.3