Skip to content

Commit

Permalink
enh(protobuf) Support multiline comments (#2597)
Browse files Browse the repository at this point in the history
  • Loading branch information
Paxa committed Jun 8, 2020
1 parent c4c9772 commit 1bfe834
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
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
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
@@ -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
@@ -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
*/

0 comments on commit 1bfe834

Please sign in to comment.