codekingpro/portable-devtools
114k
1" Vim syntax file2" Language: graphql3" Maintainer: Jon Parise <jon@indelible.org>4" Filenames: *.graphql *.graphqls *.gql5" URL: https://github.com/jparise/vim-graphql6" License: MIT <https://opensource.org/license/mit>7" Last Change: 2024 Dec 218 9if !exists('main_syntax')10 if exists('b:current_syntax')11 finish12 endif13 let main_syntax = 'graphql'14endif15 16syn case match17 18syn match graphqlComment "#.*$" contains=@Spell19 20syn match graphqlOperator "=" display21syn match graphqlOperator "!" display22syn match graphqlOperator "|" display23syn match graphqlOperator "&" display24syn match graphqlOperator "\M..." display25 26syn keyword graphqlBoolean true false27syn keyword graphqlNull null28syn match graphqlNumber "-\=\<\%(0\|[1-9]\d*\)\%(\.\d\+\)\=\%([eE][-+]\=\d\+\)\=\>" display29syn region graphqlString start=+"+ skip=+\\\\\|\\"+ end=+"\|$+30syn region graphqlString start=+"""+ skip=+\\"""+ end=+"""+31 32syn keyword graphqlKeyword repeatable nextgroup=graphqlKeyword skipwhite33syn keyword graphqlKeyword on nextgroup=graphqlType,graphqlDirectiveLocation skipwhite34 35syn keyword graphqlStructure enum scalar type union nextgroup=graphqlType skipwhite36syn keyword graphqlStructure input interface subscription nextgroup=graphqlType skipwhite37syn keyword graphqlStructure implements nextgroup=graphqlType skipwhite38syn keyword graphqlStructure query mutation fragment nextgroup=graphqlName skipwhite39syn keyword graphqlStructure directive nextgroup=graphqlDirective skipwhite40syn keyword graphqlStructure extend nextgroup=graphqlStructure skipwhite41syn keyword graphqlStructure schema nextgroup=graphqlFold skipwhite42 43syn match graphqlDirective "\<@\h\w*\>" display44syn match graphqlVariable "\<\$\h\w*\>" display45syn match graphqlName "\<\h\w*\>" display46syn match graphqlType "\<_*\u\w*\>" display47 48" https://spec.graphql.org/October2021/#ExecutableDirectiveLocation49syn keyword graphqlDirectiveLocation QUERY MUTATION SUBSCRIPTION FIELD50syn keyword graphqlDirectiveLocation FRAGMENT_DEFINITION FRAGMENT_SPREAD51syn keyword graphqlDirectiveLocation INLINE_FRAGMENT VARIABLE_DEFINITION52" https://spec.graphql.org/October2021/#TypeSystemDirectiveLocation53syn keyword graphqlDirectiveLocation SCHEMA SCALAR OBJECT FIELD_DEFINITION54syn keyword graphqlDirectiveLocation ARGUMENT_DEFINITION INTERFACE UNION55syn keyword graphqlDirectiveLocation ENUM ENUM_VALUE INPUT_OBJECT56syn keyword graphqlDirectiveLocation INPUT_FIELD_DEFINITION57 58syn keyword graphqlMetaFields __schema __type __typename59 60syn region graphqlFold matchgroup=graphqlBraces start="{" end="}" transparent fold contains=ALLBUT,graphqlStructure61syn region graphqlList matchgroup=graphqlBraces start="\[" end="]" transparent contains=ALLBUT,graphqlDirective,graphqlStructure62 63if main_syntax ==# 'graphql'64 syn sync minlines=50065endif66 67hi def link graphqlComment Comment68hi def link graphqlOperator Operator69 70hi def link graphqlBraces Delimiter71 72hi def link graphqlBoolean Boolean73hi def link graphqlNull Keyword74hi def link graphqlNumber Number75hi def link graphqlString String76 77hi def link graphqlDirective PreProc78hi def link graphqlDirectiveLocation Special79hi def link graphqlName Identifier80hi def link graphqlMetaFields Special81hi def link graphqlKeyword Keyword82hi def link graphqlStructure Structure83hi def link graphqlType Type84hi def link graphqlVariable Identifier85 86let b:current_syntax = 'graphql'87 88if main_syntax ==# 'graphql'89 unlet main_syntax90endif91 