Skip to content

Commit

Permalink
Add support for block strings (triple quotes)
Browse files Browse the repository at this point in the history
As per [GraphqQL RFC](https://facebook.github.io/graphql/draft/#sec-String-Value) and its [implementation](graphql/graphql-spec#327), block strings are being a GraphQL supported feature for a while and are used for GraphiQL documentation. This PR add support for the triple quotes (""") block string.
  • Loading branch information
fermads committed Dec 2, 2018
1 parent 081da0d commit ae22565
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion GraphQL.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,18 @@ contexts:
scope: punctuation.definition.comment.graphql
push: line_comment

- match: (""")
scope: punctuation.definition.comment.begin.graphql
push:
- meta_scope: comment.block.graphql
- match: (""")
scope: punctuation.definition.comment.end.graphql
pop: true

main:
# Strings begin and end with quotes, and use backslashes as an escape
# character
- match: '"'
- match: '"\w+'
scope: punctuation.definition.string.begin.graphql
push: double_quoted_string

Expand Down

0 comments on commit ae22565

Please sign in to comment.