Skip to content

Commit

Permalink
feature: add fragment arguments syntax highlights (#3019)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjmahone authored Feb 19, 2023
1 parent 65f5176 commit ae43add
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/eighty-rabbits-ring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'vscode-graphql-syntax': minor
---

Adds syntax highlighting for arguments on fragment spreads as well as variable definitions on fragments.
15 changes: 11 additions & 4 deletions packages/vscode-graphql-syntax/grammars/graphql.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,21 @@
},
"graphql-fragment-definition": {
"name": "meta.fragment.graphql",
"begin": "\\s*(?:(\\bfragment\\b)\\s*([_A-Za-z][_0-9A-Za-z]*)?\\s*(?:(\\bon\\b)\\s*([_A-Za-z][_0-9A-Za-z]*)))",
"begin": "\\s*(?:(\\bfragment\\b)\\s*([_A-Za-z][_0-9A-Za-z]*)?)",
"end": "(?<=})",
"captures": {
"1": { "name": "keyword.fragment.graphql" },
"2": { "name": "entity.name.fragment.graphql" },
"3": { "name": "keyword.on.graphql" },
"4": { "name": "support.type.graphql" }
"2": { "name": "entity.name.fragment.graphql" }
},
"patterns": [
{
"match": "\\s*(?:(\\bon\\b)\\s*([_A-Za-z][_0-9A-Za-z]*))",
"captures": {
"1": { "name": "keyword.on.graphql" },
"2": { "name": "support.type.graphql" }
}
},
{ "include": "#graphql-variable-definitions" },
{ "include": "#graphql-comment" },
{ "include": "#graphql-description-docstring" },
{ "include": "#graphql-description-singleline" },
Expand Down Expand Up @@ -487,6 +493,7 @@
"2": { "name": "variable.fragment.graphql" }
},
"patterns": [
{ "include": "#graphql-arguments" },
{ "include": "#graphql-comment" },
{ "include": "#graphql-description-docstring" },
{ "include": "#graphql-description-singleline" },
Expand Down

0 comments on commit ae43add

Please sign in to comment.