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) {
221
221
]
222
222
}
223
223
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
+
224
251
// Documentation
225
252
const SCALADOC = hljs . COMMENT ( '/\\*\\*' , '\\*/' , {
226
253
contains : [
@@ -454,6 +481,7 @@ function highlightDotty(hljs) {
454
481
NUMBER ,
455
482
CHAR ,
456
483
STRING ,
484
+ USING_DIRECTIVE ,
457
485
SCALADOC ,
458
486
hljs . C_LINE_COMMENT_MODE ,
459
487
hljs . C_BLOCK_COMMENT_MODE ,
You can’t perform that action at this time.
0 commit comments