Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiline comments in protobuf #2597

Merged
merged 2 commits into from
Jun 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Language Improvements:
- enh(dart) Add `late` and `required` keywords, and `Never` built-in type (#2550) [Sam Rawlins][]
- enh(erlang) Add underscore separators to numeric literals (#2554) [Sergey Prokhorov][]
- enh(handlebars) Support for sub-expressions, path-expressions, hashes, block-parameters and literals (#2344) [Nils Knappmeier][]
- enh(protobuf) Support multiline comments (#2597) [Pavel Evstigneev][]

[Josh Goebel]: https://github.com/yyyc514
[Peter Plantinga]: https://github.com/pplantinga
Expand All @@ -60,6 +61,7 @@ Language Improvements:
[Martin (Lhoerion)]: https://github.com/Lhoerion
[Jim Mason]: https://github.com/RocketMan
[lioshi]: https://github.com/lioshi
[Pavel Evstigneev]: https://github.com/Paxa


## Version 10.0.2
Expand Down
1 change: 1 addition & 0 deletions src/languages/protobuf.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default function(hljs) {
hljs.QUOTE_STRING_MODE,
hljs.NUMBER_MODE,
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
{
className: 'class',
beginKeywords: 'message enum service', end: /\{/,
Expand Down
6 changes: 6 additions & 0 deletions test/markup/protobuf/message-message.expect.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
<span class="hljs-comment">// A Container message</span>
<span class="hljs-class"><span class="hljs-keyword">message</span> <span class="hljs-title">Container</span> </span>{
<span class="hljs-class"><span class="hljs-keyword">message</span> <span class="hljs-title">Message</span> </span>{
<span class="hljs-keyword">required</span> <span class="hljs-built_in">int64</span> id = <span class="hljs-number">1</span>;
}
<span class="hljs-keyword">repeated</span> Message messages = <span class="hljs-number">1</span>;
<span class="hljs-keyword">optional</span> <span class="hljs-built_in">int32</span> number = <span class="hljs-number">2</span>;
}

<span class="hljs-comment">/*
test multiline
comment
*/</span>
6 changes: 6 additions & 0 deletions test/markup/protobuf/message-message.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
// A Container message
message Container {
message Message {
required int64 id = 1;
}
repeated Message messages = 1;
optional int32 number = 2;
}

/*
test multiline
comment
*/