jparise / vim-graphql

A Vim plugin that provides GraphQL file detection, syntax highlighting, and indentation.
MIT License
487 stars 25 forks source link

Use base syntax groups for templates boundaries #64

Closed jparise closed 3 years ago

jparise commented 3 years ago

In order to match GraphQL syntax inside of template strings, we recreate the JavaScript/TypeScript template string syntax regions and embed our syntax within them. These region's 'start' and 'end' patterns were therefore being matched using our syntax groups.

Instead, use 'matchgroup=' to explicitly match the boundaries using the base syntax's groups. This better integrates with those filetype's natural syntax and indentation definitions while still giving us control over the embedded GraphQL syntax.