aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/compiler/ruby_generator_helpers-inl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/ruby_generator_helpers-inl.h')
-rw-r--r--src/compiler/ruby_generator_helpers-inl.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/compiler/ruby_generator_helpers-inl.h b/src/compiler/ruby_generator_helpers-inl.h
index 9da7cab3c7..ff6939ed9f 100644
--- a/src/compiler/ruby_generator_helpers-inl.h
+++ b/src/compiler/ruby_generator_helpers-inl.h
@@ -35,6 +35,7 @@
#define GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_HELPERS_INL_H
#include "src/compiler/config.h"
+#include "src/compiler/generator_helpers.h"
#include "src/compiler/ruby_generator_string-inl.h"
namespace grpc_ruby_generator {
@@ -60,6 +61,13 @@ inline grpc::string MessagesRequireName(
return Replace(file->name(), ".proto", "");
}
+// Get leading or trailing comments in a string. Comment lines start with "# ".
+// Leading detached comments are put in in front of leading comments.
+template <typename DescriptorType>
+inline grpc::string GetRubyComments(const DescriptorType *desc, bool leading) {
+ return grpc_generator::GetPrefixedComments(desc, leading, "#");
+}
+
} // namespace grpc_ruby_generator
#endif // GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_HELPERS_INL_H