Skip to content

Commit d1d48b3

Browse files
author
Dave Bartolomeo
authored
Merge pull request #1468 from dbartol/dbartol/pmod-highlight/work
Add `implements` and `signature` to syntax highlighting
2 parents edcac69 + 9180d1d commit d1d48b3

File tree

2 files changed

+1513
-1416
lines changed

2 files changed

+1513
-1416
lines changed

extensions/ql-vscode/syntaxes/ql.tmLanguage.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,11 @@ repository:
564564
keyword: 'query'
565565
name: storage.modifier.query.ql
566566

567+
signature:
568+
match:
569+
keyword: 'signature'
570+
name: storage.modifier.signature.ql
571+
567572
transient:
568573
match:
569574
keyword: 'transient'
@@ -583,8 +588,14 @@ repository:
583588
- include: '#pragma'
584589
- include: '#private'
585590
- include: '#query'
591+
- include: '#signature'
586592
- include: '#transient'
587593

594+
implements:
595+
match:
596+
keyword: 'implements'
597+
name: keyword.other.implements.ql
598+
588599
# A QL comment, regardless of form.
589600
comment:
590601
patterns:
@@ -668,6 +679,19 @@ repository:
668679
- match: '(?#simple-id)'
669680
name: entity.name.type.namespace.ql
670681

682+
# The `implements` clause of a module definition.
683+
implements-clause:
684+
beginPattern: '#implements'
685+
# Ends at the first `{`.
686+
# REVIEW: This could be any token not allowed in a type.
687+
end: '(?= \{ )'
688+
name: meta.block.implements-clause.ql
689+
patterns:
690+
- include: '#non-context-sensitive'
691+
- match: '(?#simple-id)|(?#at-lower-id)'
692+
name: entity.name.type.ql
693+
694+
671695
# A `module` declaration, whether a module definition or an alias declaration.
672696
module-declaration:
673697
# Starts with the `module` keyword.
@@ -677,6 +701,7 @@ repository:
677701
name: meta.block.module-declaration.ql
678702
patterns:
679703
- include: '#module-body'
704+
- include: '#implements-clause'
680705
- include: '#non-context-sensitive'
681706
# Any simple-id within a module head is part of a module name.
682707
- match: '(?#simple-id)'

0 commit comments

Comments
 (0)