11%YAML 1.2
22---
33# See http://www.sublimetext.com/docs/3/syntax.html
4- name : GraphQL Language
4+ name : GraphQL
55file_extensions :
66 - graphql
77 - gql
@@ -30,6 +30,9 @@ contexts:
3030 - match : ' }'
3131 scope : invalid.illegal.stray-bracket-end
3232
33+ - match : ' \)'
34+ scope : invalid.illegal.stray-parentheses-end
35+
3336 # Argument Property
3437 - match : ' (?<=\()\w+(?=\:)'
3538 scope : string.property.argument.graphql
@@ -42,6 +45,26 @@ contexts:
4245 - match : ' \b\w+(?=\()'
4346 scope : string.property.graphql
4447
48+ # Built-in Scalar Types
49+ - match : ' \bID\b'
50+ scope : constant.language.id.graphql
51+
52+ - match : ' \bInt\b'
53+ scope : constant.language.int.graphql
54+
55+ - match : ' \bString\b'
56+ scope : constant.language.string.graphql
57+
58+ - match : ' \bFloat\b'
59+ scope : constant.language.float.graphql
60+
61+ - match : ' \bBoolean\b'
62+ scope : constant.language.boolean.graphql
63+
64+ # Numbers
65+ - match : ' \b(-)?[0-9.]+\b'
66+ scope : constant.numeric.graphql
67+
4568 # Symbols
4669 - match : ' \:'
4770 scope : constant.other.object.key.graphql
@@ -55,7 +78,7 @@ contexts:
5578 - match : ' ='
5679 scope : keyword.operator.assignment.graphql
5780
58- # Storage Types
81+ # Type Definitions
5982 - match : ' \btype\b'
6083 scope : storage.type.type.graphql
6184
@@ -80,7 +103,7 @@ contexts:
80103 - match : ' \benum\b'
81104 scope : storage.type.enum.graphql
82105
83- # Storage type names
106+ # Type Definition Names
84107 - match : ' (?<=type )\w+\b'
85108 scope : meta.type.type
86109
@@ -105,10 +128,6 @@ contexts:
105128 - match : ' (?<=enum )\w+\b'
106129 scope : meta.type.enum
107130
108- # Numbers
109- - match : ' \b(-)?[0-9.]+\b'
110- scope : constant.numeric.graphql
111-
112131 brackets :
113132 - match : ' }'
114133 pop : true
0 commit comments