Skip to content

Commit

Permalink
Match in terms of ReasonML multiline strings
Browse files Browse the repository at this point in the history
  • Loading branch information
jparise committed Aug 17, 2020
1 parent a1e2551 commit 3a7336a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions after/syntax/reason/graphql.vim
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ syn include @GraphQLSyntax syntax/graphql.vim
if exists('s:current_syntax')
let b:current_syntax = s:current_syntax
endif
syntax region graphqlExtensionPoint start=/\[%graphql\_s*{|/ end=/|}\_s*\]/ contains=@GraphQLSyntax,reasonTemplateExpression keepend
hi def link graphqlExtensionPoint reasonTaggedTemplate

syntax region graphqlMultilineString matchgroup=reasonMultilineString start=+graphql\_s*\zs{|+ end=+|}+ contains=@GraphQLSyntax,reasonEscape,reasonEscapeUnicode,reasonEscapeError,reasonStringContinuation keepend
4 changes: 1 addition & 3 deletions test/reason/default.vader
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Before:
source ../after/syntax/reason/graphql.vim

Execute (Expected syntax groups):
Assert graphql#has_syntax_group('graphqlExtensionPoint')
Assert graphql#has_syntax_group('graphqlMultilineString')

Given reason (Template):
[%graphql {|
Expand All @@ -15,6 +15,4 @@ Given reason (Template):
|}];

Execute (Syntax assertions):
" AssertEqual 'graphqlTaggedTemplate', SyntaxOf('gql')
" AssertEqual 'graphqlTemplateString', SyntaxOf('`')
AssertEqual 'graphqlName', SyntaxOf('user')

0 comments on commit 3a7336a

Please sign in to comment.