From 50d8e3cef901023024e107d4d4b1235180360be2 Mon Sep 17 00:00:00 2001 From: Phil Pluckthun Date: Sun, 4 Feb 2024 16:17:37 +0000 Subject: [PATCH] Update snapshots --- .../grammars/graphql.js.json | 12 +++++----- .../tests/__fixtures__/test.js | 6 ++--- .../__snapshots__/js-grammar.spec.ts.snap | 24 +++++++++++++++++-- 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/packages/vscode-graphql-syntax/grammars/graphql.js.json b/packages/vscode-graphql-syntax/grammars/graphql.js.json index d6555b94b3..89704e3049 100644 --- a/packages/vscode-graphql-syntax/grammars/graphql.js.json +++ b/packages/vscode-graphql-syntax/grammars/graphql.js.json @@ -8,8 +8,8 @@ "end": "\\)", "patterns": [ { - "begin": "[`']", - "end": "[`']", + "begin": "(`|')", + "end": "(`|')", "beginCaptures": { "0": { "name": "punctuation.definition.string.template.begin.js" @@ -30,7 +30,7 @@ }, { "contentName": "meta.embedded.block.graphql", - "begin": "\\s*+(?:(?:(?:(Relay)\\??\\.)(QL)|(gql|graphql|graphql\\.experimental)\\s*(?:<.*>)?\\s*)|(/\\* GraphQL \\*/))\\s*[`']", + "begin": "\\s*+(?:(?:(?:(Relay)\\??\\.)(QL)|(gql|graphql|graphql\\.experimental)\\s*(?:<.*>)?\\s*)|(/\\* GraphQL \\*/))\\s*(`|')", "beginCaptures": { "1": { "name": "variable.other.class.js" @@ -48,7 +48,7 @@ "name": "punctuation.definition.string.template.begin.js" } }, - "end": "[`']", + "end": "(`|')", "endCaptures": { "0": { "name": "punctuation.definition.string.template.end.js" @@ -63,7 +63,7 @@ { "name": "taggedTemplates", "contentName": "meta.embedded.block.graphql", - "begin": "[`'](#graphql)", + "begin": "(`|')(#graphql)", "beginCaptures": { "1": { "name": "punctuation.definition.string.template.begin.js" @@ -72,7 +72,7 @@ "name": "comment.line.graphql.js" } }, - "end": "[`']", + "end": "(`|')", "endCaptures": { "0": { "name": "punctuation.definition.string.template.end.js" 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..3921a4178b 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 @@ -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 @@ -187,6 +194,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,13 +216,19 @@ 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 ) | ; |