Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix syntax highlighting for implements with directive #36

Merged

Conversation

jgzuke
Copy link
Contributor

@jgzuke jgzuke commented Oct 20, 2021

type Product implements ProductItf @key(fields: "id") {
  …
}

would previously not follow the pattern "begin": "\\s*\\b(implements)\\b\\s*", "end": "\\s*(?={)", because the implements ProductItf was followed by an ‘@’, not a ‘{’ (which is perfectly valid). This meant this was not getting recognized as an interface.

You might be asking, why do we have our own full grammar defined here when it probably isn't up to date with the spec, there must be a better way 💭 Agree, but let's fix this issue for now 😛

A few other random small cleanups here as well. The first commit is the functional change.

```grqphql
type Product implements ProductItf @key(fields: "id") @key(fields: "sku package") @key(fields: "sku variation { id }") {
  …
}
```
would previously not follow the pattern `"begin": "\\s*\\b(implements)\\b\\s*", "end": "\\s*(?={)",` because the `implements ProductItf` was followed by an ‘@’, not a ‘{’ (which is perfectly valid)
I noticed a few things that bugged me along the journey
@jgzuke jgzuke requested a review from cy October 20, 2021 04:44
Copy link
Contributor

@cy cy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@jgzuke jgzuke merged commit 95a72b9 into main Oct 20, 2021
@jgzuke jgzuke deleted the jgzuke/fix/fix-syntax-highlighting-for-implements-with-directive branch October 20, 2021 17:00
@github-actions github-actions bot mentioned this pull request Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants