Skip to content

Commit

Permalink
Merge pull request #14 from willstott101/master
Browse files Browse the repository at this point in the history
Add support for interfaces implementing interfaces. Also consider & an operator.
  • Loading branch information
dncrews committed May 21, 2021
2 parents 59304d6 + 1f336f7 commit 7ad8f38
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
7 changes: 4 additions & 3 deletions GraphQL.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,15 @@ contexts:
push:
- type-definition
- directives
- type-implements
- implements
- type-name

- match: interface{{name_break}}
scope: keyword.declaration.type.interface.graphql
push:
- type-definition
- directives
- implements
- interface-name

- match: union{{name_break}}
Expand Down Expand Up @@ -361,12 +362,12 @@ contexts:
- include: else-pop
- include: else-pop

type-implements:
implements:
- match: implements{{name_break}}
scope: keyword.declaration.implements.graphql
set:
- - match: '&'
scope: punctuation.separator.sequence.graphql
scope: keyword.operator.graphql
push: type-named
- include: else-pop
- - include: type-named
Expand Down
14 changes: 8 additions & 6 deletions tests/syntax_test_graphql.gql
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@
# ^^^^^^ entity.name.type.object
# ^^^^^^^^^^ keyword.declaration.implements
# ^^^ variable.type support.type
# ^ punctuation.separator.sequence
# ^ keyword.operator
# ^^^^^^ variable.type support.type
# ^ punctuation.definition.annotation
# ^^^^^^^^^^^ variable.function.annotation
Expand Down Expand Up @@ -273,15 +273,17 @@
# ^ meta.block punctuation.section.block.end
type myType implements & Int
# ^ punctuation.separator.sequence
# ^ keyword.operator
# ^^^ variable.type support.type
interface myInterface @myDirective {}
interface myInterface implements ParentIf @myDirective {}
# ^^^^^^^^^ keyword.declaration.type.interface
# ^^^^^^^^^^^ entity.name.type.interface
# ^ punctuation.definition.annotation
# ^^^^^^^^^^^ variable.function.annotation
# ^^ meta.block
# ^^^^^^^^^^ keyword.declaration.implements
# ^^^^^^^^ variable.type
# ^ punctuation.definition.annotation
# ^^^^^^^^^^^ variable.function.annotation
# ^^ meta.block
union myUnion = Int | String
# ^^^^^ keyword.declaration.type.interface
Expand Down

0 comments on commit 7ad8f38

Please sign in to comment.