Merge pull request #301 from timfeirg:feature/graphql

This commit is contained in:
Dan Reif
2018-05-08 10:28:33 -07:00
parent dc8b2f45de
commit e2404449e4
8 changed files with 216 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1
if exists('b:current_syntax')
let s:current_syntax = b:current_syntax
unlet b:current_syntax
endif
syn include @GraphQLSyntax syntax/graphql.vim
if exists('s:current_syntax')
let b:current_syntax = s:current_syntax
endif
syntax region graphqlTemplateString start=+`+ skip=+\\\(`\|$\)+ end=+`+ contains=@GraphQLSyntax,jsTemplateExpression,jsSpecial extend
exec 'syntax match graphqlTaggedTemplate +\%(' . join(g:graphql_javascript_tags, '\|') . '\)\%(`\)\@=+ nextgroup=graphqlTemplateString'
hi def link graphqlTemplateString jsTemplateString
hi def link graphqlTaggedTemplate jsTaggedTemplate
syn cluster jsExpression add=graphqlTaggedTemplate
syn cluster graphqlTaggedTemplate add=graphqlTemplateString
endif