Skip to content

Commit

Permalink
Assign scope to comment punctuations
Browse files Browse the repository at this point in the history
  • Loading branch information
chenglou committed Aug 23, 2020
1 parent 2cba537 commit ed53e5a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
11 changes: 8 additions & 3 deletions ReScript.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,20 @@ variables:
contexts:

commentLine:
- match: //.*
# TODO: append with file scope
scope: comment.line
- match: //
scope: punctuation.definition.comment
push:
- meta_scope: comment.line
- match: \n
pop: true

commentBlock:
- match: /\*
scope: punctuation.definition.comment.begin
push:
- meta_scope: comment.block
- match: \*/
scope: punctuation.definition.comment.end
pop: true

punctuations:
Expand Down
7 changes: 4 additions & 3 deletions syntax_test.res
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
// ^ source.res comment.line

//
// <- source.res comment.line
// <- source.res comment.line punctuation.definition.comment

/* hello
// <- source.res comment.block
// <- source.res comment.block punctuation.definition.comment.begin
world */
// ^ source.res comment.block
//^ source.res comment.block
// ^ source.res comment.block punctuation.definition.comment.end

"aa";
// ^ source.res string.quoted.double punctuation.definition.string.begin
Expand Down

0 comments on commit ed53e5a

Please sign in to comment.