runtime(graphql): Update syntax script to September 2025 spec
Commit:
https://github.com/vim/vim/commit/16d28548d2d3c49733750b6ab7a50bc05ab65e0c
Author: Jon Parise <[email protected]>
Date: Tue Apr 21 19:25:54 2026 +0000
runtime(graphql): Update syntax script to September 2025 spec
A new graphqlEscape syntax graph has been introduced to represent escape
sequences within strings, including the braced unicode form (\u{H+})
added in the September 2025 specification.
See: https://spec.graphql.org/September2025/
closes: #20030
Signed-off-by: Jon Parise <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/runtime/syntax/graphql.vim b/runtime/syntax/graphql.vim
index 01d5ca25f..53ab1cc93 100644
--- a/runtime/syntax/graphql.vim
+++ b/runtime/syntax/graphql.vim
@@ -4,7 +4,7 @@
" Filenames: *.graphql *.graphqls *.gql
" URL: https://github.com/jparise/vim-graphql
" License: MIT <https://opensource.org/license/mit>
-" Last Change: 2024 Dec 21
+" Last Change: 2026 Apr 21
if !exists('main_syntax')
if exists('b:current_syntax')
@@ -26,8 +26,13 @@ syn match graphqlOperator "\M..." display
syn keyword graphqlBoolean true false
syn keyword graphqlNull null
syn match graphqlNumber
"-\=\<\%(0\|[1-9]\d*\)\%(\.\d\+\)\=\%([eE][-+]\=\d\+\)\=\>" display
-syn region graphqlString start=+"+ skip=+\\\|\"+ end=+"\|$+
-syn region graphqlString start=+"""+ skip=+\"""+ end=+"""+
+syn region graphqlString start=+"+ skip=+\\\|\"+ end=+"\|$+
contains=graphqlEscape
+syn region graphqlString start=+"""+ skip=+\"""+ end=+"""+
contains=graphqlEscape
+
+syn match graphqlEscape +\["\/bfnrt]+ contained display
+syn match graphqlEscape +\u\x\{4}+ contained display
+syn match graphqlEscape +\u{\x\+}+ contained display
+syn match graphqlEscape +\""\"+ contained display
syn keyword graphqlKeyword repeatable nextgroup=graphqlKeyword skipwhite
syn keyword graphqlKeyword on nextgroup=graphqlType,graphqlDirectiveLocation
skipwhite
@@ -45,11 +50,11 @@ syn match graphqlVariable "\<\$\h\w*\>" display
syn match graphqlName "\<\h\w*\>" display
syn match graphqlType "\<_*\u\w*\>" display
-" https://spec.graphql.org/October2021/#ExecutableDirectiveLocation
+" https://spec.graphql.org/September2025/#ExecutableDirectiveLocation
syn keyword graphqlDirectiveLocation QUERY MUTATION SUBSCRIPTION FIELD
syn keyword graphqlDirectiveLocation FRAGMENT_DEFINITION FRAGMENT_SPREAD
syn keyword graphqlDirectiveLocation INLINE_FRAGMENT VARIABLE_DEFINITION
-" https://spec.graphql.org/October2021/#TypeSystemDirectiveLocation
+" https://spec.graphql.org/September2025/#TypeSystemDirectiveLocation
syn keyword graphqlDirectiveLocation SCHEMA SCALAR OBJECT FIELD_DEFINITION
syn keyword graphqlDirectiveLocation ARGUMENT_DEFINITION INTERFACE UNION
syn keyword graphqlDirectiveLocation ENUM ENUM_VALUE INPUT_OBJECT
@@ -73,6 +78,7 @@ hi def link graphqlBoolean Boolean
hi def link graphqlNull Keyword
hi def link graphqlNumber Number
hi def link graphqlString String
+hi def link graphqlEscape Special
hi def link graphqlDirective PreProc
hi def link graphqlDirectiveLocation Special
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1wFH1s-00EGX1-Iq%40256bit.org.