Skip to content

[codegen] Escape variable delimiters in raw comment printing#32190

Merged
drfloob merged 1 commit into
grpc:masterfrom
drfloob:fix/proto-escape-var-delimiter
Jan 24, 2023
Merged

[codegen] Escape variable delimiters in raw comment printing#32190
drfloob merged 1 commit into
grpc:masterfrom
drfloob:fix/proto-escape-var-delimiter

Conversation

@drfloob

@drfloob drfloob commented Jan 24, 2023

Copy link
Copy Markdown
Member

Fixes #32171

}

std::string EscapeVariableDelimiters(std::string&& mut_str) {
size_t index = 0;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider instead using absl::StrReplaceAll() for this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was my first instinct, but the grpc_plugin_support target has very few dependencies, and I'm not entirely sure why, it seems almost by design. Maybe for code bloat reasons? Anyhow, that's the only reason I didn't use abseil here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like we should be careful on adding more dependency to grpc_plugin_support.

@veblush veblush left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for having this quick fix.

@drfloob drfloob merged commit 2e69349 into grpc:master Jan 24, 2023
@copybara-service copybara-service Bot added the imported Specifies if the PR has been imported to the internal repository label Jan 24, 2023
XuanWang-Amos pushed a commit to XuanWang-Amos/grpc that referenced this pull request May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bloat/none imported Specifies if the PR has been imported to the internal repository per-call-memory/neutral per-channel-memory/neutral release notes: no Indicates if PR should not be in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gRPC plugin crashes (or fails) if the service comments contain a single $

3 participants