File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -221,6 +221,33 @@ function highlightDotty(hljs) {
221221 ]
222222 }
223223
224+ // glob all non-whitespace characters as a "string"
225+ const DIRECTIVE_VALUE = {
226+ className : 'string' ,
227+ begin : / \S + / ,
228+ }
229+
230+ // glob all non-whitespace characters as a "type", so that we can highlight differently to values
231+ const DIRECTIVE_KEY = {
232+ className : 'type' ,
233+ begin : / \S + / ,
234+ }
235+
236+ // directives
237+ const USING_DIRECTIVE = hljs . COMMENT ( '//>' , '\n' , {
238+ contains : [
239+ {
240+ begin : / u s i n g / ,
241+ end : / \s / ,
242+ keywords : 'using' ,
243+ contains : [
244+ DIRECTIVE_KEY
245+ ]
246+ } ,
247+ DIRECTIVE_VALUE ,
248+ ]
249+ } )
250+
224251 // Documentation
225252 const SCALADOC = hljs . COMMENT ( '/\\*\\*' , '\\*/' , {
226253 contains : [
@@ -454,6 +481,7 @@ function highlightDotty(hljs) {
454481 NUMBER ,
455482 CHAR ,
456483 STRING ,
484+ USING_DIRECTIVE ,
457485 SCALADOC ,
458486 hljs . C_LINE_COMMENT_MODE ,
459487 hljs . C_BLOCK_COMMENT_MODE ,
You can’t perform that action at this time.
0 commit comments