From 1c639f781003accdcc43c6a167b29a02e5ff64f0 Mon Sep 17 00:00:00 2001 From: Gianni Chiappetta Date: Wed, 13 Jan 2021 21:24:56 -0500 Subject: [PATCH] feat(rc): improve graphql syntax highlighters --- rc/filetype/graphql.kak | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/rc/filetype/graphql.kak b/rc/filetype/graphql.kak index 5cb52464..430905b8 100644 --- a/rc/filetype/graphql.kak +++ b/rc/filetype/graphql.kak @@ -34,15 +34,39 @@ provide-module graphql %( add-highlighter shared/graphql regions add-highlighter shared/graphql/code default-region group -add-highlighter shared/graphql/string region '"' (?!)' bang:operator +add-highlighter shared/graphql/object/field/assignment regex '=' 0:operator + +# Keywords +add-highlighter shared/graphql/code/top-level regex '\bschema\b' 0:keyword +add-highlighter shared/graphql/code/keywords regex '\b(?enum|fragment|input|implements|interface|mutation|on|query|scalar|subscription|type|union)\h+(?:[A-Za-z]\w*)' name:keyword + +# Types +add-highlighter shared/graphql/object/field/scalars regex \b(Boolean|Float|ID|Int|String)\b 0:type + +# Operators +add-highlighter shared/graphql/object/field/expand-fragment regex '\.\.\.(?=\w)' 0:operator # Commands # ‾‾‾‾‾‾‾‾