File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -383,6 +383,39 @@ export default function(hljs) {
383
383
relevance : 0
384
384
} ,
385
385
{ match : / \b o r \b / , scope : "keyword" } ,
386
+ // Method calls with parentheses
387
+ {
388
+ match : [
389
+ / \. / ,
390
+ IDENT_RE ,
391
+ / (? = \s * \( ) /
392
+ ] ,
393
+ scope : {
394
+ 2 : "title.function.method"
395
+ }
396
+ } ,
397
+ // Chained method calls
398
+ {
399
+ match : [
400
+ / \. / ,
401
+ IDENT_RE ,
402
+ / (? = \s * \. \s * \w ) /
403
+ ] ,
404
+ scope : {
405
+ 2 : "title.function.method"
406
+ }
407
+ } ,
408
+ {
409
+ match : [
410
+ / (?< ! (?: i m p o r t | f r o m ) \s + [ \w . ] * ) / , // Negative lookbehind for import context
411
+ / \. / , // Literal dot
412
+ IDENT_RE , // Property name
413
+ / (? ! \s * [ \( \[ ] ) / // Not followed by ( or [
414
+ ] ,
415
+ scope : {
416
+ 3 : "property"
417
+ }
418
+ } ,
386
419
STRING ,
387
420
COMMENT_TYPE ,
388
421
hljs . HASH_COMMENT_MODE ,
You can’t perform that action at this time.
0 commit comments