branch: elpa/graphql-mode
commit 5bd8b6273ef8901269894668bfcb4460e497e5ec
Author: David Vazquez Pua <[email protected]>
Commit: David Vazquez Pua <[email protected]>

    fontify more graphql constructions
---
 graphql.el | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/graphql.el b/graphql.el
index d3ace6f844..c1a53f5339 100644
--- a/graphql.el
+++ b/graphql.el
@@ -34,12 +34,24 @@
     st))
 
 (defvar graphql-font-lock-keywords
-  (list (regexp-opt (list "type" "fragment"))
+  (list
+   ;; Keywords
+   (regexp-opt (list "type" "fragment" "interface" "union"))
 
-        (cons (regexp-opt (list "true" "false" "null"))
-              'font-lock-constant-face)
+   ;; Constants
+   (cons (regexp-opt (list "true" "false" "null"))
+         'font-lock-constant-face)
+
+   ;; Built-in scalar types
+   (cons (regexp-opt (list "Int" "Float" "String" "Boolean" "ID"))
+         'font-lock-type-face)
+
+   ;; Directives
+   '("@\\w+" . font-lock-keyword-face)
+
+   ;; Variables
+   '("\\$\\w+" . font-lock-variable-name-face)))
 
-        '("\\$\\w+" . font-lock-variable-name-face)))
 
 (define-derived-mode graphql-mode prog-mode "GraphQL"
   ""

Reply via email to