diff --git a/packages/vscode-graphql-syntax/tests/__fixtures__/test.js b/packages/vscode-graphql-syntax/tests/__fixtures__/test.js index f392e3cc56..616f41dd27 100644 --- a/packages/vscode-graphql-syntax/tests/__fixtures__/test.js +++ b/packages/vscode-graphql-syntax/tests/__fixtures__/test.js @@ -39,15 +39,15 @@ const graphql = graphql(` const graphql = graphql( ` - query { test } + query($id: ID!) { test } `, [var1, var2] ); const query = /* GraphQL */ 'query { id } '; -const query = graphql('query { id } '); +const query = graphql('query($id: ID!) { id } '); const query = graphql( - 'query { id } ' + 'query($id: ID!) { test }' ); const queryWithInlineComment = `#graphql diff --git a/packages/vscode-graphql-syntax/tests/__snapshots__/js-grammar.spec.ts.snap b/packages/vscode-graphql-syntax/tests/__snapshots__/js-grammar.spec.ts.snap index cedce912e9..901751bf51 100644 --- a/packages/vscode-graphql-syntax/tests/__snapshots__/js-grammar.spec.ts.snap +++ b/packages/vscode-graphql-syntax/tests/__snapshots__/js-grammar.spec.ts.snap @@ -8,7 +8,7 @@ exports[`inline.graphql grammar > should tokenize a simple ecmascript file 1`] = const variable = 'test'; | | gql | entity.name.function.tagged-template.js -\` | punctuation.definition.string.template.begin.js +\` | | meta.embedded.block.graphql query | meta.embedded.block.graphql keyword.operation.graphql | meta.embedded.block.graphql meta.selectionset.graphql @@ -40,7 +40,7 @@ something | meta.embedded.block.graphql meta.select ; | | graphql | entity.name.function.tagged-template.js -\` | punctuation.definition.string.template.begin.js +\` | | meta.embedded.block.graphql query | meta.embedded.block.graphql keyword.operation.graphql | meta.embedded.block.graphql meta.selectionset.graphql @@ -74,7 +74,7 @@ something | meta.embedded.block.graphql meta.select const graphql = | | graphql | entity.name.function.tagged-template.js -\` | punctuation.definition.string.template.begin.js +\` | | meta.embedded.block.graphql query | meta.embedded.block.graphql keyword.operation.graphql | meta.embedded.block.graphql meta.selectionset.graphql @@ -155,6 +155,13 @@ const graphql = graphql | \` | meta.embedded.block.graphql punctuation.definition.string.template.begin.js | meta.embedded.block.graphql query | meta.embedded.block.graphql keyword.operation.graphql +( | meta.embedded.block.graphql meta.brace.round.graphql +$id | meta.embedded.block.graphql meta.variables.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.variables.graphql punctuation.colon.graphql + | meta.embedded.block.graphql meta.variables.graphql +ID | meta.embedded.block.graphql meta.variables.graphql support.type.builtin.graphql +! | meta.embedded.block.graphql meta.variables.graphql keyword.operator.nulltype.graphql +) | meta.embedded.block.graphql meta.brace.round.graphql | meta.embedded.block.graphql meta.selectionset.graphql { | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql | meta.embedded.block.graphql meta.selectionset.graphql @@ -171,8 +178,7 @@ test | meta.embedded.block.graphql meta.select const query = | | /* GraphQL */ | comment.graphql.js - | -' | punctuation.definition.string.template.begin.js + ' | query | meta.embedded.block.graphql keyword.operation.graphql | meta.embedded.block.graphql meta.selectionset.graphql { | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql @@ -187,6 +193,13 @@ const query = graphql | ( | ' | meta.embedded.block.graphql punctuation.definition.string.template.begin.js query | meta.embedded.block.graphql keyword.operation.graphql +( | meta.embedded.block.graphql meta.brace.round.graphql +$id | meta.embedded.block.graphql meta.variables.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.variables.graphql punctuation.colon.graphql + | meta.embedded.block.graphql meta.variables.graphql +ID | meta.embedded.block.graphql meta.variables.graphql support.type.builtin.graphql +! | meta.embedded.block.graphql meta.variables.graphql keyword.operator.nulltype.graphql +) | meta.embedded.block.graphql meta.brace.round.graphql | meta.embedded.block.graphql meta.selectionset.graphql { | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql | meta.embedded.block.graphql meta.selectionset.graphql @@ -202,20 +215,26 @@ const query = graphql | | meta.embedded.block.graphql ' | meta.embedded.block.graphql punctuation.definition.string.template.begin.js query | meta.embedded.block.graphql keyword.operation.graphql +( | meta.embedded.block.graphql meta.brace.round.graphql +$id | meta.embedded.block.graphql meta.variables.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.variables.graphql punctuation.colon.graphql + | meta.embedded.block.graphql meta.variables.graphql +ID | meta.embedded.block.graphql meta.variables.graphql support.type.builtin.graphql +! | meta.embedded.block.graphql meta.variables.graphql keyword.operator.nulltype.graphql +) | meta.embedded.block.graphql meta.brace.round.graphql | meta.embedded.block.graphql meta.selectionset.graphql { | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql | meta.embedded.block.graphql meta.selectionset.graphql -id | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql +test | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql | meta.embedded.block.graphql meta.selectionset.graphql } | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql ' | meta.embedded.block.graphql punctuation.definition.string.template.end.js ) | ; | | const queryWithInlineComment = | -\` | taggedTemplates punctuation.definition.string.template.begin.js -#graphql | taggedTemplates comment.line.graphql.js +\` | taggedTemplates +#graphql | taggedTemplates punctuation.definition.string.template.begin.js | taggedTemplates meta.embedded.block.graphql query | taggedTemplates meta.embedded.block.graphql keyword.operation.graphql | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql @@ -247,8 +266,8 @@ something | taggedTemplates meta.embedded.block.gra ; | | const queryWithInlineComment = | -' | taggedTemplates punctuation.definition.string.template.begin.js -#graphql | taggedTemplates comment.line.graphql.js +' | taggedTemplates +#graphql | taggedTemplates punctuation.definition.string.template.begin.js | taggedTemplates meta.embedded.block.graphql query | taggedTemplates meta.embedded.block.graphql keyword.operation.graphql | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql @@ -262,8 +281,8 @@ id | taggedTemplates meta.embedded.block.gra ; | | const queryWithInlineComment = | -' | taggedTemplates punctuation.definition.string.template.begin.js -#graphql | taggedTemplates comment.line.graphql.js +' | taggedTemplates +#graphql | taggedTemplates punctuation.definition.string.template.begin.js | taggedTemplates meta.embedded.block.graphql query | taggedTemplates meta.embedded.block.graphql keyword.operation.graphql | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql @@ -277,8 +296,8 @@ id | taggedTemplates meta.embedded.block.gra ; | | const queryWithInlineComment = | -\` | taggedTemplates punctuation.definition.string.template.begin.js -#graphql | taggedTemplates comment.line.graphql.js +\` | taggedTemplates +#graphql | taggedTemplates punctuation.definition.string.template.begin.js | taggedTemplates meta.embedded.block.graphql query | taggedTemplates meta.embedded.block.graphql keyword.operation.graphql | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql @@ -320,8 +339,7 @@ const queryWithInlineComment = \` | const queryWithLeadingComment = | | /* GraphQL */ | comment.graphql.js - | -\` | punctuation.definition.string.template.begin.js + \` | | meta.embedded.block.graphql query | meta.embedded.block.graphql keyword.operation.graphql | meta.embedded.block.graphql meta.selectionset.graphql @@ -374,7 +392,7 @@ exports[`inline.graphql grammar > should tokenize a simple svelte file 1`] = ` const query = | | gql | entity.name.function.tagged-template.js -\` | punctuation.definition.string.template.begin.js +\` | | meta.embedded.block.graphql query | meta.embedded.block.graphql keyword.operation.graphql | meta.embedded.block.graphql meta.selectionset.graphql @@ -399,7 +417,7 @@ exports[`inline.graphql grammar > should tokenize a simple typescript file 1`] = // @ts-nocheck | | gql | entity.name.function.tagged-template.js -\` | punctuation.definition.string.template.begin.js +\` | | meta.embedded.block.graphql query | meta.embedded.block.graphql keyword.operation.graphql | meta.embedded.block.graphql meta.selectionset.graphql @@ -431,8 +449,7 @@ something | meta.embedded.block.graphql meta.selectionset. ; | | graphql | entity.name.function.tagged-template.js - | -\` | punctuation.definition.string.template.begin.js +\` | | meta.embedded.block.graphql query | meta.embedded.block.graphql keyword.operation.graphql | meta.embedded.block.graphql meta.selectionset.graphql @@ -466,8 +483,7 @@ something | meta.embedded.block.graphql meta.selectionset. const query = | | graphql | entity.name.function.tagged-template.js - | -\` | punctuation.definition.string.template.begin.js +\` | | meta.embedded.block.graphql query | meta.embedded.block.graphql keyword.operation.graphql | meta.embedded.block.graphql meta.selectionset.graphql @@ -577,8 +593,8 @@ id | meta.embedded.block.graphql meta.selectionset. ; | | const queryWithInlineComment = | -\` | taggedTemplates punctuation.definition.string.template.begin.js -#graphql | taggedTemplates comment.line.graphql.js +\` | taggedTemplates +#graphql | taggedTemplates punctuation.definition.string.template.begin.js | taggedTemplates meta.embedded.block.graphql query | taggedTemplates meta.embedded.block.graphql keyword.operation.graphql | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql @@ -612,8 +628,7 @@ something | taggedTemplates meta.embedded.block.graphql me const queryWithLeadingComment = | | /* GraphQL */ | comment.graphql.js - | -\` | punctuation.definition.string.template.begin.js + \` | | meta.embedded.block.graphql query | meta.embedded.block.graphql keyword.operation.graphql | meta.embedded.block.graphql meta.selectionset.graphql @@ -656,7 +671,7 @@ import { ref } from 'vue'; | const query = | | gql | entity.name.function.tagged-template.js -\` | punctuation.definition.string.template.begin.js +\` | | meta.embedded.block.graphql query | meta.embedded.block.graphql keyword.operation.graphql | meta.embedded.block.graphql meta.selectionset.graphql @@ -682,7 +697,7 @@ exports[`inline.graphql grammar > should tokenize a simple vue sfc file 1`] = ` const query = | | gql | entity.name.function.tagged-template.js -\` | punctuation.definition.string.template.begin.js +\` | | meta.embedded.block.graphql query | meta.embedded.block.graphql keyword.operation.graphql | meta.embedded.block.graphql meta.selectionset.graphql