From d0098cecceeef8ee44a4ec7f6085b33314661f1f Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Fri, 18 Oct 2024 14:49:59 +0200 Subject: [PATCH 01/34] minimal changes to inject new grammar into directives --- package.json | 7 +++++++ syntaxes/graphql.connectors.json | 13 +++++++++++++ syntaxes/graphql.json | 9 ++++++++- 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 syntaxes/graphql.connectors.json diff --git a/package.json b/package.json index 9a5cd781..ef739da6 100644 --- a/package.json +++ b/package.json @@ -167,6 +167,13 @@ "scopeName": "source.graphql", "path": "./syntaxes/graphql.json" }, + { + "injectTo": [ + "source.graphql" + ], + "scopeName": "inline.connectors.graphql", + "path": "./syntaxes/graphql.connectors.json" + }, { "injectTo": [ "source.js", diff --git a/syntaxes/graphql.connectors.json b/syntaxes/graphql.connectors.json new file mode 100644 index 00000000..cba7d708 --- /dev/null +++ b/syntaxes/graphql.connectors.json @@ -0,0 +1,13 @@ +{ + "scopeName": "inline.connectors.graphql", + "injectionSelector": "L:meta.embedded.block.directive.graphql", + "patterns": [{ "include": "#graphql-connect-directive" }], + "repository": { + "graphql-connect-directive": { + "match": "(@connect)", + "captures": { + "1": { "name": "entity.name.function.directive.connect.graphql" } + } + } + } +} diff --git a/syntaxes/graphql.json b/syntaxes/graphql.json index de56ba1f..f5972b33 100644 --- a/syntaxes/graphql.json +++ b/syntaxes/graphql.json @@ -342,7 +342,14 @@ } }, "graphql-directive": { - "begin": "\\s*((@)\\s*([_A-Za-z][_0-9A-Za-z]*))", + "contentName": "meta.embedded.block.directive.graphql", + "begin": "\\s*(?=@)", + "end": "(?=.)", + "applyEndPatternLast": 1, + "patterns": [{ "include": "#graphql-directive-body" }] + }, + "graphql-directive-body": { + "begin": "((@)\\s*([_A-Za-z][_0-9A-Za-z]*))", "end": "(?=.)", "applyEndPatternLast": 1, "beginCaptures": { From 2637e5c763493e702dd683b85dee7730502597d4 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Fri, 18 Oct 2024 15:27:35 +0200 Subject: [PATCH 02/34] minimal (wrong) syntax highlighting for body & selection --- syntaxes/graphql.connectors.json | 106 +++++++++++++++++++++++++++++-- syntaxes/graphql.json | 33 +++++----- 2 files changed, 116 insertions(+), 23 deletions(-) diff --git a/syntaxes/graphql.connectors.json b/syntaxes/graphql.connectors.json index cba7d708..bbf6d1a3 100644 --- a/syntaxes/graphql.connectors.json +++ b/syntaxes/graphql.connectors.json @@ -1,13 +1,105 @@ { "scopeName": "inline.connectors.graphql", - "injectionSelector": "L:meta.embedded.block.directive.graphql", - "patterns": [{ "include": "#graphql-connect-directive" }], + "injectionSelector": "L:meta.embedded.block.directive.graphql -string -comment", + "patterns": [{ "include": "#connect-directive" }], "repository": { - "graphql-connect-directive": { - "match": "(@connect)", - "captures": { - "1": { "name": "entity.name.function.directive.connect.graphql" } - } + "connect-directive": { + "begin": "((@)\\s*(connect))", + "end": "(?=.)", + "applyEndPatternLast": 1, + "beginCaptures": { + "1": { + "name": "entity.name.function.directive.connect.graphql" + } + }, + "patterns": [ + { "include": "#connect-arguments" }, + { "include": "source.graphql#graphql-comment" }, + { "include": "source.graphql#literal-quasi-embedded" }, + { "include": "source.graphql#graphql-skip-newlines" } + ] + }, + "connect-arguments": { + "name": "meta.arguments.connect.graphql", + "begin": "\\s*(\\()", + "end": "\\s*(\\))", + "beginCaptures": { + "1": { "name": "meta.brace.round.directive.graphql" } + }, + "endCaptures": { + "1": { "name": "meta.brace.round.directive.graphql" } + }, + "patterns": [ + { "include": "source.graphql#graphql-comment" }, + { "include": "#connect-selection-argument" }, + { "include": "#connect-body-argument" }, + { "include": "source.graphql#graphql-argument" }, + { "include": "source.graphql#literal-quasi-embedded" } + ] + }, + "connect-selection-argument": { + "begin": "\\s*(selection)(?:\\s*(:))", + "end": "(?=\\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\\s*(:))|\\)))|\\s*(,)", + "beginCaptures": { + "1": { "name": "variable.parameter.graphql" }, + "2": { "name": "punctuation.colon.graphql" } + }, + "endCaptures": { + "3": { "name": "punctuation.comma.graphql" } + }, + "patterns": [ + { + "begin": "\\s*+((\"))", + "end": "\\s*+(?:((\"))|(\n))", + "beginCaptures": { + "1": { "name": "string.quoted.double.graphql" }, + "2": { "name": "punctuation.definition.string.begin.graphql" } + }, + "endCaptures": { + "1": { "name": "string.quoted.double.graphql" }, + "2": { "name": "punctuation.definition.string.end.graphql" }, + "3": { "name": "invalid.illegal.newline.graphql" } + }, + "patterns": [ + { "include": "source.graphql#graphql-field" }, + { "include": "source.graphql#graphql-comma" } + ] + }, + { "include": "source.graphql#graphql-comment" }, + { "include": "source.graphql#graphql-skip-newlines" } + ] + }, + "connect-body-argument": { + "begin": "\\s*(selection)(?:\\s*(:))", + "end": "(?=\\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\\s*(:))|\\)))|\\s*(,)", + "beginCaptures": { + "1": { "name": "variable.parameter.graphql" }, + "2": { "name": "punctuation.colon.graphql" } + }, + "endCaptures": { + "3": { "name": "punctuation.comma.graphql" } + }, + "patterns": [ + { + "begin": "\\s*+((\"))", + "end": "\\s*+(?:((\"))|(\n))", + "beginCaptures": { + "1": { "name": "string.quoted.double.graphql" }, + "2": { "name": "punctuation.definition.string.begin.graphql" } + }, + "endCaptures": { + "1": { "name": "string.quoted.double.graphql" }, + "2": { "name": "punctuation.definition.string.end.graphql" }, + "3": { "name": "invalid.illegal.newline.graphql" } + }, + "patterns": [ + { "include": "source.graphql#graphql-field" }, + { "include": "source.graphql#graphql-comma" } + ] + }, + { "include": "source.graphql#graphql-comment" }, + { "include": "source.graphql#graphql-skip-newlines" } + ] } } } diff --git a/syntaxes/graphql.json b/syntaxes/graphql.json index f5972b33..0c247798 100644 --- a/syntaxes/graphql.json +++ b/syntaxes/graphql.json @@ -449,25 +449,26 @@ }, "patterns": [ { "include": "#graphql-comment" }, - { - "begin": "\\s*([_A-Za-z][_0-9A-Za-z]*)(?:\\s*(:))", - "end": "(?=\\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\\s*(:))|\\)))|\\s*(,)", - "beginCaptures": { - "1": { "name": "variable.parameter.graphql" }, - "2": { "name": "punctuation.colon.graphql" } - }, - "endCaptures": { - "3": { "name": "punctuation.comma.graphql" } - }, - "patterns": [ - { "include": "#graphql-value" }, - { "include": "#graphql-comment" }, - { "include": "#graphql-skip-newlines" } - ] - }, + { "include": "#graphql-argument" }, { "include": "#literal-quasi-embedded" } ] }, + "graphql-argument": { + "begin": "\\s*([_A-Za-z][_0-9A-Za-z]*)(?:\\s*(:))", + "end": "(?=\\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\\s*(:))|\\)))|\\s*(,)", + "beginCaptures": { + "1": { "name": "variable.parameter.graphql" }, + "2": { "name": "punctuation.colon.graphql" } + }, + "endCaptures": { + "3": { "name": "punctuation.comma.graphql" } + }, + "patterns": [ + { "include": "#graphql-value" }, + { "include": "#graphql-comment" }, + { "include": "#graphql-skip-newlines" } + ] + }, "graphql-variable-name": { "match": "\\s*(\\$[_A-Za-z][_0-9A-Za-z]*)", "captures": { From 1ae420300b8c7c1fee6c200b1f1103f9ebf20d3f Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Fri, 18 Oct 2024 15:52:17 +0200 Subject: [PATCH 03/34] body... --- syntaxes/graphql.connectors.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/graphql.connectors.json b/syntaxes/graphql.connectors.json index bbf6d1a3..a9778bab 100644 --- a/syntaxes/graphql.connectors.json +++ b/syntaxes/graphql.connectors.json @@ -70,7 +70,7 @@ ] }, "connect-body-argument": { - "begin": "\\s*(selection)(?:\\s*(:))", + "begin": "\\s*(body)(?:\\s*(:))", "end": "(?=\\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\\s*(:))|\\)))|\\s*(,)", "beginCaptures": { "1": { "name": "variable.parameter.graphql" }, From 5e7f3dd0ff7cac1f23dfcfbe4a1ee52cde29164a Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Fri, 18 Oct 2024 17:42:04 +0200 Subject: [PATCH 04/34] first attempt at jsonselection textmate grammar --- syntaxes/connectors.jsonselection.yaml | 126 +++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 syntaxes/connectors.jsonselection.yaml diff --git a/syntaxes/connectors.jsonselection.yaml b/syntaxes/connectors.jsonselection.yaml new file mode 100644 index 00000000..acd3d19c --- /dev/null +++ b/syntaxes/connectors.jsonselection.yaml @@ -0,0 +1,126 @@ +name: "GraphQL" +scopeName: "source.connectors.jsonselection" +patterns: + - include: "#JSONSelection" +repository: + # JSONSelection ::= NakedSubSelection | PathSelection + JSONSelection: + patterns: + - include: "#NakedSubSelection" + - include: "#PathSelection" + # NakedSubSelection ::= NamedSelection* StarSelection? + NakedSubSelection: + patterns: + - include: "#NamedSelection" + - include: "#StarSelection" + # SubSelection ::= "{" NakedSubSelection "}" + SubSelection: + begin: "\\{" + end: "\\}" + patterns: + - include: "#NakedSubSelection" + # NamedSelection ::= NamedPathSelection | NamedFieldSelection | NamedQuotedSelection | NamedGroupSelection + NamedSelection: + patterns: + - include: "#NamedFieldSelection" + - include: "#NamedQuotedSelection" + - include: "#NamedPathOrGroupSelection" + # NamedPathSelection ::= Alias PathSelection + # merged with NamedGroupSelection + # NamedFieldSelection ::= Alias? Identifier SubSelection? + NamedFieldSelection: + begin: "([a-zA-Z][0-9a-zA-Z_]*(:))?\\s*([a-zA-Z][0-9a-zA-Z_]*)" + patterns: + - include: "#SubSelection" + # NamedQuotedSelection ::= Alias StringLiteral SubSelection? + NamedQuotedSelection: + begin: "([a-zA-Z][0-9a-zA-Z_]*(:)\\s*(\"[^\"]*\"|'[^']*'))" + patterns: + - include: "#SubSelection" + # NamedGroupSelection ::= Alias SubSelection + NamedPathOrGroupSelection: + begin: "([a-zA-Z][0-9a-zA-Z_]*(:)" + patterns: + - include: "#SubSelection" + - include: "#PathSelection" + # Alias ::= Identifier ":" + # PathSelection ::= (VarPath | KeyPath) SubSelection? + PathSelection: + patterns: + - include: "#VarPathWithSubSelection" + - include: "#KeyPathWithSubSelection" + # VarPath ::= "$" (NO_SPACE Identifier)? PathStep* + VarPathWithSubSelection: + begin: "\\$([a-zA-Z][0-9a-zA-Z_]*)?" + patterns: + - include: "#PathStep" + - include: "#SubSelection" + # KeyPath ::= Key PathStep+ + KeyPathWithSubSelection: + begin: "([a-zA-Z][0-9a-zA-Z_]*|\"[^\"]*\"|'[^']*')\\s*" + patterns: + - include: "#PathStep" + - include: "#SubSelection" + # PathStep ::= "." Key | "->" Identifier MethodArgs? + PathStep: + patterns: + - match: "\\.([a-zA-Z][0-9a-zA-Z_]*|\"[^\"]*\"|'[^']*')" + - match: "->([a-zA-Z][0-9a-zA-Z_]*)" + patterns: + - include: "#MethodArgs" + # Key ::= Identifier | StringLiteral + # Identifier ::= [a-zA-Z_] NO_SPACE [0-9a-zA-Z_]* + # StringLiteral ::= "'" ("\\'" | [^'])* "'" | '"' ('\\"' | [^"])* '"' + # MethodArgs ::= "(" (JSLiteral ("," JSLiteral)*)? ")" + MethodArgs: + begin: "\\(" + end: "\\)" + patterns: + - end: ",|(?=\\))" + patterns: + - include: "#JSLiteral" + # JSLiteral ::= JSPrimitive | JSObject | JSArray | PathSelection + JSLiteral: + patterns: + - include: "#JSPrimitive" + - include: "#JSObject" + - include: "#JSArray" + - include: "#PathSelection" + # JSPrimitive ::= StringLiteral | JSNumber | "true" | "false" | "null" + JSPrimitive: + patterns: + - match: '"[^"]*"|''[^'']*''' + - match: "-?(0|[1-9][0-9]*)(\\.[0-9]*)?" + - match: "\\b(true|false|null)\\b" + # JSNumber ::= "-"? (UnsignedInt ("." [0-9]*)? | "." [0-9]+) + # UnsignedInt ::= "0" | [1-9] NO_SPACE [0-9]* + # JSObject ::= "{" (JSProperty ("," JSProperty)*)? "}" + JSObject: + begin: "\\{" + end: "\\}" + patterns: + - end: ",|(?=\\})" + patterns: + - include: "#JSProperty" + # JSProperty ::= Key ":" JSLiteral + JSProperty: + begin: "([a-zA-Z][0-9a-zA-Z_]*|\"[^\"]*\"|'[^']*')\\s*:" + patterns: + - include: "#JSLiteral" + # JSArray ::= "[" (JSLiteral ("," JSLiteral)*)? "]" + JSArray: + begin: "\\[" + end: "\\]" + patterns: + - end: ",|(?=\\])" + patterns: + - include: "#JSLiteral" + # StarSelection ::= Alias? "*" SubSelection? + StarSelection: + begin: "([a-zA-Z][0-9a-zA-Z_]*(:))?\\s*\\*" + patterns: + - include: "#SubSelection" + # NO_SPACE ::= !SpacesOrComments + # SpacesOrComments ::= (Spaces | Comment)+ + # Spaces ::= (" " | "\t" | "\r" | "\n")+ + # Comment ::= "#" [^\n]* From 839a650030e2127f44cee8dc381997b836af013b Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Fri, 18 Oct 2024 18:28:17 +0200 Subject: [PATCH 05/34] injection not working yet --- package.json | 7 + syntaxes/connectors.jsonselection.json | 233 +++++++++++++++++++++++++ syntaxes/connectors.jsonselection.yaml | 27 ++- syntaxes/graphql.connectors.json | 53 +----- 4 files changed, 272 insertions(+), 48 deletions(-) create mode 100644 syntaxes/connectors.jsonselection.json diff --git a/package.json b/package.json index ef739da6..c22565e2 100644 --- a/package.json +++ b/package.json @@ -174,6 +174,13 @@ "scopeName": "inline.connectors.graphql", "path": "./syntaxes/graphql.connectors.json" }, + { + "injectTo": [ + "source.graphql" + ], + "scopeName": "inline.connectors.jsonselection.graphql", + "path": "./syntaxes/connectors.jsonselection.json" + }, { "injectTo": [ "source.js", diff --git a/syntaxes/connectors.jsonselection.json b/syntaxes/connectors.jsonselection.json new file mode 100644 index 00000000..96a36b00 --- /dev/null +++ b/syntaxes/connectors.jsonselection.json @@ -0,0 +1,233 @@ +{ + "name": "Apollo Connectors JSONSelection", + "scopeName": "inline.connectors.jsonselection.graphql", + "injectionSelector": "L:meta.embedded.block.jsonselection.graphql -string -comment", + "patterns": [ + { + "include": "#JSONSelection" + } + ], + "repository": { + "JSONSelection": { + "name": "meta.JSONSelection", + "patterns": [ + { + "include": "#NakedSubSelection" + }, + { + "include": "#PathSelection" + } + ] + }, + "NakedSubSelection": { + "name": "meta.NakedSubSelection", + "patterns": [ + { + "include": "#NamedSelection" + }, + { + "include": "#StarSelection" + } + ] + }, + "SubSelection": { + "name": "meta.SubSelection", + "begin": "\\{", + "end": "\\}", + "patterns": [ + { + "include": "#NakedSubSelection" + } + ] + }, + "NamedSelection": { + "name": "meta.NamedSelection", + "patterns": [ + { + "include": "#NamedFieldSelection" + }, + { + "include": "#NamedQuotedSelection" + }, + { + "include": "#NamedPathOrGroupSelection" + } + ] + }, + "NamedFieldSelection": { + "name": "meta.NamedFieldSelection", + "begin": "([a-zA-Z][0-9a-zA-Z_]*(:))?\\s*([a-zA-Z][0-9a-zA-Z_]*)", + "patterns": [ + { + "include": "#SubSelection" + } + ] + }, + "NamedQuotedSelection": { + "name": "meta.NamedQuotedSelection", + "begin": "([a-zA-Z][0-9a-zA-Z_]*(:)\\s*(\"[^\"]*\"|'[^']*'))", + "patterns": [ + { + "include": "#SubSelection" + } + ] + }, + "NamedPathOrGroupSelection": { + "name": "meta.NamedPathOrGroupSelection", + "begin": "([a-zA-Z][0-9a-zA-Z_]*(:)", + "patterns": [ + { + "include": "#SubSelection" + }, + { + "include": "#PathSelection" + } + ] + }, + "PathSelection": { + "name": "meta.PathSelection", + "patterns": [ + { + "include": "#VarPathWithSubSelection" + }, + { + "include": "#KeyPathWithSubSelection" + } + ] + }, + "VarPathWithSubSelection": { + "name": "meta.VarPathWithSubSelection", + "begin": "\\$([a-zA-Z][0-9a-zA-Z_]*)?", + "patterns": [ + { + "include": "#PathStep" + }, + { + "include": "#SubSelection" + } + ] + }, + "KeyPathWithSubSelection": { + "name": "meta.KeyPathWithSubSelection", + "begin": "([a-zA-Z][0-9a-zA-Z_]*|\"[^\"]*\"|'[^']*')\\s*", + "patterns": [ + { + "include": "#PathStep" + }, + { + "include": "#SubSelection" + } + ] + }, + "PathStep": { + "name": "meta.PathStep", + "patterns": [ + { + "match": "\\.([a-zA-Z][0-9a-zA-Z_]*|\"[^\"]*\"|'[^']*')" + }, + { + "match": "->([a-zA-Z][0-9a-zA-Z_]*)", + "patterns": [ + { + "include": "#MethodArgs" + } + ] + } + ] + }, + "MethodArgs": { + "name": "meta.MethodArgs", + "begin": "\\(", + "end": "\\)", + "patterns": [ + { + "end": ",|(?=\\))", + "patterns": [ + { + "include": "#JSLiteral" + } + ] + } + ] + }, + "JSLiteral": { + "name": "meta.JSLiteral", + "patterns": [ + { + "include": "#JSPrimitive" + }, + { + "include": "#JSObject" + }, + { + "include": "#JSArray" + }, + { + "include": "#PathSelection" + } + ] + }, + "JSPrimitive": { + "name": "meta.JSPrimitive", + "patterns": [ + { + "match": "\"[^\"]*\"|'[^']*'" + }, + { + "match": "-?(0|[1-9][0-9]*)(\\.[0-9]*)?" + }, + { + "match": "true|false|null" + } + ] + }, + "JSObject": { + "name": "meta.JSObject", + "begin": "\\{", + "end": "\\}", + "patterns": [ + { + "end": ",|(?=\\})", + "patterns": [ + { + "include": "#JSProperty" + } + ] + } + ] + }, + "JSProperty": { + "name": "meta.JSProperty", + "begin": "([a-zA-Z][0-9a-zA-Z_]*|\"[^\"]*\"|'[^']*')\\s*:", + "patterns": [ + { + "include": "#JSLiteral" + } + ] + }, + "JSArray": { + "name": "meta.JSArray", + "begin": "\\[", + "end": "\\]", + "patterns": [ + { + "end": ",|(?=\\])", + "patterns": [ + { + "include": "#JSLiteral" + } + ] + } + ] + }, + "StarSelection": { + "name": "meta.StarSelection", + "begin": "([a-zA-Z][0-9a-zA-Z_]*(:))?\\s*\\*", + "patterns": [ + { + "include": "#SubSelection" + } + ] + } + } +} diff --git a/syntaxes/connectors.jsonselection.yaml b/syntaxes/connectors.jsonselection.yaml index acd3d19c..7d8a06d3 100644 --- a/syntaxes/connectors.jsonselection.yaml +++ b/syntaxes/connectors.jsonselection.yaml @@ -1,26 +1,33 @@ -name: "GraphQL" -scopeName: "source.connectors.jsonselection" +# use 'js-yaml' to convert to json +# npx js-yaml syntaxes/connectors.jsonselection.yaml >| syntaxes/connectors.jsonselection.json +name: "Apollo Connectors JSONSelection" +scopeName: "inline.connectors.jsonselection.graphql" +injectionSelector: "L:meta.embedded.block.jsonselection.graphql -string -comment" patterns: - include: "#JSONSelection" repository: # JSONSelection ::= NakedSubSelection | PathSelection JSONSelection: + name: "meta.JSONSelection" patterns: - include: "#NakedSubSelection" - include: "#PathSelection" # NakedSubSelection ::= NamedSelection* StarSelection? NakedSubSelection: + name: "meta.NakedSubSelection" patterns: - include: "#NamedSelection" - include: "#StarSelection" # SubSelection ::= "{" NakedSubSelection "}" SubSelection: + name: "meta.SubSelection" begin: "\\{" end: "\\}" patterns: - include: "#NakedSubSelection" # NamedSelection ::= NamedPathSelection | NamedFieldSelection | NamedQuotedSelection | NamedGroupSelection NamedSelection: + name: "meta.NamedSelection" patterns: - include: "#NamedFieldSelection" - include: "#NamedQuotedSelection" @@ -29,16 +36,19 @@ repository: # merged with NamedGroupSelection # NamedFieldSelection ::= Alias? Identifier SubSelection? NamedFieldSelection: + name: "meta.NamedFieldSelection" begin: "([a-zA-Z][0-9a-zA-Z_]*(:))?\\s*([a-zA-Z][0-9a-zA-Z_]*)" patterns: - include: "#SubSelection" # NamedQuotedSelection ::= Alias StringLiteral SubSelection? NamedQuotedSelection: + name: "meta.NamedQuotedSelection" begin: "([a-zA-Z][0-9a-zA-Z_]*(:)\\s*(\"[^\"]*\"|'[^']*'))" patterns: - include: "#SubSelection" # NamedGroupSelection ::= Alias SubSelection NamedPathOrGroupSelection: + name: "meta.NamedPathOrGroupSelection" begin: "([a-zA-Z][0-9a-zA-Z_]*(:)" patterns: - include: "#SubSelection" @@ -46,23 +56,27 @@ repository: # Alias ::= Identifier ":" # PathSelection ::= (VarPath | KeyPath) SubSelection? PathSelection: + name: "meta.PathSelection" patterns: - include: "#VarPathWithSubSelection" - include: "#KeyPathWithSubSelection" # VarPath ::= "$" (NO_SPACE Identifier)? PathStep* VarPathWithSubSelection: + name: "meta.VarPathWithSubSelection" begin: "\\$([a-zA-Z][0-9a-zA-Z_]*)?" patterns: - include: "#PathStep" - include: "#SubSelection" # KeyPath ::= Key PathStep+ KeyPathWithSubSelection: + name: "meta.KeyPathWithSubSelection" begin: "([a-zA-Z][0-9a-zA-Z_]*|\"[^\"]*\"|'[^']*')\\s*" patterns: - include: "#PathStep" - include: "#SubSelection" # PathStep ::= "." Key | "->" Identifier MethodArgs? PathStep: + name: "meta.PathStep" patterns: - match: "\\.([a-zA-Z][0-9a-zA-Z_]*|\"[^\"]*\"|'[^']*')" - match: "->([a-zA-Z][0-9a-zA-Z_]*)" @@ -73,6 +87,7 @@ repository: # StringLiteral ::= "'" ("\\'" | [^'])* "'" | '"' ('\\"' | [^"])* '"' # MethodArgs ::= "(" (JSLiteral ("," JSLiteral)*)? ")" MethodArgs: + name: "meta.MethodArgs" begin: "\\(" end: "\\)" patterns: @@ -81,6 +96,7 @@ repository: - include: "#JSLiteral" # JSLiteral ::= JSPrimitive | JSObject | JSArray | PathSelection JSLiteral: + name: "meta.JSLiteral" patterns: - include: "#JSPrimitive" - include: "#JSObject" @@ -88,14 +104,16 @@ repository: - include: "#PathSelection" # JSPrimitive ::= StringLiteral | JSNumber | "true" | "false" | "null" JSPrimitive: + name: "meta.JSPrimitive" patterns: - match: '"[^"]*"|''[^'']*''' - match: "-?(0|[1-9][0-9]*)(\\.[0-9]*)?" - - match: "\\b(true|false|null)\\b" + - match: "true|false|null" # JSNumber ::= "-"? (UnsignedInt ("." [0-9]*)? | "." [0-9]+) # UnsignedInt ::= "0" | [1-9] NO_SPACE [0-9]* # JSObject ::= "{" (JSProperty ("," JSProperty)*)? "}" JSObject: + name: "meta.JSObject" begin: "\\{" end: "\\}" patterns: @@ -104,11 +122,13 @@ repository: - include: "#JSProperty" # JSProperty ::= Key ":" JSLiteral JSProperty: + name: "meta.JSProperty" begin: "([a-zA-Z][0-9a-zA-Z_]*|\"[^\"]*\"|'[^']*')\\s*:" patterns: - include: "#JSLiteral" # JSArray ::= "[" (JSLiteral ("," JSLiteral)*)? "]" JSArray: + name: "meta.JSArray" begin: "\\[" end: "\\]" patterns: @@ -117,6 +137,7 @@ repository: - include: "#JSLiteral" # StarSelection ::= Alias? "*" SubSelection? StarSelection: + name: "meta.StarSelection" begin: "([a-zA-Z][0-9a-zA-Z_]*(:))?\\s*\\*" patterns: - include: "#SubSelection" diff --git a/syntaxes/graphql.connectors.json b/syntaxes/graphql.connectors.json index a9778bab..65cedff1 100644 --- a/syntaxes/graphql.connectors.json +++ b/syntaxes/graphql.connectors.json @@ -31,13 +31,13 @@ }, "patterns": [ { "include": "source.graphql#graphql-comment" }, - { "include": "#connect-selection-argument" }, - { "include": "#connect-body-argument" }, + { "include": "#connect-jsonselection-argument" }, { "include": "source.graphql#graphql-argument" }, { "include": "source.graphql#literal-quasi-embedded" } ] }, - "connect-selection-argument": { + "connect-jsonselection-argument": { + "name": "meta.argument.connect.jsonselection.graphql", "begin": "\\s*(selection)(?:\\s*(:))", "end": "(?=\\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\\s*(:))|\\)))|\\s*(,)", "beginCaptures": { @@ -49,55 +49,18 @@ }, "patterns": [ { - "begin": "\\s*+((\"))", - "end": "\\s*+(?:((\"))|(\n))", + "contentName": "meta.embedded.block.jsonselection.graphql", + "begin": "((\"\"\"))", + "end": "((\"\"\"))", "beginCaptures": { "1": { "name": "string.quoted.double.graphql" }, "2": { "name": "punctuation.definition.string.begin.graphql" } }, "endCaptures": { "1": { "name": "string.quoted.double.graphql" }, - "2": { "name": "punctuation.definition.string.end.graphql" }, - "3": { "name": "invalid.illegal.newline.graphql" } - }, - "patterns": [ - { "include": "source.graphql#graphql-field" }, - { "include": "source.graphql#graphql-comma" } - ] - }, - { "include": "source.graphql#graphql-comment" }, - { "include": "source.graphql#graphql-skip-newlines" } - ] - }, - "connect-body-argument": { - "begin": "\\s*(body)(?:\\s*(:))", - "end": "(?=\\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\\s*(:))|\\)))|\\s*(,)", - "beginCaptures": { - "1": { "name": "variable.parameter.graphql" }, - "2": { "name": "punctuation.colon.graphql" } - }, - "endCaptures": { - "3": { "name": "punctuation.comma.graphql" } - }, - "patterns": [ - { - "begin": "\\s*+((\"))", - "end": "\\s*+(?:((\"))|(\n))", - "beginCaptures": { - "1": { "name": "string.quoted.double.graphql" }, - "2": { "name": "punctuation.definition.string.begin.graphql" } - }, - "endCaptures": { - "1": { "name": "string.quoted.double.graphql" }, - "2": { "name": "punctuation.definition.string.end.graphql" }, - "3": { "name": "invalid.illegal.newline.graphql" } - }, - "patterns": [ - { "include": "source.graphql#graphql-field" }, - { "include": "source.graphql#graphql-comma" } - ] + "2": { "name": "punctuation.definition.string.end.graphql" } + } }, - { "include": "source.graphql#graphql-comment" }, { "include": "source.graphql#graphql-skip-newlines" } ] } From 53c4a31b8077dd228b83fe0a46dad6a573224662 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Wed, 23 Oct 2024 17:01:57 +0200 Subject: [PATCH 06/34] embed jsonselection as language --- apollo.jsonselection.configuration.json | 9 ++++++++ package.json | 22 +++++++++++++------ .../rover/src/test.apollo.jsonselection | 5 +++++ syntaxes/connectors.jsonselection.json | 11 +++------- syntaxes/graphql.connectors.json | 7 +++++- 5 files changed, 38 insertions(+), 16 deletions(-) create mode 100644 apollo.jsonselection.configuration.json create mode 100644 sampleWorkspace/rover/src/test.apollo.jsonselection diff --git a/apollo.jsonselection.configuration.json b/apollo.jsonselection.configuration.json new file mode 100644 index 00000000..8957d6f3 --- /dev/null +++ b/apollo.jsonselection.configuration.json @@ -0,0 +1,9 @@ +{ + "comments": { + "lineComment": "#" + }, + "brackets": [ + ["{", "}"], + ["(", ")"] + ] +} diff --git a/package.json b/package.json index c22565e2..e94e600f 100644 --- a/package.json +++ b/package.json @@ -154,6 +154,13 @@ ], "configuration": "./graphql.configuration.json" }, + { + "id": "apollo.jsonselection", + "filenames": [ + "test.apollo.jsonselection" + ], + "configuration": "./apollo.jsonselection.configuration.json" + }, { "id": "jsonc", "filenames": [ @@ -168,18 +175,19 @@ "path": "./syntaxes/graphql.json" }, { - "injectTo": [ - "source.graphql" - ], - "scopeName": "inline.connectors.graphql", - "path": "./syntaxes/graphql.connectors.json" + "language": "apollo.jsonselection", + "scopeName": "source.apollo.jsonselection", + "path": "./syntaxes/connectors.jsonselection.json" }, { "injectTo": [ "source.graphql" ], - "scopeName": "inline.connectors.jsonselection.graphql", - "path": "./syntaxes/connectors.jsonselection.json" + "scopeName": "inline.connectors.graphql", + "path": "./syntaxes/graphql.connectors.json", + "embeddedLanguages": { + "meta.embedded.block.jsonselection.graphql": "apollo.jsonselection" + } }, { "injectTo": [ diff --git a/sampleWorkspace/rover/src/test.apollo.jsonselection b/sampleWorkspace/rover/src/test.apollo.jsonselection new file mode 100644 index 00000000..f77142e5 --- /dev/null +++ b/sampleWorkspace/rover/src/test.apollo.jsonselection @@ -0,0 +1,5 @@ +aasd +{ + foo +} +qwe diff --git a/syntaxes/connectors.jsonselection.json b/syntaxes/connectors.jsonselection.json index 96a36b00..15f23170 100644 --- a/syntaxes/connectors.jsonselection.json +++ b/syntaxes/connectors.jsonselection.json @@ -1,7 +1,6 @@ { "name": "Apollo Connectors JSONSelection", - "scopeName": "inline.connectors.jsonselection.graphql", - "injectionSelector": "L:meta.embedded.block.jsonselection.graphql -string -comment", + "scopeName": "source.apollo.jsonselection", "patterns": [ { "include": "#JSONSelection" @@ -11,12 +10,8 @@ "JSONSelection": { "name": "meta.JSONSelection", "patterns": [ - { - "include": "#NakedSubSelection" - }, - { - "include": "#PathSelection" - } + { "include": "SubSelection" }, + { "include": "source.graphql#graphql-selection-set" } ] }, "NakedSubSelection": { diff --git a/syntaxes/graphql.connectors.json b/syntaxes/graphql.connectors.json index 65cedff1..dbd3581f 100644 --- a/syntaxes/graphql.connectors.json +++ b/syntaxes/graphql.connectors.json @@ -59,7 +59,12 @@ "endCaptures": { "1": { "name": "string.quoted.double.graphql" }, "2": { "name": "punctuation.definition.string.end.graphql" } - } + }, + "patterns": [ + { + "include": "source.apollo.jsonselection" + } + ] }, { "include": "source.graphql#graphql-skip-newlines" } ] From e4c6c8762d5b570f9cb4a158ef07fc6e4699cb4d Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Wed, 23 Oct 2024 20:10:13 +0200 Subject: [PATCH 07/34] some minor highlighting --- .../rover/src/test.apollo.jsonselection | 15 ++++-- syntaxes/connectors.jsonselection.json | 47 ++++++++++++++----- syntaxes/connectors.jsonselection.yaml | 32 +++++++++---- 3 files changed, 69 insertions(+), 25 deletions(-) diff --git a/sampleWorkspace/rover/src/test.apollo.jsonselection b/sampleWorkspace/rover/src/test.apollo.jsonselection index f77142e5..7dac897f 100644 --- a/sampleWorkspace/rover/src/test.apollo.jsonselection +++ b/sampleWorkspace/rover/src/test.apollo.jsonselection @@ -1,5 +1,10 @@ -aasd -{ - foo -} -qwe +foo: bar + $.results { + id + name + } + listing: { + title: $args.input.title + costPerNight: $args.input.costPerNight + numOfBeds: $args.input.numOfBeds + } diff --git a/syntaxes/connectors.jsonselection.json b/syntaxes/connectors.jsonselection.json index 15f23170..9d896ef8 100644 --- a/syntaxes/connectors.jsonselection.json +++ b/syntaxes/connectors.jsonselection.json @@ -3,15 +3,22 @@ "scopeName": "source.apollo.jsonselection", "patterns": [ { - "include": "#JSONSelection" + "include": "#NamedSelection" + }, + { + "include": "source.graphql#graphql-skip-newlines" } ], "repository": { "JSONSelection": { "name": "meta.JSONSelection", "patterns": [ - { "include": "SubSelection" }, - { "include": "source.graphql#graphql-selection-set" } + { + "include": "#NakedSubSelection" + }, + { + "include": "#PathSelection" + } ] }, "NakedSubSelection": { @@ -26,9 +33,19 @@ ] }, "SubSelection": { - "name": "meta.SubSelection", - "begin": "\\{", - "end": "\\}", + "contentName": "meta.SubSelection", + "begin": "({)", + "end": "(})", + "beginCaptures": { + "1": { + "name": "punctuation.SubSelection.begin" + } + }, + "endCaptures": { + "1": { + "name": "punctuation.SubSelection.end" + } + }, "patterns": [ { "include": "#NakedSubSelection" @@ -40,18 +57,24 @@ "patterns": [ { "include": "#NamedFieldSelection" - }, - { - "include": "#NamedQuotedSelection" - }, - { - "include": "#NamedPathOrGroupSelection" } ] }, "NamedFieldSelection": { "name": "meta.NamedFieldSelection", "begin": "([a-zA-Z][0-9a-zA-Z_]*(:))?\\s*([a-zA-Z][0-9a-zA-Z_]*)", + "beginCaptures": { + "1": { + "name": "variable.NamedFieldSelection.alias" + }, + "2": { + "name": "punctuation.colon.NamedFieldSelection" + }, + "3": { + "name": "variable.NamedFieldSelection.identifier" + } + }, + "end": "(?=.)", "patterns": [ { "include": "#SubSelection" diff --git a/syntaxes/connectors.jsonselection.yaml b/syntaxes/connectors.jsonselection.yaml index 7d8a06d3..e5899738 100644 --- a/syntaxes/connectors.jsonselection.yaml +++ b/syntaxes/connectors.jsonselection.yaml @@ -1,10 +1,12 @@ # use 'js-yaml' to convert to json # npx js-yaml syntaxes/connectors.jsonselection.yaml >| syntaxes/connectors.jsonselection.json name: "Apollo Connectors JSONSelection" -scopeName: "inline.connectors.jsonselection.graphql" -injectionSelector: "L:meta.embedded.block.jsonselection.graphql -string -comment" +scopeName: "source.apollo.jsonselection" patterns: - - include: "#JSONSelection" + - include: "#NamedSelection" + - include: "source.graphql#graphql-skip-newlines" + # should be +# - include: "#JSONSelection" repository: # JSONSelection ::= NakedSubSelection | PathSelection JSONSelection: @@ -20,9 +22,15 @@ repository: - include: "#StarSelection" # SubSelection ::= "{" NakedSubSelection "}" SubSelection: - name: "meta.SubSelection" - begin: "\\{" - end: "\\}" + contentName: "meta.SubSelection" + begin: "({)" + end: "(})" + beginCaptures: + "1": + name: "punctuation.SubSelection.begin" + endCaptures: + "1": + name: "punctuation.SubSelection.end" patterns: - include: "#NakedSubSelection" # NamedSelection ::= NamedPathSelection | NamedFieldSelection | NamedQuotedSelection | NamedGroupSelection @@ -30,14 +38,22 @@ repository: name: "meta.NamedSelection" patterns: - include: "#NamedFieldSelection" - - include: "#NamedQuotedSelection" - - include: "#NamedPathOrGroupSelection" + # - include: "#NamedQuotedSelection" + # - include: "#NamedPathOrGroupSelection" # NamedPathSelection ::= Alias PathSelection # merged with NamedGroupSelection # NamedFieldSelection ::= Alias? Identifier SubSelection? NamedFieldSelection: name: "meta.NamedFieldSelection" begin: "([a-zA-Z][0-9a-zA-Z_]*(:))?\\s*([a-zA-Z][0-9a-zA-Z_]*)" + beginCaptures: + "1": + name: "variable.NamedFieldSelection.alias" + "2": + name: "punctuation.colon.NamedFieldSelection" + "3": + name: "variable.NamedFieldSelection.identifier" + end: "(?=.)" patterns: - include: "#SubSelection" # NamedQuotedSelection ::= Alias StringLiteral SubSelection? From 60814f770c51bd600bce1278e1b6eb171adcbae7 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Thu, 24 Oct 2024 12:48:09 +0200 Subject: [PATCH 08/34] change to new ebnf, start over --- syntaxes/connectors.jsonselection.json | 206 ++----------------------- syntaxes/connectors.jsonselection.yaml | 179 ++++++--------------- 2 files changed, 58 insertions(+), 327 deletions(-) diff --git a/syntaxes/connectors.jsonselection.json b/syntaxes/connectors.jsonselection.json index 9d896ef8..58d312f0 100644 --- a/syntaxes/connectors.jsonselection.json +++ b/syntaxes/connectors.jsonselection.json @@ -3,7 +3,7 @@ "scopeName": "source.apollo.jsonselection", "patterns": [ { - "include": "#NamedSelection" + "include": "#JSONSelection" }, { "include": "source.graphql#graphql-skip-newlines" @@ -12,43 +12,29 @@ "repository": { "JSONSelection": { "name": "meta.JSONSelection", - "patterns": [ - { - "include": "#NakedSubSelection" - }, - { - "include": "#PathSelection" - } - ] - }, - "NakedSubSelection": { - "name": "meta.NakedSubSelection", "patterns": [ { "include": "#NamedSelection" - }, - { - "include": "#StarSelection" } ] }, "SubSelection": { - "contentName": "meta.SubSelection", - "begin": "({)", - "end": "(})", + "name": "meta.SubSelection", + "begin": "\\s*({)", "beginCaptures": { - "1": { - "name": "punctuation.SubSelection.begin" + "0": { + "name": "punctuation.SubSelection.open" } }, + "end": "\\s*(})", "endCaptures": { - "1": { - "name": "punctuation.SubSelection.end" + "0": { + "name": "punctuation.SubSelection.close" } }, "patterns": [ { - "include": "#NakedSubSelection" + "include": "#NamedSelection" } ] }, @@ -61,186 +47,20 @@ ] }, "NamedFieldSelection": { - "name": "meta.NamedFieldSelection", - "begin": "([a-zA-Z][0-9a-zA-Z_]*(:))?\\s*([a-zA-Z][0-9a-zA-Z_]*)", + "begin": "\\b(?:([a-zA-Z][0-9a-zA-Z_]*)\\s*(:))?\\s*([a-zA-Z][0-9a-zA-Z_]*)\\b", "beginCaptures": { "1": { - "name": "variable.NamedFieldSelection.alias" + "name": "string.unquoted.NamedFieldSelection.alias" }, "2": { "name": "punctuation.colon.NamedFieldSelection" }, "3": { - "name": "variable.NamedFieldSelection.identifier" + "name": "variable.NamedFieldSelection.key" } }, "end": "(?=.)", - "patterns": [ - { - "include": "#SubSelection" - } - ] - }, - "NamedQuotedSelection": { - "name": "meta.NamedQuotedSelection", - "begin": "([a-zA-Z][0-9a-zA-Z_]*(:)\\s*(\"[^\"]*\"|'[^']*'))", - "patterns": [ - { - "include": "#SubSelection" - } - ] - }, - "NamedPathOrGroupSelection": { - "name": "meta.NamedPathOrGroupSelection", - "begin": "([a-zA-Z][0-9a-zA-Z_]*(:)", - "patterns": [ - { - "include": "#SubSelection" - }, - { - "include": "#PathSelection" - } - ] - }, - "PathSelection": { - "name": "meta.PathSelection", - "patterns": [ - { - "include": "#VarPathWithSubSelection" - }, - { - "include": "#KeyPathWithSubSelection" - } - ] - }, - "VarPathWithSubSelection": { - "name": "meta.VarPathWithSubSelection", - "begin": "\\$([a-zA-Z][0-9a-zA-Z_]*)?", - "patterns": [ - { - "include": "#PathStep" - }, - { - "include": "#SubSelection" - } - ] - }, - "KeyPathWithSubSelection": { - "name": "meta.KeyPathWithSubSelection", - "begin": "([a-zA-Z][0-9a-zA-Z_]*|\"[^\"]*\"|'[^']*')\\s*", - "patterns": [ - { - "include": "#PathStep" - }, - { - "include": "#SubSelection" - } - ] - }, - "PathStep": { - "name": "meta.PathStep", - "patterns": [ - { - "match": "\\.([a-zA-Z][0-9a-zA-Z_]*|\"[^\"]*\"|'[^']*')" - }, - { - "match": "->([a-zA-Z][0-9a-zA-Z_]*)", - "patterns": [ - { - "include": "#MethodArgs" - } - ] - } - ] - }, - "MethodArgs": { - "name": "meta.MethodArgs", - "begin": "\\(", - "end": "\\)", - "patterns": [ - { - "end": ",|(?=\\))", - "patterns": [ - { - "include": "#JSLiteral" - } - ] - } - ] - }, - "JSLiteral": { - "name": "meta.JSLiteral", - "patterns": [ - { - "include": "#JSPrimitive" - }, - { - "include": "#JSObject" - }, - { - "include": "#JSArray" - }, - { - "include": "#PathSelection" - } - ] - }, - "JSPrimitive": { - "name": "meta.JSPrimitive", - "patterns": [ - { - "match": "\"[^\"]*\"|'[^']*'" - }, - { - "match": "-?(0|[1-9][0-9]*)(\\.[0-9]*)?" - }, - { - "match": "true|false|null" - } - ] - }, - "JSObject": { - "name": "meta.JSObject", - "begin": "\\{", - "end": "\\}", - "patterns": [ - { - "end": ",|(?=\\})", - "patterns": [ - { - "include": "#JSProperty" - } - ] - } - ] - }, - "JSProperty": { - "name": "meta.JSProperty", - "begin": "([a-zA-Z][0-9a-zA-Z_]*|\"[^\"]*\"|'[^']*')\\s*:", - "patterns": [ - { - "include": "#JSLiteral" - } - ] - }, - "JSArray": { - "name": "meta.JSArray", - "begin": "\\[", - "end": "\\]", - "patterns": [ - { - "end": ",|(?=\\])", - "patterns": [ - { - "include": "#JSLiteral" - } - ] - } - ] - }, - "StarSelection": { - "name": "meta.StarSelection", - "begin": "([a-zA-Z][0-9a-zA-Z_]*(:))?\\s*\\*", + "applyEndPatternLast": "1,", "patterns": [ { "include": "#SubSelection" diff --git a/syntaxes/connectors.jsonselection.yaml b/syntaxes/connectors.jsonselection.yaml index e5899738..be8b4f9d 100644 --- a/syntaxes/connectors.jsonselection.yaml +++ b/syntaxes/connectors.jsonselection.yaml @@ -3,161 +3,72 @@ name: "Apollo Connectors JSONSelection" scopeName: "source.apollo.jsonselection" patterns: - - include: "#NamedSelection" + - include: "#JSONSelection" - include: "source.graphql#graphql-skip-newlines" - # should be -# - include: "#JSONSelection" repository: - # JSONSelection ::= NakedSubSelection | PathSelection + # JSONSelection ::= PathSelection | NamedSelection* JSONSelection: name: "meta.JSONSelection" patterns: - - include: "#NakedSubSelection" - - include: "#PathSelection" - # NakedSubSelection ::= NamedSelection* StarSelection? - NakedSubSelection: - name: "meta.NakedSubSelection" - patterns: + # - include: "#PathSelection" - include: "#NamedSelection" - - include: "#StarSelection" - # SubSelection ::= "{" NakedSubSelection "}" + # SubSelection ::= "{" NamedSelection* "}" SubSelection: - contentName: "meta.SubSelection" - begin: "({)" - end: "(})" + name: "meta.SubSelection" + begin: "\\s*({)" beginCaptures: - "1": - name: "punctuation.SubSelection.begin" + "0": + name: "punctuation.SubSelection.open" + end: "\\s*(})" endCaptures: - "1": - name: "punctuation.SubSelection.end" + "0": + name: "punctuation.SubSelection.close" patterns: - - include: "#NakedSubSelection" - # NamedSelection ::= NamedPathSelection | NamedFieldSelection | NamedQuotedSelection | NamedGroupSelection + - include: "#NamedSelection" + # NamedSelection ::= NamedPathSelection | PathWithSubSelection | NamedFieldSelection | NamedGroupSelection NamedSelection: name: "meta.NamedSelection" patterns: + # - include: "#NamedPathSelection" + # - include: "#PathWithSubSelection" - include: "#NamedFieldSelection" - # - include: "#NamedQuotedSelection" - # - include: "#NamedPathOrGroupSelection" + # - include: "#NamedGroupSelection" # NamedPathSelection ::= Alias PathSelection - # merged with NamedGroupSelection - # NamedFieldSelection ::= Alias? Identifier SubSelection? + # NamedFieldSelection ::= Alias? Key SubSelection? NamedFieldSelection: - name: "meta.NamedFieldSelection" - begin: "([a-zA-Z][0-9a-zA-Z_]*(:))?\\s*([a-zA-Z][0-9a-zA-Z_]*)" + begin: "\\b(?:([a-zA-Z][0-9a-zA-Z_]*)\\s*(:))?\\s*([a-zA-Z][0-9a-zA-Z_]*)\\b" beginCaptures: "1": - name: "variable.NamedFieldSelection.alias" + name: "string.unquoted.NamedFieldSelection.alias" "2": name: "punctuation.colon.NamedFieldSelection" "3": - name: "variable.NamedFieldSelection.identifier" + name: "variable.NamedFieldSelection.key" end: "(?=.)" + applyEndPatternLast: 1, patterns: - include: "#SubSelection" - # NamedQuotedSelection ::= Alias StringLiteral SubSelection? - NamedQuotedSelection: - name: "meta.NamedQuotedSelection" - begin: "([a-zA-Z][0-9a-zA-Z_]*(:)\\s*(\"[^\"]*\"|'[^']*'))" - patterns: - - include: "#SubSelection" - # NamedGroupSelection ::= Alias SubSelection - NamedPathOrGroupSelection: - name: "meta.NamedPathOrGroupSelection" - begin: "([a-zA-Z][0-9a-zA-Z_]*(:)" - patterns: - - include: "#SubSelection" - - include: "#PathSelection" - # Alias ::= Identifier ":" - # PathSelection ::= (VarPath | KeyPath) SubSelection? - PathSelection: - name: "meta.PathSelection" - patterns: - - include: "#VarPathWithSubSelection" - - include: "#KeyPathWithSubSelection" - # VarPath ::= "$" (NO_SPACE Identifier)? PathStep* - VarPathWithSubSelection: - name: "meta.VarPathWithSubSelection" - begin: "\\$([a-zA-Z][0-9a-zA-Z_]*)?" - patterns: - - include: "#PathStep" - - include: "#SubSelection" - # KeyPath ::= Key PathStep+ - KeyPathWithSubSelection: - name: "meta.KeyPathWithSubSelection" - begin: "([a-zA-Z][0-9a-zA-Z_]*|\"[^\"]*\"|'[^']*')\\s*" - patterns: - - include: "#PathStep" - - include: "#SubSelection" - # PathStep ::= "." Key | "->" Identifier MethodArgs? - PathStep: - name: "meta.PathStep" - patterns: - - match: "\\.([a-zA-Z][0-9a-zA-Z_]*|\"[^\"]*\"|'[^']*')" - - match: "->([a-zA-Z][0-9a-zA-Z_]*)" - patterns: - - include: "#MethodArgs" - # Key ::= Identifier | StringLiteral - # Identifier ::= [a-zA-Z_] NO_SPACE [0-9a-zA-Z_]* - # StringLiteral ::= "'" ("\\'" | [^'])* "'" | '"' ('\\"' | [^"])* '"' - # MethodArgs ::= "(" (JSLiteral ("," JSLiteral)*)? ")" - MethodArgs: - name: "meta.MethodArgs" - begin: "\\(" - end: "\\)" - patterns: - - end: ",|(?=\\))" - patterns: - - include: "#JSLiteral" - # JSLiteral ::= JSPrimitive | JSObject | JSArray | PathSelection - JSLiteral: - name: "meta.JSLiteral" - patterns: - - include: "#JSPrimitive" - - include: "#JSObject" - - include: "#JSArray" - - include: "#PathSelection" - # JSPrimitive ::= StringLiteral | JSNumber | "true" | "false" | "null" - JSPrimitive: - name: "meta.JSPrimitive" - patterns: - - match: '"[^"]*"|''[^'']*''' - - match: "-?(0|[1-9][0-9]*)(\\.[0-9]*)?" - - match: "true|false|null" - # JSNumber ::= "-"? (UnsignedInt ("." [0-9]*)? | "." [0-9]+) - # UnsignedInt ::= "0" | [1-9] NO_SPACE [0-9]* - # JSObject ::= "{" (JSProperty ("," JSProperty)*)? "}" - JSObject: - name: "meta.JSObject" - begin: "\\{" - end: "\\}" - patterns: - - end: ",|(?=\\})" - patterns: - - include: "#JSProperty" - # JSProperty ::= Key ":" JSLiteral - JSProperty: - name: "meta.JSProperty" - begin: "([a-zA-Z][0-9a-zA-Z_]*|\"[^\"]*\"|'[^']*')\\s*:" - patterns: - - include: "#JSLiteral" - # JSArray ::= "[" (JSLiteral ("," JSLiteral)*)? "]" - JSArray: - name: "meta.JSArray" - begin: "\\[" - end: "\\]" - patterns: - - end: ",|(?=\\])" - patterns: - - include: "#JSLiteral" - # StarSelection ::= Alias? "*" SubSelection? - StarSelection: - name: "meta.StarSelection" - begin: "([a-zA-Z][0-9a-zA-Z_]*(:))?\\s*\\*" - patterns: - - include: "#SubSelection" - # NO_SPACE ::= !SpacesOrComments - # SpacesOrComments ::= (Spaces | Comment)+ - # Spaces ::= (" " | "\t" | "\r" | "\n")+ - # Comment ::= "#" [^\n]* +# NamedGroupSelection ::= Alias SubSelection +# Alias ::= Key ":" +# Path ::= VarPath | KeyPath | AtPath | ExprPath +# PathSelection ::= Path SubSelection? +# PathWithSubSelection ::= Path SubSelection +# VarPath ::= "$" (NO_SPACE Identifier)? PathStep* +# KeyPath ::= Key PathStep+ +# AtPath ::= "@" PathStep* +# ExprPath ::= "$(" LitExpr ")" PathStep* +# PathStep ::= "." Key | "->" Identifier MethodArgs? +# Key ::= Identifier | LitString +# Identifier ::= [a-zA-Z_] NO_SPACE [0-9a-zA-Z_]* +# MethodArgs ::= "(" (LitExpr ("," LitExpr)* ","?)? ")" +# LitExpr ::= LitPrimitive | LitObject | LitArray | PathSelection +# LitPrimitive ::= LitString | LitNumber | "true" | "false" | "null" +# LitString ::= "'" ("\\'" | [^'])* "'" | '"' ('\\"' | [^"])* '"' +# LitNumber ::= "-"? ([0-9]+ ("." [0-9]*)? | "." [0-9]+) +# LitObject ::= "{" (LitProperty ("," LitProperty)* ","?)? "}" +# LitProperty ::= Key ":" LitExpr +# LitArray ::= "[" (LitExpr ("," LitExpr)* ","?)? "]" +# NO_SPACE ::= !SpacesOrComments +# SpacesOrComments ::= (Spaces | Comment)+ +# Spaces ::= ("⎵" | "\t" | "\r" | "\n")+ +# Comment ::= "#" [^\n]* From c30aaf4623a923927428f2902701b4b2a15313e4 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Thu, 24 Oct 2024 15:24:42 +0200 Subject: [PATCH 09/34] progress --- syntaxes/connectors.jsonselection.json | 106 +++++++++++++++++++++- syntaxes/connectors.jsonselection.yaml | 117 +++++++++++++++++++------ 2 files changed, 191 insertions(+), 32 deletions(-) diff --git a/syntaxes/connectors.jsonselection.json b/syntaxes/connectors.jsonselection.json index 58d312f0..02431db7 100644 --- a/syntaxes/connectors.jsonselection.json +++ b/syntaxes/connectors.jsonselection.json @@ -13,6 +13,9 @@ "JSONSelection": { "name": "meta.JSONSelection", "patterns": [ + { + "include": "#VarPath" + }, { "include": "#NamedSelection" } @@ -22,13 +25,13 @@ "name": "meta.SubSelection", "begin": "\\s*({)", "beginCaptures": { - "0": { + "1": { "name": "punctuation.SubSelection.open" } }, "end": "\\s*(})", "endCaptures": { - "0": { + "1": { "name": "punctuation.SubSelection.close" } }, @@ -43,11 +46,32 @@ "patterns": [ { "include": "#NamedFieldSelection" + }, + { + "include": "#NamedPathSelection" + } + ] + }, + "NamedPathSelection": { + "begin": "\\b([a-zA-Z][0-9a-zA-Z_]*)\\s*(:)", + "beginCaptures": { + "1": { + "name": "string.unquoted.NamedPathSelection.alias" + }, + "2": { + "name": "punctuation.colon.NamedPathSelection" + } + }, + "end": "(?=.)", + "applyEndPatternLast": "1,", + "patterns": [ + { + "include": "#PathSelection" } ] }, "NamedFieldSelection": { - "begin": "\\b(?:([a-zA-Z][0-9a-zA-Z_]*)\\s*(:))?\\s*([a-zA-Z][0-9a-zA-Z_]*)\\b", + "begin": "\\b(?:([a-zA-Z][0-9a-zA-Z_]*)\\s*(:))?\\s*([a-zA-Z][0-9a-zA-Z_]*)\\b(?!\\s*:)", "beginCaptures": { "1": { "name": "string.unquoted.NamedFieldSelection.alias" @@ -66,6 +90,82 @@ "include": "#SubSelection" } ] + }, + "PathSelection": { + "patterns": [ + { + "include": "#PathWithOrWithoutSubSelection" + } + ] + }, + "PathWithSubSelection": { + "patterns": [ + { + "include": "#PathWithOrWithoutSubSelection" + } + ] + }, + "PathWithOrWithoutSubSelection": { + "patterns": [ + { + "include": "#VarPath" + } + ] + }, + "VarPath": { + "begin": "(\\$)([a-zA-Z][0-9a-zA-Z_]*)?\\b", + "beginCaptures": { + "1": { + "name": "variable.VarPath.language" + }, + "2": { + "name": "variable.VarPath.identifier" + } + }, + "end": "(?=.)", + "applyEndPatternLast": "1,", + "patterns": [ + { + "include": "#PathStep" + } + ] + }, + "PathStep": { + "begin": "(\\.)([a-zA-Z][0-9a-zA-Z_]*|\"[^\"]*\"|'[^']*')|(->)([a-zA-Z][0-9a-zA-Z_]*)", + "end": "(?=.)", + "applyEndPatternLast": "1,", + "beginCaptures": { + "1": { + "name": "punctuation.PathStep.dot" + }, + "2": { + "name": "variable.PathStep.key.identifier" + }, + "3": { + "name": "punctuation.PathStep.arrow" + }, + "4": { + "name": "variable.PathStep.identifier" + } + }, + "patterns": [ + { + "include": "#MethodArgs" + } + ] + }, + "MethodArgs": { + "begin": "\\s*(\\()", + "beginCaptures": { + "1": { + "name": "punctuation.brace.round.MethodArgs.open" + } + }, + "end": "\\s*(\\))", + "endCaptures": { + "1": null, + "name": "punctuation.brace.round.MethodArgs.close" + } } } } diff --git a/syntaxes/connectors.jsonselection.yaml b/syntaxes/connectors.jsonselection.yaml index be8b4f9d..7613b95a 100644 --- a/syntaxes/connectors.jsonselection.yaml +++ b/syntaxes/connectors.jsonselection.yaml @@ -10,18 +10,19 @@ repository: JSONSelection: name: "meta.JSONSelection" patterns: - # - include: "#PathSelection" + - include: "#VarPath" #temp + #- include: "#PathSelection" - include: "#NamedSelection" # SubSelection ::= "{" NamedSelection* "}" SubSelection: name: "meta.SubSelection" begin: "\\s*({)" beginCaptures: - "0": + "1": name: "punctuation.SubSelection.open" end: "\\s*(})" endCaptures: - "0": + "1": name: "punctuation.SubSelection.close" patterns: - include: "#NamedSelection" @@ -29,14 +30,25 @@ repository: NamedSelection: name: "meta.NamedSelection" patterns: - # - include: "#NamedPathSelection" # - include: "#PathWithSubSelection" - include: "#NamedFieldSelection" + - include: "#NamedPathSelection" # - include: "#NamedGroupSelection" # NamedPathSelection ::= Alias PathSelection + NamedPathSelection: + begin: "\\b([a-zA-Z][0-9a-zA-Z_]*)\\s*(:)" + beginCaptures: + "1": + name: "string.unquoted.NamedPathSelection.alias" + "2": + name: "punctuation.colon.NamedPathSelection" + end: "(?=.)" + applyEndPatternLast: 1, + patterns: + - include: "#PathSelection" # NamedFieldSelection ::= Alias? Key SubSelection? NamedFieldSelection: - begin: "\\b(?:([a-zA-Z][0-9a-zA-Z_]*)\\s*(:))?\\s*([a-zA-Z][0-9a-zA-Z_]*)\\b" + begin: "\\b(?:([a-zA-Z][0-9a-zA-Z_]*)\\s*(:))?\\s*([a-zA-Z][0-9a-zA-Z_]*)\\b(?!\\s*:)" beginCaptures: "1": name: "string.unquoted.NamedFieldSelection.alias" @@ -48,27 +60,74 @@ repository: applyEndPatternLast: 1, patterns: - include: "#SubSelection" -# NamedGroupSelection ::= Alias SubSelection -# Alias ::= Key ":" -# Path ::= VarPath | KeyPath | AtPath | ExprPath -# PathSelection ::= Path SubSelection? -# PathWithSubSelection ::= Path SubSelection -# VarPath ::= "$" (NO_SPACE Identifier)? PathStep* -# KeyPath ::= Key PathStep+ -# AtPath ::= "@" PathStep* -# ExprPath ::= "$(" LitExpr ")" PathStep* -# PathStep ::= "." Key | "->" Identifier MethodArgs? -# Key ::= Identifier | LitString -# Identifier ::= [a-zA-Z_] NO_SPACE [0-9a-zA-Z_]* -# MethodArgs ::= "(" (LitExpr ("," LitExpr)* ","?)? ")" -# LitExpr ::= LitPrimitive | LitObject | LitArray | PathSelection -# LitPrimitive ::= LitString | LitNumber | "true" | "false" | "null" -# LitString ::= "'" ("\\'" | [^'])* "'" | '"' ('\\"' | [^"])* '"' -# LitNumber ::= "-"? ([0-9]+ ("." [0-9]*)? | "." [0-9]+) -# LitObject ::= "{" (LitProperty ("," LitProperty)* ","?)? "}" -# LitProperty ::= Key ":" LitExpr -# LitArray ::= "[" (LitExpr ("," LitExpr)* ","?)? "]" -# NO_SPACE ::= !SpacesOrComments -# SpacesOrComments ::= (Spaces | Comment)+ -# Spaces ::= ("⎵" | "\t" | "\r" | "\n")+ -# Comment ::= "#" [^\n]* + # NamedGroupSelection ::= Alias SubSelection + # Alias ::= Key ":" + # Path ::= VarPath | KeyPath | AtPath | ExprPath + # PathSelection ::= Path SubSelection? + # PathWithSubSelection ::= Path SubSelection + PathSelection: + patterns: + - include: "#PathWithOrWithoutSubSelection" + PathWithSubSelection: + patterns: + - include: "#PathWithOrWithoutSubSelection" + PathWithOrWithoutSubSelection: + patterns: + - include: "#VarPath" + #- include: "#KeyPath" + #- include: "#AtPath" + #- include: "#ExprPath" + # VarPath ::= "$" (NO_SPACE Identifier)? PathStep* + VarPath: + begin: "(\\$)([a-zA-Z][0-9a-zA-Z_]*)?\\b" + beginCaptures: + "1": + name: "variable.VarPath.language" + "2": + name: "variable.VarPath.identifier" + end: "(?=.)" + applyEndPatternLast: 1, + patterns: + - include: "#PathStep" + # KeyPath ::= Key PathStep+ + # AtPath ::= "@" PathStep* + # ExprPath ::= "$(" LitExpr ")" PathStep* + # PathStep ::= "." Key | "->" Identifier MethodArgs? + PathStep: + begin: "(\\.)([a-zA-Z][0-9a-zA-Z_]*|\"[^\"]*\"|'[^']*')|(->)([a-zA-Z][0-9a-zA-Z_]*)" + end: "(?=.)" + applyEndPatternLast: 1, + beginCaptures: + "1": + name: "punctuation.PathStep.dot" + "2": + name: "variable.PathStep.key.identifier" + "3": + name: "punctuation.PathStep.arrow" + "4": + name: "variable.PathStep.identifier" + patterns: + - include: "#MethodArgs" + # Key ::= Identifier | LitString + # Identifier ::= [a-zA-Z_] NO_SPACE [0-9a-zA-Z_]* + # MethodArgs ::= "(" (LitExpr ("," LitExpr)* ","?)? ")" + MethodArgs: + begin: "\\s*(\\()" + beginCaptures: + "1": + name: "punctuation.brace.round.MethodArgs.open" + end: "\\s*(\\))" + endCaptures: + "1": + name: "punctuation.brace.round.MethodArgs.close" + # LitExpr ::= LitPrimitive | LitObject | LitArray | PathSelection + # LitPrimitive ::= LitString | LitNumber | "true" | "false" | "null" + # LitString ::= "'" ("\\'" | [^'])* "'" | '"' ('\\"' | [^"])* '"' + # LitNumber ::= "-"? ([0-9]+ ("." [0-9]*)? | "." [0-9]+) + # LitObject ::= "{" (LitProperty ("," LitProperty)* ","?)? "}" + # LitProperty ::= Key ":" LitExpr + # LitArray ::= "[" (LitExpr ("," LitExpr)* ","?)? "]" + # NO_SPACE ::= !SpacesOrComments + # SpacesOrComments ::= (Spaces | Comment)+ + # Spaces ::= ("⎵" | "\t" | "\r" | "\n")+ + # Comment ::= "#" [^\n]* From bda40e6cfcb0543e6f91e5ed354f772c19c3b0bf Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Mon, 28 Oct 2024 13:55:47 +0100 Subject: [PATCH 10/34] progress --- syntaxes/connectors.jsonselection.json | 214 +++++++++++++++++++++++-- syntaxes/connectors.jsonselection.yaml | 128 +++++++++++++-- syntaxes/graphql.connectors.json | 19 ++- 3 files changed, 335 insertions(+), 26 deletions(-) diff --git a/syntaxes/connectors.jsonselection.json b/syntaxes/connectors.jsonselection.json index 02431db7..83a8b9de 100644 --- a/syntaxes/connectors.jsonselection.json +++ b/syntaxes/connectors.jsonselection.json @@ -63,7 +63,7 @@ } }, "end": "(?=.)", - "applyEndPatternLast": "1,", + "applyEndPatternLast": 1, "patterns": [ { "include": "#PathSelection" @@ -84,7 +84,7 @@ } }, "end": "(?=.)", - "applyEndPatternLast": "1,", + "applyEndPatternLast": 1, "patterns": [ { "include": "#SubSelection" @@ -109,34 +109,108 @@ "patterns": [ { "include": "#VarPath" + }, + { + "include": "#KeyPath" + }, + { + "include": "#AtPath" + }, + { + "include": "#ExprPath" } ] }, "VarPath": { - "begin": "(\\$)([a-zA-Z][0-9a-zA-Z_]*)?\\b", + "begin": "(\\$)([a-zA-Z][0-9a-zA-Z_]*)?(?!\\w)", "beginCaptures": { "1": { - "name": "variable.VarPath.language" + "name": "variable.VarPath.dollar" }, "2": { "name": "variable.VarPath.identifier" } }, "end": "(?=.)", - "applyEndPatternLast": "1,", + "applyEndPatternLast": 1, + "patterns": [ + { + "include": "#PathStep" + } + ] + }, + "KeyPath": { + "begin": "([a-zA-Z][0-9a-zA-Z_]*|\"[^\"]*\"|'[^']*')", + "beginCaptures": { + "1": { + "name": "variable.KeyPath.key.identifier" + } + }, + "end": "(?=.)", + "applyEndPatternLast": 1, "patterns": [ { "include": "#PathStep" } ] }, + "AtPath": { + "begin": "(\\@)", + "beginCaptures": { + "1": { + "name": "variable.AtPath.at" + } + }, + "end": "(?=.)", + "applyEndPatternLast": 1, + "patterns": [ + { + "include": "#PathStep" + } + ] + }, + "ExprPath": { + "begin": "(\\$)", + "beginCaptures": { + "1": { + "name": "variable.ExprPath.dollar" + } + }, + "end": "(?=.)", + "applyEndPatternLast": 1, + "patterns": [ + { + "name": "meta.ExprPathArgs", + "begin": "([(])", + "beginCaptures": { + "1": { + "name": "punctuation.brace.round.ExprPathArgs.open" + } + }, + "end": "([)])", + "endCaptures": { + "1": { + "name": "punctuation.brace.round.ExprPathArgs.close" + } + }, + "patterns": [ + { + "include": "#LitExpr" + } + ] + }, + { + "include": "#PathStep" + } + ] + }, "PathStep": { "begin": "(\\.)([a-zA-Z][0-9a-zA-Z_]*|\"[^\"]*\"|'[^']*')|(->)([a-zA-Z][0-9a-zA-Z_]*)", "end": "(?=.)", - "applyEndPatternLast": "1,", + "applyEndPatternLast": 1, "beginCaptures": { "1": { - "name": "punctuation.PathStep.dot" + "name": "variable.PathStep.dot" }, "2": { "name": "variable.PathStep.key.identifier" @@ -155,17 +229,133 @@ ] }, "MethodArgs": { - "begin": "\\s*(\\()", + "name": "meta.MethodArgs", + "begin": "([(])", "beginCaptures": { "1": { "name": "punctuation.brace.round.MethodArgs.open" } }, - "end": "\\s*(\\))", + "end": "([)])", "endCaptures": { - "1": null, - "name": "punctuation.brace.round.MethodArgs.close" - } + "1": { + "name": "punctuation.brace.round.MethodArgs.close" + } + }, + "patterns": [ + { + "include": "#LitExpr" + }, + { + "match": ",", + "name": "punctuation.comma.MethodArgs.separator" + } + ] + }, + "LitExpr": { + "patterns": [ + { + "include": "#LitPrimitive" + }, + { + "include": "#LitObject" + }, + { + "include": "#LitArray" + }, + { + "include": "#PathSelection" + } + ] + }, + "LitPrimitive": { + "patterns": [ + { + "include": "#LitString" + }, + { + "include": "#LitNumber" + }, + { + "match": "\\b(true|false|null)\\b", + "name": "constant.language.LitPrimitive" + } + ] + }, + "LitString": { + "name": "string.quoted.LitString", + "match": "(\")([^\"]*)(\")|(')([^']*)(')" + }, + "LitNumber": { + "name": "constant.numeric.LitNumber", + "match": "\\b-?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)\\b" + }, + "LitObject": { + "name": "meta.LitObject", + "begin": "\\s*({)", + "beginCaptures": { + "1": { + "name": "punctuation.LitObject.open" + } + }, + "end": "\\s*(})", + "endCaptures": { + "1": { + "name": "punctuation.LitObject.close" + } + }, + "patterns": [ + { + "include": "#LitProperty" + }, + { + "match": ",", + "name": "punctuation.comma.LitObject.separator" + } + ] + }, + "LitProperty": { + "name": "meta.LitProperty", + "begin": "\\b([a-zA-Z][0-9a-zA-Z_]*)\\s*(:)\\s*", + "beginCaptures": { + "1": { + "name": "variable.LitProperty.key" + }, + "2": { + "name": "punctuation.colon.LitProperty" + } + }, + "end": "(?=.)", + "applyEndPatternLast": 1, + "patterns": [ + { + "include": "#LitExpr" + } + ] + }, + "LitArray": { + "name": "meta.LitArray", + "begin": "\\s*(\\[)", + "beginCaptures": { + "1": { + "name": "punctuation.LitArray.open" + } + }, + "end": "\\s*(\\])", + "endCaptures": { + "1": { + "name": "punctuation.LitArray.close" + } + }, + "patterns": [ + { + "include": "#LitExpr" + }, + { + "match": ",", + "name": "punctuation.comma.LitArray.separator" + } + ] } } } diff --git a/syntaxes/connectors.jsonselection.yaml b/syntaxes/connectors.jsonselection.yaml index 7613b95a..76a49d1e 100644 --- a/syntaxes/connectors.jsonselection.yaml +++ b/syntaxes/connectors.jsonselection.yaml @@ -43,7 +43,7 @@ repository: "2": name: "punctuation.colon.NamedPathSelection" end: "(?=.)" - applyEndPatternLast: 1, + applyEndPatternLast: 1 patterns: - include: "#PathSelection" # NamedFieldSelection ::= Alias? Key SubSelection? @@ -57,7 +57,7 @@ repository: "3": name: "variable.NamedFieldSelection.key" end: "(?=.)" - applyEndPatternLast: 1, + applyEndPatternLast: 1 patterns: - include: "#SubSelection" # NamedGroupSelection ::= Alias SubSelection @@ -74,32 +74,70 @@ repository: PathWithOrWithoutSubSelection: patterns: - include: "#VarPath" - #- include: "#KeyPath" - #- include: "#AtPath" - #- include: "#ExprPath" + - include: "#KeyPath" + - include: "#AtPath" + - include: "#ExprPath" # VarPath ::= "$" (NO_SPACE Identifier)? PathStep* VarPath: - begin: "(\\$)([a-zA-Z][0-9a-zA-Z_]*)?\\b" + begin: "(\\$)([a-zA-Z][0-9a-zA-Z_]*)?(?!\\w)" beginCaptures: "1": - name: "variable.VarPath.language" + name: "variable.VarPath.dollar" "2": name: "variable.VarPath.identifier" end: "(?=.)" - applyEndPatternLast: 1, + applyEndPatternLast: 1 patterns: - include: "#PathStep" # KeyPath ::= Key PathStep+ + KeyPath: + begin: '([a-zA-Z][0-9a-zA-Z_]*|"[^"]*"|''[^'']*'')' + beginCaptures: + "1": + name: "variable.KeyPath.key.identifier" + end: "(?=.)" + applyEndPatternLast: 1 + patterns: + - include: "#PathStep" # AtPath ::= "@" PathStep* + AtPath: + begin: "(\\@)" + beginCaptures: + "1": + name: "variable.AtPath.at" + end: "(?=.)" + applyEndPatternLast: 1 + patterns: + - include: "#PathStep" # ExprPath ::= "$(" LitExpr ")" PathStep* + ExprPath: + begin: "(\\$)" + beginCaptures: + "1": + name: "variable.ExprPath.dollar" + end: "(?=.)" + applyEndPatternLast: 1 + patterns: + - name: "meta.ExprPathArgs" + begin: "([(])" + beginCaptures: + "1": + name: "punctuation.brace.round.ExprPathArgs.open" + end: "([)])" + endCaptures: + "1": + name: "punctuation.brace.round.ExprPathArgs.close" + patterns: + - include: "#LitExpr" + - include: "#PathStep" # PathStep ::= "." Key | "->" Identifier MethodArgs? PathStep: begin: "(\\.)([a-zA-Z][0-9a-zA-Z_]*|\"[^\"]*\"|'[^']*')|(->)([a-zA-Z][0-9a-zA-Z_]*)" end: "(?=.)" - applyEndPatternLast: 1, + applyEndPatternLast: 1 beginCaptures: "1": - name: "punctuation.PathStep.dot" + name: "variable.PathStep.dot" "2": name: "variable.PathStep.key.identifier" "3": @@ -112,21 +150,85 @@ repository: # Identifier ::= [a-zA-Z_] NO_SPACE [0-9a-zA-Z_]* # MethodArgs ::= "(" (LitExpr ("," LitExpr)* ","?)? ")" MethodArgs: - begin: "\\s*(\\()" + name: "meta.MethodArgs" + begin: "([(])" beginCaptures: "1": name: "punctuation.brace.round.MethodArgs.open" - end: "\\s*(\\))" + end: "([)])" endCaptures: "1": - name: "punctuation.brace.round.MethodArgs.close" + name: "punctuation.brace.round.MethodArgs.close" + patterns: + - include: "#LitExpr" + - match: "," + name: "punctuation.comma.MethodArgs.separator" # LitExpr ::= LitPrimitive | LitObject | LitArray | PathSelection + LitExpr: + patterns: + - include: "#LitPrimitive" + - include: "#LitObject" + - include: "#LitArray" + - include: "#PathSelection" # LitPrimitive ::= LitString | LitNumber | "true" | "false" | "null" + LitPrimitive: + patterns: + - include: "#LitString" + - include: "#LitNumber" + - match: "\\b(true|false|null)\\b" + name: "constant.language.LitPrimitive" # LitString ::= "'" ("\\'" | [^'])* "'" | '"' ('\\"' | [^"])* '"' + LitString: + name: "string.quoted.LitString" + # prettier-ignore + match: "(\")([^\"]*)(\")|(')([^']*)(')" # LitNumber ::= "-"? ([0-9]+ ("." [0-9]*)? | "." [0-9]+) + LitNumber: + name: "constant.numeric.LitNumber" + match: "\\b-?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)\\b" # LitObject ::= "{" (LitProperty ("," LitProperty)* ","?)? "}" + LitObject: + name: "meta.LitObject" + begin: "\\s*({)" + beginCaptures: + "1": + name: "punctuation.LitObject.open" + end: "\\s*(})" + endCaptures: + "1": + name: "punctuation.LitObject.close" + patterns: + - include: "#LitProperty" + - match: "," + name: "punctuation.comma.LitObject.separator" # LitProperty ::= Key ":" LitExpr + LitProperty: + name: "meta.LitProperty" + begin: "\\b([a-zA-Z][0-9a-zA-Z_]*)\\s*(:)\\s*" + beginCaptures: + "1": + name: "variable.LitProperty.key" + "2": + name: "punctuation.colon.LitProperty" + end: "(?=.)" + applyEndPatternLast: 1 + patterns: + - include: "#LitExpr" # LitArray ::= "[" (LitExpr ("," LitExpr)* ","?)? "]" + LitArray: + name: "meta.LitArray" + begin: "\\s*(\\[)" + beginCaptures: + "1": + name: "punctuation.LitArray.open" + end: "\\s*(\\])" + endCaptures: + "1": + name: "punctuation.LitArray.close" + patterns: + - include: "#LitExpr" + - match: "," + name: "punctuation.comma.LitArray.separator" # NO_SPACE ::= !SpacesOrComments # SpacesOrComments ::= (Spaces | Comment)+ # Spaces ::= ("⎵" | "\t" | "\r" | "\n")+ diff --git a/syntaxes/graphql.connectors.json b/syntaxes/graphql.connectors.json index dbd3581f..a733264a 100644 --- a/syntaxes/graphql.connectors.json +++ b/syntaxes/graphql.connectors.json @@ -32,13 +32,30 @@ "patterns": [ { "include": "source.graphql#graphql-comment" }, { "include": "#connect-jsonselection-argument" }, + { + "begin": "\\s*(http)(?:\\s*(:))", + "end": "(?=\\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\\s*(:))|\\)))|\\s*(,)", + "beginCaptures": { + "1": { "name": "variable.parameter.graphql" }, + "2": { "name": "punctuation.colon.graphql" } + }, + "endCaptures": { + "3": { "name": "punctuation.comma.graphql" } + }, + "patterns": [ + { "include": "#connect-arguments" }, + { "include": "source.graphql#graphql-comment" }, + { "include": "source.graphql#literal-quasi-embedded" }, + { "include": "source.graphql#graphql-skip-newlines" } + ] + }, { "include": "source.graphql#graphql-argument" }, { "include": "source.graphql#literal-quasi-embedded" } ] }, "connect-jsonselection-argument": { "name": "meta.argument.connect.jsonselection.graphql", - "begin": "\\s*(selection)(?:\\s*(:))", + "begin": "\\s*(selection|body)(?:\\s*(:))", "end": "(?=\\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\\s*(:))|\\)))|\\s*(,)", "beginCaptures": { "1": { "name": "variable.parameter.graphql" }, From d0d2c77692bec78266ff54214245e713277558d0 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Mon, 28 Oct 2024 14:00:55 +0100 Subject: [PATCH 11/34] getting somewhere --- syntaxes/connectors.jsonselection.json | 8 ++++---- syntaxes/connectors.jsonselection.yaml | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/syntaxes/connectors.jsonselection.json b/syntaxes/connectors.jsonselection.json index 83a8b9de..2840a0e2 100644 --- a/syntaxes/connectors.jsonselection.json +++ b/syntaxes/connectors.jsonselection.json @@ -14,7 +14,7 @@ "name": "meta.JSONSelection", "patterns": [ { - "include": "#VarPath" + "include": "#PathSelection" }, { "include": "#NamedSelection" @@ -107,6 +107,9 @@ }, "PathWithOrWithoutSubSelection": { "patterns": [ + { + "include": "#ExprPath" + }, { "include": "#VarPath" }, @@ -115,9 +118,6 @@ }, { "include": "#AtPath" - }, - { - "include": "#ExprPath" } ] }, diff --git a/syntaxes/connectors.jsonselection.yaml b/syntaxes/connectors.jsonselection.yaml index 76a49d1e..de393e66 100644 --- a/syntaxes/connectors.jsonselection.yaml +++ b/syntaxes/connectors.jsonselection.yaml @@ -10,8 +10,7 @@ repository: JSONSelection: name: "meta.JSONSelection" patterns: - - include: "#VarPath" #temp - #- include: "#PathSelection" + - include: "#PathSelection" - include: "#NamedSelection" # SubSelection ::= "{" NamedSelection* "}" SubSelection: @@ -73,10 +72,10 @@ repository: - include: "#PathWithOrWithoutSubSelection" PathWithOrWithoutSubSelection: patterns: + - include: "#ExprPath" - include: "#VarPath" - include: "#KeyPath" - include: "#AtPath" - - include: "#ExprPath" # VarPath ::= "$" (NO_SPACE Identifier)? PathStep* VarPath: begin: "(\\$)([a-zA-Z][0-9a-zA-Z_]*)?(?!\\w)" From ab78a30061c7e3f5e9ab3042547b8b28c9c4775e Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Mon, 28 Oct 2024 14:55:18 +0100 Subject: [PATCH 12/34] JSONSelectionString --- syntaxes/connectors.jsonselection.json | 43 ++++++++++++++++++++++++++ syntaxes/connectors.jsonselection.yaml | 28 +++++++++++++++++ syntaxes/graphql.connectors.json | 18 +++++++++++ 3 files changed, 89 insertions(+) diff --git a/syntaxes/connectors.jsonselection.json b/syntaxes/connectors.jsonselection.json index 2840a0e2..ad02ba34 100644 --- a/syntaxes/connectors.jsonselection.json +++ b/syntaxes/connectors.jsonselection.json @@ -356,6 +356,49 @@ "name": "punctuation.comma.LitArray.separator" } ] + }, + "JSONSelectionString": { + "contentName": "string.quoted.JSONSelectionString", + "begin": "((\"))", + "beginCaptures": { + "1": { + "name": "string.quoted.double.graphql" + }, + "2": { + "name": "punctuation.definition.string.begin.graphql" + } + }, + "end": "((\"))", + "endCaptures": { + "1": { + "name": "string.quoted.double.graphql" + }, + "2": { + "name\"": "punctuation.definition.string.end.graphql" + } + }, + "patterns": [ + { + "name": "meta.JSONSelectionString.embedded", + "begin": "\\s*({)", + "beginCaptures": { + "1": { + "name": "punctuation.JSONSelectionString.open" + } + }, + "end": "\\s*(})", + "endCaptures": { + "1": { + "name": "punctuation.JSONSelectionString.close" + } + }, + "patterns": [ + { + "include": "#PathSelection" + } + ] + } + ] } } } diff --git a/syntaxes/connectors.jsonselection.yaml b/syntaxes/connectors.jsonselection.yaml index de393e66..2e4b04c1 100644 --- a/syntaxes/connectors.jsonselection.yaml +++ b/syntaxes/connectors.jsonselection.yaml @@ -232,3 +232,31 @@ repository: # SpacesOrComments ::= (Spaces | Comment)+ # Spaces ::= ("⎵" | "\t" | "\r" | "\n")+ # Comment ::= "#" [^\n]* + + # additional rules used for strings, e.g. in `POST: "/foo/bar/{$id}"` + JSONSelectionString: + contentName: string.quoted.JSONSelectionString + begin: '(("))' + beginCaptures: + "1": + name: "string.quoted.double.graphql" + "2": + name: "punctuation.definition.string.begin.graphql" + end: '(("))' + endCaptures: + "1": + name: "string.quoted.double.graphql" + "2": + name": "punctuation.definition.string.end.graphql" + patterns: + - name: "meta.JSONSelectionString.embedded" + begin: "\\s*({)" + beginCaptures: + "1": + name: "punctuation.JSONSelectionString.open" + end: "\\s*(})" + endCaptures: + "1": + name: "punctuation.JSONSelectionString.close" + patterns: + - include: "#PathSelection" diff --git a/syntaxes/graphql.connectors.json b/syntaxes/graphql.connectors.json index a733264a..6236f1ae 100644 --- a/syntaxes/graphql.connectors.json +++ b/syntaxes/graphql.connectors.json @@ -32,6 +32,7 @@ "patterns": [ { "include": "source.graphql#graphql-comment" }, { "include": "#connect-jsonselection-argument" }, + { "include": "#connect-string-jsonselection-argument" }, { "begin": "\\s*(http)(?:\\s*(:))", "end": "(?=\\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\\s*(:))|\\)))|\\s*(,)", @@ -85,6 +86,23 @@ }, { "include": "source.graphql#graphql-skip-newlines" } ] + }, + "connect-string-jsonselection-argument": { + "name": "meta.argument.connect.string.jsonselection.graphql", + "contentName": "meta.embedded.block.string.jsonselection.graphql", + "begin": "\\s*(GET|POST)(?:\\s*(:))", + "end": "(?=\\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\\s*(:))|[\\)}]))|\\s*(,)", + "beginCaptures": { + "1": { "name": "variable.parameter.graphql" }, + "2": { "name": "punctuation.colon.graphql" } + }, + "endCaptures": { + "3": { "name": "punctuation.comma.graphql" } + }, + "patterns": [ + { "include": "source.apollo.jsonselection#JSONSelectionString" }, + { "include": "source.graphql#graphql-skip-newlines" } + ] } } } From e20832bde6d7b85a9eb600f8f3c58276eb07c20c Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Mon, 28 Oct 2024 15:13:56 +0100 Subject: [PATCH 13/34] add comments, snapshot tests --- package.json | 3 +- .../rover/src/test.apollo.jsonselection | 10 - .../sampleWorkspace.code-workspace | 3 + .../fixtures/test.apollo.jsonselection | 137 +++ .../fixtures/test.apollo.jsonselection.snap | 918 ++++++++++++++++++ syntaxes/connectors.jsonselection.json | 15 + syntaxes/connectors.jsonselection.yaml | 8 + 7 files changed, 1083 insertions(+), 11 deletions(-) delete mode 100644 sampleWorkspace/rover/src/test.apollo.jsonselection create mode 100644 src/__tests__/fixtures/test.apollo.jsonselection create mode 100644 src/__tests__/fixtures/test.apollo.jsonselection.snap diff --git a/package.json b/package.json index e94e600f..74a18864 100644 --- a/package.json +++ b/package.json @@ -186,7 +186,8 @@ "scopeName": "inline.connectors.graphql", "path": "./syntaxes/graphql.connectors.json", "embeddedLanguages": { - "meta.embedded.block.jsonselection.graphql": "apollo.jsonselection" + "meta.embedded.block.jsonselection.graphql": "apollo.jsonselection", + "meta.embedded.block.string.jsonselection.graphql": "apollo.jsonselection" } }, { diff --git a/sampleWorkspace/rover/src/test.apollo.jsonselection b/sampleWorkspace/rover/src/test.apollo.jsonselection deleted file mode 100644 index 7dac897f..00000000 --- a/sampleWorkspace/rover/src/test.apollo.jsonselection +++ /dev/null @@ -1,10 +0,0 @@ -foo: bar - $.results { - id - name - } - listing: { - title: $args.input.title - costPerNight: $args.input.costPerNight - numOfBeds: $args.input.numOfBeds - } diff --git a/sampleWorkspace/sampleWorkspace.code-workspace b/sampleWorkspace/sampleWorkspace.code-workspace index ef042bc2..0fd4b2b4 100644 --- a/sampleWorkspace/sampleWorkspace.code-workspace +++ b/sampleWorkspace/sampleWorkspace.code-workspace @@ -23,6 +23,9 @@ }, { "path": "../src/language-server/__tests__/fixtures/documents" + }, + { + "path": "../src/__tests__/fixtures" } ], "settings": {} diff --git a/src/__tests__/fixtures/test.apollo.jsonselection b/src/__tests__/fixtures/test.apollo.jsonselection new file mode 100644 index 00000000..1234c5a1 --- /dev/null +++ b/src/__tests__/fixtures/test.apollo.jsonselection @@ -0,0 +1,137 @@ +# Examples from https://github.com/apollographql/router/blob/next/apollo-federation/src/sources/connect/json_selection/README.md + +id +name +abc: some.nested.path { a b c } +id +name +some.nested.path { a b c } +names: { + first: firstName + last: lastName +} +# Also allowed: +firstName +lastName +postID +title +author: { + id: authorID + name: authorName +} + title + year: publication.year + authorName: author.name +id +created +model + +# The { role content } SubSelection is mandatory so the output keys +# can be statically determined: +choices->first.message { role content } + +# Multiple PathWithSubSelections are allowed in the same SubSelection: +choices->last.message { lastContent: content } + # For some reason /users/{$args.id} returns an object with name + # and email but no id, so we inject the id manually: + id: $args.id + name + email +id name friends: friend_ids { id: $ } +items: data.nested.items { id name } +firstItem: data.nested.items->first { id name } +firstItemName: data.nested.items->first.name +$.data { id name } +id: data.id +name: data.name +all: $.first->and($.second)->and($.third) +wrapped: field->echo({ fieldValue: @ }) +children: parent->echo([@.child1, @.child2, @.child3]) +doubled: numbers->map({ value: @->mul(2) }) +types: values->map(@->typeof) +__typename: $("Product") +condition: $(true) +alphabetSlice: $("abcdefghijklmnopqrstuvwxyz")->slice($args.start, $args.end) +suffix: results.slice($(-1)->mul($args.suffixLength)) +# The ->echo method returns its first input argument as-is, ignoring +# the input data. Useful for embedding literal values, as in +# $->echo("give me this string"), or wrapping the input value. +__typename: $->echo("Book") +wrapped: field->echo({ fieldValue: @ }) + +# Returns the type of the data as a string, e.g. "object", "array", +# "string", "number", "boolean", or "null". Note that `typeof null` is +# "object" in JavaScript but "null" for our purposes. +typeOfValue: value->typeof + +# When invoked against an array, ->map evaluates its first argument +# against each element of the array, binding the element values to `@`, +# and returns an array of the results. When invoked against a non-array, +# ->map evaluates its first argument against that value and returns the +# result without wrapping it in an array. +doubled: numbers->map(@->mul(2)) +types: values->map(@->typeof) + +# Returns true if the data is deeply equal to the first argument, false +# otherwise. Equality is solely value-based (all JSON), no references. +isObject: value->typeof->eq("object") + +# Takes any number of pairs [candidate, value], and returns value for +# the first candidate that equals the input data. If none of the +# pairs match, a runtime error is reported, but a single-element +# [] array as the final argument guarantees a default value. +__typename: kind->match( + ["dog", "Canine"], + ["cat", "Feline"], + ["Exotic"] +) + +# Like ->match, but expects the first element of each pair to evaluate +# to a boolean, returning the second element of the first pair whose +# first element is true. This makes providing a final catch-all case +# easy, since the last pair can be [true, ]. +__typename: kind->matchIf( + [@->eq("dog"), "Canine"], + [@->eq("cat"), "Feline"], + [true, "Exotic"] +) + +# Arithmetic methods, supporting both integers and floating point values, +# similar to JavaScript. +sum: $.a->add($.b)->add($.c) +difference: $.a->sub($.b)->sub($.c) +product: $.a->mul($.b, $.c) +quotient: $.a->div($.b) +remainder: $.a->mod($.b) + +# Array/string methods +first: list->first +last: list->last +index3: list->get(3) +secondToLast: list->get(-2) +slice: list->slice(0, 5) +substring: string->slice(2, 5) +arraySize: array->size +stringLength: string->size + +# Object methods +aValue: $->echo({ a: 123 })->get("a") +hasKey: object->has("key") +hasAB: object->has("a")->and(object->has("b")) +numberOfProperties: object->size +keys: object->keys +values: object->values +entries: object->entries +keysFromEntries: object->entries.key +valuesFromEntries: object->entries.value + +# Logical methods +negation: $.condition->not +bangBang: $.condition->not->not +disjunction: $.a->or($.b)->or($.c) +conjunction: $.a->and($.b, $.c) +aImpliesB: $.a->not->or($.b) +excludedMiddle: $.toBe->or($.toBe->not)->eq(true) + +# Tests from https://github.com/apollographql/router/blob/next/apollo-federation/src/sources/connect/url_template.rs + diff --git a/src/__tests__/fixtures/test.apollo.jsonselection.snap b/src/__tests__/fixtures/test.apollo.jsonselection.snap new file mode 100644 index 00000000..d0c5bc4f --- /dev/null +++ b/src/__tests__/fixtures/test.apollo.jsonselection.snap @@ -0,0 +1,918 @@ +># Examples from https://github.com/apollographql/router/blob/next/apollo-federation/src/sources/connect/json_selection/README.md +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +> +>id +#^^ source.apollo.jsonselection variable.KeyPath.key.identifier +>name +#^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +>abc: some.nested.path { a b c } +#^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^^^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +>id +#^^ source.apollo.jsonselection variable.KeyPath.key.identifier +>name +#^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +>some.nested.path { a b c } +#^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^^^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +>names: { +#^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^^ source.apollo.jsonselection +> first: firstName +#^^ source.apollo.jsonselection +# ^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +> last: lastName +#^^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +>} +#^ source.apollo.jsonselection +># Also allowed: +#^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +>firstName +#^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +>lastName +#^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +>postID +#^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +>title +#^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +>author: { +#^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^^ source.apollo.jsonselection +> id: authorID +#^^ source.apollo.jsonselection +# ^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +> name: authorName +#^^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +>} +#^ source.apollo.jsonselection +> title +#^^^^^^ source.apollo.jsonselection +# ^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +> year: publication.year +#^^^^^^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +> authorName: author.name +#^^^^^^ source.apollo.jsonselection +# ^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +>id +#^^ source.apollo.jsonselection variable.KeyPath.key.identifier +>created +#^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +>model +#^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +> +># The { role content } SubSelection is mandatory so the output keys +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +># can be statically determined: +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +>choices->first.message { role content } +#^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^^^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^ source.apollo.jsonselection +# ^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +> +># Multiple PathWithSubSelections are allowed in the same SubSelection: +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +>choices->last.message { lastContent: content } +#^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^^^ source.apollo.jsonselection +# ^^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +> # For some reason /users/{$args.id} returns an object with name +#^^^^^^ source.apollo.jsonselection comment.line.jsonselection punctuation.whitespace.comment.leading.jsonselection +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +> # and email but no id, so we inject the id manually: +#^^^^^^ source.apollo.jsonselection comment.line.jsonselection punctuation.whitespace.comment.leading.jsonselection +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +> id: $args.id +#^^^^^^ source.apollo.jsonselection +# ^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^ source.apollo.jsonselection variable.PathStep.key.identifier +> name +#^^^^^^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +> email +#^^^^^^ source.apollo.jsonselection +# ^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +>id name friends: friend_ids { id: $ } +#^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^^ source.apollo.jsonselection +# ^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^^ source.apollo.jsonselection +>items: data.nested.items { id name } +#^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^^^ source.apollo.jsonselection +# ^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +>firstItem: data.nested.items->first { id name } +#^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^^^ source.apollo.jsonselection +# ^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +>firstItemName: data.nested.items->first.name +#^^^^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +>$.data { id name } +#^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^^^ source.apollo.jsonselection +# ^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +>id: data.id +#^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^ source.apollo.jsonselection variable.PathStep.key.identifier +>name: data.name +#^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +>all: $.first->and($.second)->and($.third) +#^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot +# ^^^^^^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot +# ^^^^^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +>wrapped: field->echo({ fieldValue: @ }) +#^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject punctuation.LitObject.open +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject +# ^^^^^^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty variable.LitProperty.key +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty punctuation.colon.LitProperty +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty variable.AtPath.at +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject punctuation.LitObject.close +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +>children: parent->echo([@.child1, @.child2, @.child3]) +#^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.LitArray.open +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray variable.AtPath.at +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray variable.PathStep.dot +# ^^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray variable.PathStep.key.identifier +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.comma.LitArray.separator +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray variable.AtPath.at +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray variable.PathStep.dot +# ^^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray variable.PathStep.key.identifier +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.comma.LitArray.separator +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray variable.AtPath.at +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray variable.PathStep.dot +# ^^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray variable.PathStep.key.identifier +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.LitArray.close +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +>doubled: numbers->map({ value: @->mul(2) }) +#^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject punctuation.LitObject.open +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject +# ^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty variable.LitProperty.key +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty punctuation.colon.LitProperty +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty variable.AtPath.at +# ^^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty meta.MethodArgs constant.numeric.LitNumber +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty meta.MethodArgs punctuation.brace.round.MethodArgs.close +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject punctuation.LitObject.close +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +>types: values->map(@->typeof) +#^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs variable.AtPath.at +# ^^ source.apollo.jsonselection meta.MethodArgs punctuation.PathStep.arrow +# ^^^^^^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +>__typename: $("Product") +#^^ source.apollo.jsonselection +# ^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.ExprPathArgs punctuation.brace.round.ExprPathArgs.open +# ^^^^^^^^^ source.apollo.jsonselection meta.ExprPathArgs string.quoted.LitString +# ^ source.apollo.jsonselection meta.ExprPathArgs punctuation.brace.round.ExprPathArgs.close +>condition: $(true) +#^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.ExprPathArgs punctuation.brace.round.ExprPathArgs.open +# ^^^^ source.apollo.jsonselection meta.ExprPathArgs constant.language.LitPrimitive +# ^ source.apollo.jsonselection meta.ExprPathArgs punctuation.brace.round.ExprPathArgs.close +>alphabetSlice: $("abcdefghijklmnopqrstuvwxyz")->slice($args.start, $args.end) +#^^^^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.ExprPathArgs punctuation.brace.round.ExprPathArgs.open +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection meta.ExprPathArgs string.quoted.LitString +# ^ source.apollo.jsonselection meta.ExprPathArgs punctuation.brace.round.ExprPathArgs.close +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^^^^ source.apollo.jsonselection meta.MethodArgs variable.KeyPath.key.identifier +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot +# ^^^^^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.comma.MethodArgs.separator +# ^ source.apollo.jsonselection meta.MethodArgs +# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^^^^ source.apollo.jsonselection meta.MethodArgs variable.KeyPath.key.identifier +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot +# ^^^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +>suffix: results.slice($(-1)->mul($args.suffixLength)) +#^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs meta.ExprPathArgs punctuation.brace.round.ExprPathArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs meta.ExprPathArgs +# ^ source.apollo.jsonselection meta.MethodArgs meta.ExprPathArgs constant.numeric.LitNumber +# ^ source.apollo.jsonselection meta.MethodArgs meta.ExprPathArgs punctuation.brace.round.ExprPathArgs.close +# ^^ source.apollo.jsonselection meta.MethodArgs punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs meta.MethodArgs variable.ExprPath.dollar +# ^^^^ source.apollo.jsonselection meta.MethodArgs meta.MethodArgs variable.KeyPath.key.identifier +# ^ source.apollo.jsonselection meta.MethodArgs meta.MethodArgs variable.PathStep.dot +# ^^^^^^^^^^^^ source.apollo.jsonselection meta.MethodArgs meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.jsonselection meta.MethodArgs meta.MethodArgs punctuation.brace.round.MethodArgs.close +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +># The ->echo method returns its first input argument as-is, ignoring +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +># the input data. Useful for embedding literal values, as in +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +># $->echo("give me this string"), or wrapping the input value. +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +>__typename: $->echo("Book") +#^^ source.apollo.jsonselection +# ^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^^^^^^ source.apollo.jsonselection meta.MethodArgs string.quoted.LitString +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +>wrapped: field->echo({ fieldValue: @ }) +#^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject punctuation.LitObject.open +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject +# ^^^^^^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty variable.LitProperty.key +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty punctuation.colon.LitProperty +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty variable.AtPath.at +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject punctuation.LitObject.close +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +> +># Returns the type of the data as a string, e.g. "object", "array", +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +># "string", "number", "boolean", or "null". Note that `typeof null` is +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +># "object" in JavaScript but "null" for our purposes. +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +>typeOfValue: value->typeof +#^^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^^^^ source.apollo.jsonselection variable.PathStep.identifier +> +># When invoked against an array, ->map evaluates its first argument +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +># against each element of the array, binding the element values to `@`, +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +># and returns an array of the results. When invoked against a non-array, +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +># ->map evaluates its first argument against that value and returns the +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +># result without wrapping it in an array. +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +>doubled: numbers->map(@->mul(2)) +#^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs variable.AtPath.at +# ^^ source.apollo.jsonselection meta.MethodArgs punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs meta.MethodArgs constant.numeric.LitNumber +# ^ source.apollo.jsonselection meta.MethodArgs meta.MethodArgs punctuation.brace.round.MethodArgs.close +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +>types: values->map(@->typeof) +#^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs variable.AtPath.at +# ^^ source.apollo.jsonselection meta.MethodArgs punctuation.PathStep.arrow +# ^^^^^^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +> +># Returns true if the data is deeply equal to the first argument, false +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +># otherwise. Equality is solely value-based (all JSON), no references. +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +>isObject: value->typeof->eq("object") +#^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^^^^^^^^ source.apollo.jsonselection meta.MethodArgs string.quoted.LitString +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +> +># Takes any number of pairs [candidate, value], and returns value for +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +># the first candidate that equals the input data. If none of the +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +># pairs match, a runtime error is reported, but a single-element +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +># [] array as the final argument guarantees a default value. +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +>__typename: kind->match( +#^^ source.apollo.jsonselection +# ^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +> ["dog", "Canine"], +#^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.LitArray.open +# ^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray string.quoted.LitString +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.comma.LitArray.separator +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray +# ^^^^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray string.quoted.LitString +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.LitArray.close +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.comma.MethodArgs.separator +> ["cat", "Feline"], +#^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.LitArray.open +# ^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray string.quoted.LitString +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.comma.LitArray.separator +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray +# ^^^^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray string.quoted.LitString +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.LitArray.close +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.comma.MethodArgs.separator +> ["Exotic"] +#^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.LitArray.open +# ^^^^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray string.quoted.LitString +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.LitArray.close +>) +#^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +> +># Like ->match, but expects the first element of each pair to evaluate +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +># to a boolean, returning the second element of the first pair whose +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +># first element is true. This makes providing a final catch-all case +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +># easy, since the last pair can be [true, ]. +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +>__typename: kind->matchIf( +#^^ source.apollo.jsonselection +# ^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^^^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +> [@->eq("dog"), "Canine"], +#^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.LitArray.open +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray variable.AtPath.at +# ^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.PathStep.arrow +# ^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray meta.MethodArgs string.quoted.LitString +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray meta.MethodArgs punctuation.brace.round.MethodArgs.close +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.comma.LitArray.separator +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray +# ^^^^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray string.quoted.LitString +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.LitArray.close +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.comma.MethodArgs.separator +> [@->eq("cat"), "Feline"], +#^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.LitArray.open +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray variable.AtPath.at +# ^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.PathStep.arrow +# ^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray meta.MethodArgs string.quoted.LitString +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray meta.MethodArgs punctuation.brace.round.MethodArgs.close +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.comma.LitArray.separator +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray +# ^^^^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray string.quoted.LitString +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.LitArray.close +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.comma.MethodArgs.separator +> [true, "Exotic"] +#^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.LitArray.open +# ^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray constant.language.LitPrimitive +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.comma.LitArray.separator +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray +# ^^^^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray string.quoted.LitString +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.LitArray.close +>) +#^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +> +># Arithmetic methods, supporting both integers and floating point values, +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +># similar to JavaScript. +#^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +>sum: $.a->add($.b)->add($.c) +#^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +>difference: $.a->sub($.b)->sub($.c) +#^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +>product: $.a->mul($.b, $.c) +#^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.comma.MethodArgs.separator +# ^ source.apollo.jsonselection meta.MethodArgs +# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +>quotient: $.a->div($.b) +#^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +>remainder: $.a->mod($.b) +#^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +> +># Array/string methods +#^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +>first: list->first +#^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^^^ source.apollo.jsonselection variable.PathStep.identifier +>last: list->last +#^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^^ source.apollo.jsonselection variable.PathStep.identifier +>index3: list->get(3) +#^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs constant.numeric.LitNumber +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +>secondToLast: list->get(-2) +#^^^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs +# ^ source.apollo.jsonselection meta.MethodArgs constant.numeric.LitNumber +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +>slice: list->slice(0, 5) +#^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs constant.numeric.LitNumber +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.comma.MethodArgs.separator +# ^ source.apollo.jsonselection meta.MethodArgs +# ^ source.apollo.jsonselection meta.MethodArgs constant.numeric.LitNumber +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +>substring: string->slice(2, 5) +#^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs constant.numeric.LitNumber +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.comma.MethodArgs.separator +# ^ source.apollo.jsonselection meta.MethodArgs +# ^ source.apollo.jsonselection meta.MethodArgs constant.numeric.LitNumber +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +>arraySize: array->size +#^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^^ source.apollo.jsonselection variable.PathStep.identifier +>stringLength: string->size +#^^^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^^ source.apollo.jsonselection variable.PathStep.identifier +> +># Object methods +#^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +>aValue: $->echo({ a: 123 })->get("a") +#^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject punctuation.LitObject.open +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty variable.LitProperty.key +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty punctuation.colon.LitProperty +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty +# ^^^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty constant.numeric.LitNumber +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject +# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject punctuation.LitObject.close +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^^^ source.apollo.jsonselection meta.MethodArgs string.quoted.LitString +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +>hasKey: object->has("key") +#^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^^^^^ source.apollo.jsonselection meta.MethodArgs string.quoted.LitString +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +>hasAB: object->has("a")->and(object->has("b")) +#^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^^^ source.apollo.jsonselection meta.MethodArgs string.quoted.LitString +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^^^^^^ source.apollo.jsonselection meta.MethodArgs variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection meta.MethodArgs punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^^^ source.apollo.jsonselection meta.MethodArgs meta.MethodArgs string.quoted.LitString +# ^ source.apollo.jsonselection meta.MethodArgs meta.MethodArgs punctuation.brace.round.MethodArgs.close +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +>numberOfProperties: object->size +#^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^^ source.apollo.jsonselection variable.PathStep.identifier +>keys: object->keys +#^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^^ source.apollo.jsonselection variable.PathStep.identifier +>values: object->values +#^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^^^^ source.apollo.jsonselection variable.PathStep.identifier +>entries: object->entries +#^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^^^^^ source.apollo.jsonselection variable.PathStep.identifier +>keysFromEntries: object->entries.key +#^^^^^^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^^^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^^ source.apollo.jsonselection variable.PathStep.key.identifier +>valuesFromEntries: object->entries.value +#^^^^^^^^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^^^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +> +># Logical methods +#^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +>negation: $.condition->not +#^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^^^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection variable.PathStep.identifier +>bangBang: $.condition->not->not +#^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^^^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection variable.PathStep.identifier +>disjunction: $.a->or($.b)->or($.c) +#^^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +>conjunction: $.a->and($.b, $.c) +#^^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.comma.MethodArgs.separator +# ^ source.apollo.jsonselection meta.MethodArgs +# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +>aImpliesB: $.a->not->or($.b) +#^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +>excludedMiddle: $.toBe->or($.toBe->not)->eq(true) +#^^^^^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot +# ^^^^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier +# ^^ source.apollo.jsonselection meta.MethodArgs punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^^^^ source.apollo.jsonselection meta.MethodArgs constant.language.LitPrimitive +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +> +># Tests from https://github.com/apollographql/router/blob/next/apollo-federation/src/sources/connect/url_template.rs +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +> +> \ No newline at end of file diff --git a/syntaxes/connectors.jsonselection.json b/syntaxes/connectors.jsonselection.json index ad02ba34..4bfb6fef 100644 --- a/syntaxes/connectors.jsonselection.json +++ b/syntaxes/connectors.jsonselection.json @@ -18,6 +18,9 @@ }, { "include": "#NamedSelection" + }, + { + "include": "#Comment" } ] }, @@ -38,6 +41,9 @@ "patterns": [ { "include": "#NamedSelection" + }, + { + "include": "#Comment" } ] }, @@ -357,6 +363,15 @@ } ] }, + "Comment": { + "name": "comment.line.jsonselection", + "match": "(\\s*)(#).*", + "captures": { + "1": { + "name": "punctuation.whitespace.comment.leading.jsonselection" + } + } + }, "JSONSelectionString": { "contentName": "string.quoted.JSONSelectionString", "begin": "((\"))", diff --git a/syntaxes/connectors.jsonselection.yaml b/syntaxes/connectors.jsonselection.yaml index 2e4b04c1..996ac386 100644 --- a/syntaxes/connectors.jsonselection.yaml +++ b/syntaxes/connectors.jsonselection.yaml @@ -12,6 +12,7 @@ repository: patterns: - include: "#PathSelection" - include: "#NamedSelection" + - include: "#Comment" # SubSelection ::= "{" NamedSelection* "}" SubSelection: name: "meta.SubSelection" @@ -25,6 +26,7 @@ repository: name: "punctuation.SubSelection.close" patterns: - include: "#NamedSelection" + - include: "#Comment" # NamedSelection ::= NamedPathSelection | PathWithSubSelection | NamedFieldSelection | NamedGroupSelection NamedSelection: name: "meta.NamedSelection" @@ -232,6 +234,12 @@ repository: # SpacesOrComments ::= (Spaces | Comment)+ # Spaces ::= ("⎵" | "\t" | "\r" | "\n")+ # Comment ::= "#" [^\n]* + Comment: + name: "comment.line.jsonselection" + match: "(\\s*)(#).*" + captures: + "1": + name: "punctuation.whitespace.comment.leading.jsonselection" # additional rules used for strings, e.g. in `POST: "/foo/bar/{$id}"` JSONSelectionString: From b1ff896f054811edfb65226fbb009681c6d2ede1 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Mon, 28 Oct 2024 15:32:37 +0100 Subject: [PATCH 14/34] update one grammar, move things --- package.json | 4 +++- .../fixtures/{ => textmate}/test.apollo.jsonselection | 0 .../fixtures/{ => textmate}/test.apollo.jsonselection.snap | 0 .../__tests__/fixtures/documents/functionCall.ts.snap | 6 +++--- 4 files changed, 6 insertions(+), 4 deletions(-) rename src/__tests__/fixtures/{ => textmate}/test.apollo.jsonselection (100%) rename src/__tests__/fixtures/{ => textmate}/test.apollo.jsonselection.snap (100%) diff --git a/package.json b/package.json index 74a18864..6a7d4c7d 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,9 @@ "format": "prettier --write .", "test": "NODE_OPTIONS=--experimental-vm-modules jest", "test:extension": "node src/__e2e__/runTests.js", - "test:textmate": "npx vscode-tmgrammar-snap -s source.ts -g src/language-server/__tests__/fixtures/TypeScript.tmLanguage.json src/language-server/__tests__/fixtures/documents/*.ts", + "test:textmate": "npm run test:textmate-ts && npm run test:textmate-jsonselection", + "test:textmate-ts": "npx vscode-tmgrammar-snap -s source.ts -g src/language-server/__tests__/fixtures/TypeScript.tmLanguage.json src/language-server/__tests__/fixtures/documents/*.ts", + "test:textmate-jsonselection": "npx vscode-tmgrammar-snap -s source.apollo.jsonselection src/__tests__/fixtures/textmate/*.jsonselection", "codegen": "graphql-codegen", "vscode:prepublish": "npm run build:production" }, diff --git a/src/__tests__/fixtures/test.apollo.jsonselection b/src/__tests__/fixtures/textmate/test.apollo.jsonselection similarity index 100% rename from src/__tests__/fixtures/test.apollo.jsonselection rename to src/__tests__/fixtures/textmate/test.apollo.jsonselection diff --git a/src/__tests__/fixtures/test.apollo.jsonselection.snap b/src/__tests__/fixtures/textmate/test.apollo.jsonselection.snap similarity index 100% rename from src/__tests__/fixtures/test.apollo.jsonselection.snap rename to src/__tests__/fixtures/textmate/test.apollo.jsonselection.snap diff --git a/src/language-server/__tests__/fixtures/documents/functionCall.ts.snap b/src/language-server/__tests__/fixtures/documents/functionCall.ts.snap index b521f100..c4b1b3c4 100644 --- a/src/language-server/__tests__/fixtures/documents/functionCall.ts.snap +++ b/src/language-server/__tests__/fixtures/documents/functionCall.ts.snap @@ -413,11 +413,11 @@ #^^^ source.ts variable.other.readwrite.ts >( #^ source.ts meta.brace.round.ts -> `query { test }` +> `query Q11 { test }` #^^ source.ts # ^ source.ts string.template.ts punctuation.definition.string.template.begin.ts -# ^^^^^^^^^^^^^^ source.ts string.template.ts -# ^ source.ts string.template.ts punctuation.definition.string.template.end.ts +# ^^^^^^^^^^^^^^^^^^ source.ts string.template.ts +# ^ source.ts string.template.ts punctuation.definition.string.template.end.ts > ) #^^ source.ts # ^ source.ts meta.brace.round.ts From 0ea12de909a837847cdedc704c80f4278f3ec879 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Mon, 28 Oct 2024 15:35:49 +0100 Subject: [PATCH 15/34] uncomment --- syntaxes/connectors.jsonselection.json | 6 ++++++ syntaxes/connectors.jsonselection.yaml | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/syntaxes/connectors.jsonselection.json b/syntaxes/connectors.jsonselection.json index 4bfb6fef..4bb4daad 100644 --- a/syntaxes/connectors.jsonselection.json +++ b/syntaxes/connectors.jsonselection.json @@ -50,11 +50,17 @@ "NamedSelection": { "name": "meta.NamedSelection", "patterns": [ + { + "include": "#PathWithSubSelection" + }, { "include": "#NamedFieldSelection" }, { "include": "#NamedPathSelection" + }, + { + "include": "#NamedGroupSelection" } ] }, diff --git a/syntaxes/connectors.jsonselection.yaml b/syntaxes/connectors.jsonselection.yaml index 996ac386..672b1512 100644 --- a/syntaxes/connectors.jsonselection.yaml +++ b/syntaxes/connectors.jsonselection.yaml @@ -31,10 +31,10 @@ repository: NamedSelection: name: "meta.NamedSelection" patterns: - # - include: "#PathWithSubSelection" + - include: "#PathWithSubSelection" - include: "#NamedFieldSelection" - include: "#NamedPathSelection" - # - include: "#NamedGroupSelection" + - include: "#NamedGroupSelection" # NamedPathSelection ::= Alias PathSelection NamedPathSelection: begin: "\\b([a-zA-Z][0-9a-zA-Z_]*)\\s*(:)" From 5b85408a1735dcce352df49664d8daa8e1d6a8fc Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Tue, 29 Oct 2024 12:10:58 +0100 Subject: [PATCH 16/34] flip some priorities --- .../textmate/test.apollo.jsonselection.snap | 1032 +++++++++-------- syntaxes/connectors.jsonselection.json | 10 +- syntaxes/connectors.jsonselection.yaml | 6 +- 3 files changed, 541 insertions(+), 507 deletions(-) diff --git a/src/__tests__/fixtures/textmate/test.apollo.jsonselection.snap b/src/__tests__/fixtures/textmate/test.apollo.jsonselection.snap index d0c5bc4f..9235a2a3 100644 --- a/src/__tests__/fixtures/textmate/test.apollo.jsonselection.snap +++ b/src/__tests__/fixtures/textmate/test.apollo.jsonselection.snap @@ -2,134 +2,156 @@ #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection > >id -#^^ source.apollo.jsonselection variable.KeyPath.key.identifier +#^^ source.apollo.jsonselection variable.NamedFieldSelection.key >name -#^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +#^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key >abc: some.nested.path { a b c } -#^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^^^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^^^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection +#^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection meta.SubSelection +# ^ source.apollo.jsonselection meta.SubSelection punctuation.SubSelection.open +# ^ source.apollo.jsonselection meta.SubSelection +# ^ source.apollo.jsonselection meta.SubSelection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection meta.SubSelection +# ^ source.apollo.jsonselection meta.SubSelection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection meta.SubSelection +# ^ source.apollo.jsonselection meta.SubSelection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection meta.SubSelection +# ^ source.apollo.jsonselection meta.SubSelection punctuation.SubSelection.close >id -#^^ source.apollo.jsonselection variable.KeyPath.key.identifier +#^^ source.apollo.jsonselection variable.NamedFieldSelection.key >name -#^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +#^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key >some.nested.path { a b c } -#^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^^^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^^^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection +#^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection meta.SubSelection +# ^ source.apollo.jsonselection meta.SubSelection punctuation.SubSelection.open +# ^ source.apollo.jsonselection meta.SubSelection +# ^ source.apollo.jsonselection meta.SubSelection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection meta.SubSelection +# ^ source.apollo.jsonselection meta.SubSelection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection meta.SubSelection +# ^ source.apollo.jsonselection meta.SubSelection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection meta.SubSelection +# ^ source.apollo.jsonselection meta.SubSelection punctuation.SubSelection.close >names: { -#^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^^ source.apollo.jsonselection +#^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection +# ^^ source.apollo.jsonselection > first: firstName #^^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key > last: lastName #^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key >} #^ source.apollo.jsonselection ># Also allowed: #^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection >firstName -#^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +#^^^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key >lastName -#^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +#^^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key >postID -#^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +#^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key >title -#^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +#^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key >author: { -#^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^^ source.apollo.jsonselection +#^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection +# ^^ source.apollo.jsonselection > id: authorID #^^ source.apollo.jsonselection -# ^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key > name: authorName #^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key >} #^ source.apollo.jsonselection > title #^^^^^^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key > year: publication.year #^^^^^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key > authorName: author.name #^^^^^^ source.apollo.jsonselection -# ^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key >id -#^^ source.apollo.jsonselection variable.KeyPath.key.identifier +#^^ source.apollo.jsonselection variable.NamedFieldSelection.key >created -#^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +#^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key >model -#^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +#^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key > ># The { role content } SubSelection is mandatory so the output keys #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection ># can be statically determined: #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection >choices->first.message { role content } -#^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^ source.apollo.jsonselection -# ^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection +#^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection meta.SubSelection +# ^ source.apollo.jsonselection meta.SubSelection punctuation.SubSelection.open +# ^ source.apollo.jsonselection meta.SubSelection +# ^^^^ source.apollo.jsonselection meta.SubSelection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection meta.SubSelection +# ^^^^^^^ source.apollo.jsonselection meta.SubSelection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection meta.SubSelection +# ^ source.apollo.jsonselection meta.SubSelection punctuation.SubSelection.close > ># Multiple PathWithSubSelections are allowed in the same SubSelection: #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection >choices->last.message { lastContent: content } -#^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^^^ source.apollo.jsonselection -# ^^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection +#^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection meta.SubSelection +# ^ source.apollo.jsonselection meta.SubSelection punctuation.SubSelection.open +# ^ source.apollo.jsonselection meta.SubSelection +# ^^^^^^^^^^^ source.apollo.jsonselection meta.SubSelection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection meta.SubSelection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection meta.SubSelection +# ^^^^^^^ source.apollo.jsonselection meta.SubSelection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection meta.SubSelection +# ^ source.apollo.jsonselection meta.SubSelection punctuation.SubSelection.close > # For some reason /users/{$args.id} returns an object with name #^^^^^^ source.apollo.jsonselection comment.line.jsonselection punctuation.whitespace.comment.leading.jsonselection # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection @@ -138,95 +160,113 @@ # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection > id: $args.id #^^^^^^ source.apollo.jsonselection -# ^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection +# ^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection +# ^ source.apollo.jsonselection # ^ source.apollo.jsonselection variable.ExprPath.dollar -# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^^ source.apollo.jsonselection variable.NamedFieldSelection.key > name #^^^^^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key > email #^^^^^^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key >id name friends: friend_ids { id: $ } -#^^ source.apollo.jsonselection variable.KeyPath.key.identifier +#^^ source.apollo.jsonselection variable.NamedFieldSelection.key # ^ source.apollo.jsonselection # ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key # ^ source.apollo.jsonselection -# ^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^^ source.apollo.jsonselection -# ^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.ExprPath.dollar -# ^^ source.apollo.jsonselection +# ^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection meta.SubSelection +# ^ source.apollo.jsonselection meta.SubSelection punctuation.SubSelection.open +# ^ source.apollo.jsonselection meta.SubSelection +# ^^ source.apollo.jsonselection meta.SubSelection string.unquoted.NamedPathSelection.alias +# ^ source.apollo.jsonselection meta.SubSelection punctuation.colon.NamedPathSelection +# ^ source.apollo.jsonselection meta.SubSelection +# ^ source.apollo.jsonselection meta.SubSelection variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.SubSelection +# ^ source.apollo.jsonselection meta.SubSelection punctuation.SubSelection.close >items: data.nested.items { id name } -#^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^^^ source.apollo.jsonselection -# ^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection +#^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection meta.SubSelection +# ^ source.apollo.jsonselection meta.SubSelection punctuation.SubSelection.open +# ^ source.apollo.jsonselection meta.SubSelection +# ^^ source.apollo.jsonselection meta.SubSelection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection meta.SubSelection +# ^^^^ source.apollo.jsonselection meta.SubSelection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection meta.SubSelection +# ^ source.apollo.jsonselection meta.SubSelection punctuation.SubSelection.close >firstItem: data.nested.items->first { id name } -#^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^^^ source.apollo.jsonselection -# ^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection +#^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection meta.SubSelection +# ^ source.apollo.jsonselection meta.SubSelection punctuation.SubSelection.open +# ^ source.apollo.jsonselection meta.SubSelection +# ^^ source.apollo.jsonselection meta.SubSelection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection meta.SubSelection +# ^^^^ source.apollo.jsonselection meta.SubSelection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection meta.SubSelection +# ^ source.apollo.jsonselection meta.SubSelection punctuation.SubSelection.close >firstItemName: data.nested.items->first.name -#^^^^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +#^^^^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key >$.data { id name } #^ source.apollo.jsonselection variable.ExprPath.dollar # ^ source.apollo.jsonselection variable.PathStep.dot # ^^^^ source.apollo.jsonselection variable.PathStep.key.identifier # ^^^ source.apollo.jsonselection -# ^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection variable.NamedFieldSelection.key # ^ source.apollo.jsonselection # ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key # ^^ source.apollo.jsonselection >id: data.id -#^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^ source.apollo.jsonselection variable.PathStep.key.identifier +#^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^^ source.apollo.jsonselection variable.NamedFieldSelection.key >name: data.name -#^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +#^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key >all: $.first->and($.second)->and($.third) -#^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection +#^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection +# ^ source.apollo.jsonselection # ^ source.apollo.jsonselection variable.ExprPath.dollar # ^ source.apollo.jsonselection variable.PathStep.dot # ^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier @@ -245,76 +285,68 @@ # ^^^^^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close >wrapped: field->echo({ fieldValue: @ }) -#^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject punctuation.LitObject.open -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject -# ^^^^^^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty variable.LitProperty.key -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty punctuation.colon.LitProperty -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty variable.AtPath.at -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject punctuation.LitObject.close -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +#^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^^ source.apollo.jsonselection +# ^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection +# ^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.AtPath.at +# ^^^ source.apollo.jsonselection >children: parent->echo([@.child1, @.child2, @.child3]) -#^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.LitArray.open -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray variable.AtPath.at -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray variable.PathStep.dot -# ^^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray variable.PathStep.key.identifier -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.comma.LitArray.separator -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray variable.AtPath.at -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray variable.PathStep.dot -# ^^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray variable.PathStep.key.identifier -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.comma.LitArray.separator -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray variable.AtPath.at -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray variable.PathStep.dot -# ^^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray variable.PathStep.key.identifier -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.LitArray.close -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +#^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.AtPath.at +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.AtPath.at +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.AtPath.at +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^^ source.apollo.jsonselection >doubled: numbers->map({ value: @->mul(2) }) -#^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject punctuation.LitObject.open -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject -# ^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty variable.LitProperty.key -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty punctuation.colon.LitProperty -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty variable.AtPath.at -# ^^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty meta.MethodArgs constant.numeric.LitNumber -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty meta.MethodArgs punctuation.brace.round.MethodArgs.close -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject punctuation.LitObject.close -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +#^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^^ source.apollo.jsonselection +# ^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection +# ^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.AtPath.at +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs constant.numeric.LitNumber +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +# ^^^ source.apollo.jsonselection >types: values->map(@->typeof) -#^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.AtPath.at -# ^^ source.apollo.jsonselection meta.MethodArgs punctuation.PathStep.arrow -# ^^^^^^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +#^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.AtPath.at +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection >__typename: $("Product") #^^ source.apollo.jsonselection # ^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier @@ -324,15 +356,17 @@ # ^^^^^^^^^ source.apollo.jsonselection meta.ExprPathArgs string.quoted.LitString # ^ source.apollo.jsonselection meta.ExprPathArgs punctuation.brace.round.ExprPathArgs.close >condition: $(true) -#^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection +#^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection +# ^ source.apollo.jsonselection # ^ source.apollo.jsonselection variable.ExprPath.dollar # ^ source.apollo.jsonselection meta.ExprPathArgs punctuation.brace.round.ExprPathArgs.open # ^^^^ source.apollo.jsonselection meta.ExprPathArgs constant.language.LitPrimitive # ^ source.apollo.jsonselection meta.ExprPathArgs punctuation.brace.round.ExprPathArgs.close >alphabetSlice: $("abcdefghijklmnopqrstuvwxyz")->slice($args.start, $args.end) -#^^^^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection +#^^^^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection +# ^ source.apollo.jsonselection # ^ source.apollo.jsonselection variable.ExprPath.dollar # ^ source.apollo.jsonselection meta.ExprPathArgs punctuation.brace.round.ExprPathArgs.open # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection meta.ExprPathArgs string.quoted.LitString @@ -352,26 +386,27 @@ # ^^^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close >suffix: results.slice($(-1)->mul($args.suffixLength)) -#^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar -# ^ source.apollo.jsonselection meta.MethodArgs meta.ExprPathArgs punctuation.brace.round.ExprPathArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs meta.ExprPathArgs -# ^ source.apollo.jsonselection meta.MethodArgs meta.ExprPathArgs constant.numeric.LitNumber -# ^ source.apollo.jsonselection meta.MethodArgs meta.ExprPathArgs punctuation.brace.round.ExprPathArgs.close -# ^^ source.apollo.jsonselection meta.MethodArgs punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs meta.MethodArgs variable.ExprPath.dollar -# ^^^^ source.apollo.jsonselection meta.MethodArgs meta.MethodArgs variable.KeyPath.key.identifier -# ^ source.apollo.jsonselection meta.MethodArgs meta.MethodArgs variable.PathStep.dot -# ^^^^^^^^^^^^ source.apollo.jsonselection meta.MethodArgs meta.MethodArgs variable.PathStep.key.identifier -# ^ source.apollo.jsonselection meta.MethodArgs meta.MethodArgs punctuation.brace.round.MethodArgs.close -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +#^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.ExprPathArgs punctuation.brace.round.ExprPathArgs.open +# ^ source.apollo.jsonselection meta.ExprPathArgs +# ^ source.apollo.jsonselection meta.ExprPathArgs constant.numeric.LitNumber +# ^ source.apollo.jsonselection meta.ExprPathArgs punctuation.brace.round.ExprPathArgs.close +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^^^^ source.apollo.jsonselection meta.MethodArgs variable.KeyPath.key.identifier +# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot +# ^^^^^^^^^^^^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +# ^ source.apollo.jsonselection ># The ->echo method returns its first input argument as-is, ignoring #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection ># the input data. Useful for embedding literal values, as in @@ -389,21 +424,18 @@ # ^^^^^^ source.apollo.jsonselection meta.MethodArgs string.quoted.LitString # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close >wrapped: field->echo({ fieldValue: @ }) -#^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject punctuation.LitObject.open -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject -# ^^^^^^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty variable.LitProperty.key -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty punctuation.colon.LitProperty -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty variable.AtPath.at -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject punctuation.LitObject.close -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +#^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^^ source.apollo.jsonselection +# ^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection +# ^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.AtPath.at +# ^^^ source.apollo.jsonselection > ># Returns the type of the data as a string, e.g. "object", "array", #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection @@ -412,11 +444,12 @@ ># "object" in JavaScript but "null" for our purposes. #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection >typeOfValue: value->typeof -#^^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^^^^ source.apollo.jsonselection variable.PathStep.identifier +#^^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key > ># When invoked against an array, ->map evaluates its first argument #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection @@ -429,46 +462,49 @@ ># result without wrapping it in an array. #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection >doubled: numbers->map(@->mul(2)) -#^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.AtPath.at -# ^^ source.apollo.jsonselection meta.MethodArgs punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs meta.MethodArgs constant.numeric.LitNumber -# ^ source.apollo.jsonselection meta.MethodArgs meta.MethodArgs punctuation.brace.round.MethodArgs.close -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +#^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.AtPath.at +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.jsonselection meta.MethodArgs constant.numeric.LitNumber +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +# ^ source.apollo.jsonselection >types: values->map(@->typeof) -#^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.AtPath.at -# ^^ source.apollo.jsonselection meta.MethodArgs punctuation.PathStep.arrow -# ^^^^^^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +#^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.AtPath.at +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^^^^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection > ># Returns true if the data is deeply equal to the first argument, false #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection ># otherwise. Equality is solely value-based (all JSON), no references. #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection >isObject: value->typeof->eq("object") -#^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^^^^^^^^ source.apollo.jsonselection meta.MethodArgs string.quoted.LitString -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +#^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^ source.apollo.jsonselection > ># Takes any number of pairs [candidate, value], and returns value for #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection @@ -482,35 +518,28 @@ #^^ source.apollo.jsonselection # ^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier # ^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection > ["dog", "Canine"], -#^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.LitArray.open -# ^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray string.quoted.LitString -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.comma.LitArray.separator -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray -# ^^^^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray string.quoted.LitString -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.LitArray.close -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.comma.MethodArgs.separator +#^^^^^ source.apollo.jsonselection +# ^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection > ["cat", "Feline"], -#^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.LitArray.open -# ^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray string.quoted.LitString -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.comma.LitArray.separator -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray -# ^^^^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray string.quoted.LitString -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.LitArray.close -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.comma.MethodArgs.separator +#^^^^^ source.apollo.jsonselection +# ^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection +# ^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection > ["Exotic"] -#^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.LitArray.open -# ^^^^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray string.quoted.LitString -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.LitArray.close +#^^^^^ source.apollo.jsonselection +# ^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^ source.apollo.jsonselection >) -#^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +#^ source.apollo.jsonselection > ># Like ->match, but expects the first element of each pair to evaluate #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection @@ -524,56 +553,49 @@ #^^ source.apollo.jsonselection # ^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier # ^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^^^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection > [@->eq("dog"), "Canine"], -#^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.LitArray.open -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray variable.AtPath.at -# ^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.PathStep.arrow -# ^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray meta.MethodArgs string.quoted.LitString -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray meta.MethodArgs punctuation.brace.round.MethodArgs.close -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.comma.LitArray.separator -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray -# ^^^^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray string.quoted.LitString -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.LitArray.close -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.comma.MethodArgs.separator +#^^^^^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.AtPath.at +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^^^^^ source.apollo.jsonselection meta.MethodArgs string.quoted.LitString +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +# ^^ source.apollo.jsonselection +# ^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection > [@->eq("cat"), "Feline"], -#^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.LitArray.open -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray variable.AtPath.at -# ^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.PathStep.arrow -# ^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray meta.MethodArgs string.quoted.LitString -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray meta.MethodArgs punctuation.brace.round.MethodArgs.close -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.comma.LitArray.separator -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray -# ^^^^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray string.quoted.LitString -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.LitArray.close -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.comma.MethodArgs.separator +#^^^^^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.AtPath.at +# ^^ source.apollo.jsonselection punctuation.PathStep.arrow +# ^^ source.apollo.jsonselection variable.PathStep.identifier +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^^^^^ source.apollo.jsonselection meta.MethodArgs string.quoted.LitString +# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +# ^^ source.apollo.jsonselection +# ^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection > [true, "Exotic"] -#^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.LitArray.open -# ^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray constant.language.LitPrimitive -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.comma.LitArray.separator -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray -# ^^^^^^^^ source.apollo.jsonselection meta.MethodArgs meta.LitArray string.quoted.LitString -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitArray punctuation.LitArray.close +#^^^^^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^ source.apollo.jsonselection >) -#^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +#^ source.apollo.jsonselection > ># Arithmetic methods, supporting both integers and floating point values, #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection ># similar to JavaScript. #^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection >sum: $.a->add($.b)->add($.c) -#^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection +#^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection +# ^ source.apollo.jsonselection # ^ source.apollo.jsonselection variable.ExprPath.dollar # ^ source.apollo.jsonselection variable.PathStep.dot # ^ source.apollo.jsonselection variable.PathStep.key.identifier @@ -592,8 +614,9 @@ # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close >difference: $.a->sub($.b)->sub($.c) -#^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection +#^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection +# ^ source.apollo.jsonselection # ^ source.apollo.jsonselection variable.ExprPath.dollar # ^ source.apollo.jsonselection variable.PathStep.dot # ^ source.apollo.jsonselection variable.PathStep.key.identifier @@ -612,8 +635,9 @@ # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close >product: $.a->mul($.b, $.c) -#^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection +#^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection +# ^ source.apollo.jsonselection # ^ source.apollo.jsonselection variable.ExprPath.dollar # ^ source.apollo.jsonselection variable.PathStep.dot # ^ source.apollo.jsonselection variable.PathStep.key.identifier @@ -630,8 +654,9 @@ # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close >quotient: $.a->div($.b) -#^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection +#^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection +# ^ source.apollo.jsonselection # ^ source.apollo.jsonselection variable.ExprPath.dollar # ^ source.apollo.jsonselection variable.PathStep.dot # ^ source.apollo.jsonselection variable.PathStep.key.identifier @@ -643,8 +668,9 @@ # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close >remainder: $.a->mod($.b) -#^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection +#^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection +# ^ source.apollo.jsonselection # ^ source.apollo.jsonselection variable.ExprPath.dollar # ^ source.apollo.jsonselection variable.PathStep.dot # ^ source.apollo.jsonselection variable.PathStep.key.identifier @@ -659,78 +685,72 @@ ># Array/string methods #^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection >first: list->first -#^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^^^ source.apollo.jsonselection variable.PathStep.identifier +#^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key >last: list->last -#^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^^ source.apollo.jsonselection variable.PathStep.identifier +#^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key >index3: list->get(3) -#^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs constant.numeric.LitNumber -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close ->secondToLast: list->get(-2) -#^^^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +#^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key # ^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs -# ^ source.apollo.jsonselection meta.MethodArgs constant.numeric.LitNumber -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +# ^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^^ source.apollo.jsonselection +>secondToLast: list->get(-2) +#^^^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^^^ source.apollo.jsonselection >slice: list->slice(0, 5) -#^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs constant.numeric.LitNumber -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.comma.MethodArgs.separator -# ^ source.apollo.jsonselection meta.MethodArgs -# ^ source.apollo.jsonselection meta.MethodArgs constant.numeric.LitNumber -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +#^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^^^^^ source.apollo.jsonselection >substring: string->slice(2, 5) -#^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs constant.numeric.LitNumber -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.comma.MethodArgs.separator -# ^ source.apollo.jsonselection meta.MethodArgs -# ^ source.apollo.jsonselection meta.MethodArgs constant.numeric.LitNumber -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +#^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^^^^^ source.apollo.jsonselection >arraySize: array->size -#^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^^ source.apollo.jsonselection variable.PathStep.identifier +#^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key >stringLength: string->size -#^^^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^^ source.apollo.jsonselection variable.PathStep.identifier +#^^^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key > ># Object methods #^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection >aValue: $->echo({ a: 123 })->get("a") -#^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection +#^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection +# ^ source.apollo.jsonselection # ^ source.apollo.jsonselection variable.ExprPath.dollar # ^^ source.apollo.jsonselection punctuation.PathStep.arrow # ^^^^ source.apollo.jsonselection variable.PathStep.identifier @@ -750,87 +770,95 @@ # ^^^ source.apollo.jsonselection meta.MethodArgs string.quoted.LitString # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close >hasKey: object->has("key") -#^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^^^^^ source.apollo.jsonselection meta.MethodArgs string.quoted.LitString -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +#^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^ source.apollo.jsonselection >hasAB: object->has("a")->and(object->has("b")) -#^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^^^ source.apollo.jsonselection meta.MethodArgs string.quoted.LitString -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^^^^^^ source.apollo.jsonselection meta.MethodArgs variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection meta.MethodArgs punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^^^ source.apollo.jsonselection meta.MethodArgs meta.MethodArgs string.quoted.LitString -# ^ source.apollo.jsonselection meta.MethodArgs meta.MethodArgs punctuation.brace.round.MethodArgs.close -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +#^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^^ source.apollo.jsonselection +# ^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^ source.apollo.jsonselection >numberOfProperties: object->size -#^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^^ source.apollo.jsonselection variable.PathStep.identifier +#^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key >keys: object->keys -#^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^^ source.apollo.jsonselection variable.PathStep.identifier +#^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key >values: object->values -#^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^^^^ source.apollo.jsonselection variable.PathStep.identifier +#^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key >entries: object->entries -#^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^^^^^ source.apollo.jsonselection variable.PathStep.identifier ->keysFromEntries: object->entries.key -#^^^^^^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +#^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key # ^^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^^^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +>keysFromEntries: object->entries.key +#^^^^^^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^^^ source.apollo.jsonselection variable.NamedFieldSelection.key >valuesFromEntries: object->entries.value -#^^^^^^^^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^^^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +#^^^^^^^^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection +# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^^ source.apollo.jsonselection +# ^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key > ># Logical methods #^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection >negation: $.condition->not -#^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection +#^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection +# ^ source.apollo.jsonselection # ^ source.apollo.jsonselection variable.ExprPath.dollar # ^ source.apollo.jsonselection variable.PathStep.dot # ^^^^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier # ^^ source.apollo.jsonselection punctuation.PathStep.arrow # ^^^ source.apollo.jsonselection variable.PathStep.identifier >bangBang: $.condition->not->not -#^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection +#^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection +# ^ source.apollo.jsonselection # ^ source.apollo.jsonselection variable.ExprPath.dollar # ^ source.apollo.jsonselection variable.PathStep.dot # ^^^^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier @@ -839,8 +867,9 @@ # ^^ source.apollo.jsonselection punctuation.PathStep.arrow # ^^^ source.apollo.jsonselection variable.PathStep.identifier >disjunction: $.a->or($.b)->or($.c) -#^^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection +#^^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection +# ^ source.apollo.jsonselection # ^ source.apollo.jsonselection variable.ExprPath.dollar # ^ source.apollo.jsonselection variable.PathStep.dot # ^ source.apollo.jsonselection variable.PathStep.key.identifier @@ -859,8 +888,9 @@ # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close >conjunction: $.a->and($.b, $.c) -#^^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection +#^^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection +# ^ source.apollo.jsonselection # ^ source.apollo.jsonselection variable.ExprPath.dollar # ^ source.apollo.jsonselection variable.PathStep.dot # ^ source.apollo.jsonselection variable.PathStep.key.identifier @@ -877,8 +907,9 @@ # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close >aImpliesB: $.a->not->or($.b) -#^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection +#^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection +# ^ source.apollo.jsonselection # ^ source.apollo.jsonselection variable.ExprPath.dollar # ^ source.apollo.jsonselection variable.PathStep.dot # ^ source.apollo.jsonselection variable.PathStep.key.identifier @@ -892,8 +923,9 @@ # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close >excludedMiddle: $.toBe->or($.toBe->not)->eq(true) -#^^^^^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection +#^^^^^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection +# ^ source.apollo.jsonselection # ^ source.apollo.jsonselection variable.ExprPath.dollar # ^ source.apollo.jsonselection variable.PathStep.dot # ^^^^ source.apollo.jsonselection variable.PathStep.key.identifier diff --git a/syntaxes/connectors.jsonselection.json b/syntaxes/connectors.jsonselection.json index 4bb4daad..eadc5d01 100644 --- a/syntaxes/connectors.jsonselection.json +++ b/syntaxes/connectors.jsonselection.json @@ -14,10 +14,10 @@ "name": "meta.JSONSelection", "patterns": [ { - "include": "#PathSelection" + "include": "#NamedSelection" }, { - "include": "#NamedSelection" + "include": "#PathSelection" }, { "include": "#Comment" @@ -50,15 +50,15 @@ "NamedSelection": { "name": "meta.NamedSelection", "patterns": [ - { - "include": "#PathWithSubSelection" - }, { "include": "#NamedFieldSelection" }, { "include": "#NamedPathSelection" }, + { + "include": "#PathWithSubSelection" + }, { "include": "#NamedGroupSelection" } diff --git a/syntaxes/connectors.jsonselection.yaml b/syntaxes/connectors.jsonselection.yaml index 672b1512..0e315f20 100644 --- a/syntaxes/connectors.jsonselection.yaml +++ b/syntaxes/connectors.jsonselection.yaml @@ -1,5 +1,7 @@ # use 'js-yaml' to convert to json # npx js-yaml syntaxes/connectors.jsonselection.yaml >| syntaxes/connectors.jsonselection.json +# fswatch -0 syntaxes/connectors.jsonselection.yaml | xargs -0 -I {} bash -c "npx js-yaml {} > syntaxes/connectors.jsonselection.json && echo saved" \; +# based on https://github.com/apollographql/router/blob/next/apollo-federation/src/sources/connect/json_selection/README.md name: "Apollo Connectors JSONSelection" scopeName: "source.apollo.jsonselection" patterns: @@ -10,8 +12,8 @@ repository: JSONSelection: name: "meta.JSONSelection" patterns: - - include: "#PathSelection" - include: "#NamedSelection" + - include: "#PathSelection" - include: "#Comment" # SubSelection ::= "{" NamedSelection* "}" SubSelection: @@ -31,9 +33,9 @@ repository: NamedSelection: name: "meta.NamedSelection" patterns: - - include: "#PathWithSubSelection" - include: "#NamedFieldSelection" - include: "#NamedPathSelection" + - include: "#PathWithSubSelection" - include: "#NamedGroupSelection" # NamedPathSelection ::= Alias PathSelection NamedPathSelection: From 51c573d0daeee983b2df082e91bba26d4de775e0 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Tue, 29 Oct 2024 12:15:00 +0100 Subject: [PATCH 17/34] allow leading underscore in identifiers/keys/aliases --- .../textmate/test.apollo.jsonselection.snap | 24 +++++++++---------- syntaxes/connectors.jsonselection.json | 12 +++++----- syntaxes/connectors.jsonselection.yaml | 12 +++++----- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/__tests__/fixtures/textmate/test.apollo.jsonselection.snap b/src/__tests__/fixtures/textmate/test.apollo.jsonselection.snap index 9235a2a3..580a41da 100644 --- a/src/__tests__/fixtures/textmate/test.apollo.jsonselection.snap +++ b/src/__tests__/fixtures/textmate/test.apollo.jsonselection.snap @@ -348,9 +348,9 @@ # ^^^^^^ source.apollo.jsonselection variable.PathStep.identifier # ^ source.apollo.jsonselection >__typename: $("Product") -#^^ source.apollo.jsonselection -# ^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection +#^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection +# ^ source.apollo.jsonselection # ^ source.apollo.jsonselection variable.ExprPath.dollar # ^ source.apollo.jsonselection meta.ExprPathArgs punctuation.brace.round.ExprPathArgs.open # ^^^^^^^^^ source.apollo.jsonselection meta.ExprPathArgs string.quoted.LitString @@ -414,9 +414,9 @@ ># $->echo("give me this string"), or wrapping the input value. #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection >__typename: $->echo("Book") -#^^ source.apollo.jsonselection -# ^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection +#^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection +# ^ source.apollo.jsonselection # ^ source.apollo.jsonselection variable.ExprPath.dollar # ^^ source.apollo.jsonselection punctuation.PathStep.arrow # ^^^^ source.apollo.jsonselection variable.PathStep.identifier @@ -515,9 +515,9 @@ ># [] array as the final argument guarantees a default value. #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection >__typename: kind->match( -#^^ source.apollo.jsonselection -# ^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection +#^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection # ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key # ^^ source.apollo.jsonselection # ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key @@ -550,9 +550,9 @@ ># easy, since the last pair can be [true, ]. #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection >__typename: kind->matchIf( -#^^ source.apollo.jsonselection -# ^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection +#^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection +# ^ source.apollo.jsonselection # ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key # ^^ source.apollo.jsonselection # ^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key diff --git a/syntaxes/connectors.jsonselection.json b/syntaxes/connectors.jsonselection.json index eadc5d01..7702b6c6 100644 --- a/syntaxes/connectors.jsonselection.json +++ b/syntaxes/connectors.jsonselection.json @@ -65,7 +65,7 @@ ] }, "NamedPathSelection": { - "begin": "\\b([a-zA-Z][0-9a-zA-Z_]*)\\s*(:)", + "begin": "\\b([a-zA-Z_][0-9a-zA-Z_]*)\\s*(:)", "beginCaptures": { "1": { "name": "string.unquoted.NamedPathSelection.alias" @@ -83,7 +83,7 @@ ] }, "NamedFieldSelection": { - "begin": "\\b(?:([a-zA-Z][0-9a-zA-Z_]*)\\s*(:))?\\s*([a-zA-Z][0-9a-zA-Z_]*)\\b(?!\\s*:)", + "begin": "\\b(?:([a-zA-Z_][0-9a-zA-Z_]*)\\s*(:))?\\s*([a-zA-Z_][0-9a-zA-Z_]*)\\b(?!\\s*:)", "beginCaptures": { "1": { "name": "string.unquoted.NamedFieldSelection.alias" @@ -134,7 +134,7 @@ ] }, "VarPath": { - "begin": "(\\$)([a-zA-Z][0-9a-zA-Z_]*)?(?!\\w)", + "begin": "(\\$)([a-zA-Z_][0-9a-zA-Z_]*)?(?!\\w)", "beginCaptures": { "1": { "name": "variable.VarPath.dollar" @@ -152,7 +152,7 @@ ] }, "KeyPath": { - "begin": "([a-zA-Z][0-9a-zA-Z_]*|\"[^\"]*\"|'[^']*')", + "begin": "([a-zA-Z_][0-9a-zA-Z_]*|\"[^\"]*\"|'[^']*')", "beginCaptures": { "1": { "name": "variable.KeyPath.key.identifier" @@ -217,7 +217,7 @@ ] }, "PathStep": { - "begin": "(\\.)([a-zA-Z][0-9a-zA-Z_]*|\"[^\"]*\"|'[^']*')|(->)([a-zA-Z][0-9a-zA-Z_]*)", + "begin": "(\\.)([a-zA-Z_][0-9a-zA-Z_]*|\"[^\"]*\"|'[^']*')|(->)([a-zA-Z_][0-9a-zA-Z_]*)", "end": "(?=.)", "applyEndPatternLast": 1, "beginCaptures": { @@ -328,7 +328,7 @@ }, "LitProperty": { "name": "meta.LitProperty", - "begin": "\\b([a-zA-Z][0-9a-zA-Z_]*)\\s*(:)\\s*", + "begin": "\\b([a-zA-Z_][0-9a-zA-Z_]*)\\s*(:)\\s*", "beginCaptures": { "1": { "name": "variable.LitProperty.key" diff --git a/syntaxes/connectors.jsonselection.yaml b/syntaxes/connectors.jsonselection.yaml index 0e315f20..4c88e602 100644 --- a/syntaxes/connectors.jsonselection.yaml +++ b/syntaxes/connectors.jsonselection.yaml @@ -39,7 +39,7 @@ repository: - include: "#NamedGroupSelection" # NamedPathSelection ::= Alias PathSelection NamedPathSelection: - begin: "\\b([a-zA-Z][0-9a-zA-Z_]*)\\s*(:)" + begin: "\\b([a-zA-Z_][0-9a-zA-Z_]*)\\s*(:)" beginCaptures: "1": name: "string.unquoted.NamedPathSelection.alias" @@ -51,7 +51,7 @@ repository: - include: "#PathSelection" # NamedFieldSelection ::= Alias? Key SubSelection? NamedFieldSelection: - begin: "\\b(?:([a-zA-Z][0-9a-zA-Z_]*)\\s*(:))?\\s*([a-zA-Z][0-9a-zA-Z_]*)\\b(?!\\s*:)" + begin: "\\b(?:([a-zA-Z_][0-9a-zA-Z_]*)\\s*(:))?\\s*([a-zA-Z_][0-9a-zA-Z_]*)\\b(?!\\s*:)" beginCaptures: "1": name: "string.unquoted.NamedFieldSelection.alias" @@ -82,7 +82,7 @@ repository: - include: "#AtPath" # VarPath ::= "$" (NO_SPACE Identifier)? PathStep* VarPath: - begin: "(\\$)([a-zA-Z][0-9a-zA-Z_]*)?(?!\\w)" + begin: "(\\$)([a-zA-Z_][0-9a-zA-Z_]*)?(?!\\w)" beginCaptures: "1": name: "variable.VarPath.dollar" @@ -94,7 +94,7 @@ repository: - include: "#PathStep" # KeyPath ::= Key PathStep+ KeyPath: - begin: '([a-zA-Z][0-9a-zA-Z_]*|"[^"]*"|''[^'']*'')' + begin: '([a-zA-Z_][0-9a-zA-Z_]*|"[^"]*"|''[^'']*'')' beginCaptures: "1": name: "variable.KeyPath.key.identifier" @@ -135,7 +135,7 @@ repository: - include: "#PathStep" # PathStep ::= "." Key | "->" Identifier MethodArgs? PathStep: - begin: "(\\.)([a-zA-Z][0-9a-zA-Z_]*|\"[^\"]*\"|'[^']*')|(->)([a-zA-Z][0-9a-zA-Z_]*)" + begin: "(\\.)([a-zA-Z_][0-9a-zA-Z_]*|\"[^\"]*\"|'[^']*')|(->)([a-zA-Z_][0-9a-zA-Z_]*)" end: "(?=.)" applyEndPatternLast: 1 beginCaptures: @@ -207,7 +207,7 @@ repository: # LitProperty ::= Key ":" LitExpr LitProperty: name: "meta.LitProperty" - begin: "\\b([a-zA-Z][0-9a-zA-Z_]*)\\s*(:)\\s*" + begin: "\\b([a-zA-Z_][0-9a-zA-Z_]*)\\s*(:)\\s*" beginCaptures: "1": name: "variable.LitProperty.key" From 39c29d22cb2c51c91e85c758e09614f835e353bd Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Tue, 29 Oct 2024 12:15:51 +0100 Subject: [PATCH 18/34] allow PUT|PATCH|DELETE --- syntaxes/graphql.connectors.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/graphql.connectors.json b/syntaxes/graphql.connectors.json index 6236f1ae..453a8d83 100644 --- a/syntaxes/graphql.connectors.json +++ b/syntaxes/graphql.connectors.json @@ -90,7 +90,7 @@ "connect-string-jsonselection-argument": { "name": "meta.argument.connect.string.jsonselection.graphql", "contentName": "meta.embedded.block.string.jsonselection.graphql", - "begin": "\\s*(GET|POST)(?:\\s*(:))", + "begin": "\\s*(GET|POST|PUT|PATCH|DELETE)(?:\\s*(:))", "end": "(?=\\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\\s*(:))|[\\)}]))|\\s*(,)", "beginCaptures": { "1": { "name": "variable.parameter.graphql" }, From 2a72811fffa281b5cabf6ada035e963ac2f70d4a Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Tue, 29 Oct 2024 13:27:54 +0100 Subject: [PATCH 19/34] split out connect-jsonselection-nested-argument, test --- package.json | 3 +- .../fixtures/textmate/test.connect.graphql | 24 +++ .../textmate/test.connect.graphql.snap | 167 ++++++++++++++++++ syntaxes/graphql.connectors.json | 39 ++-- 4 files changed, 215 insertions(+), 18 deletions(-) create mode 100644 src/__tests__/fixtures/textmate/test.connect.graphql create mode 100644 src/__tests__/fixtures/textmate/test.connect.graphql.snap diff --git a/package.json b/package.json index 6a7d4c7d..67921996 100644 --- a/package.json +++ b/package.json @@ -29,9 +29,10 @@ "format": "prettier --write .", "test": "NODE_OPTIONS=--experimental-vm-modules jest", "test:extension": "node src/__e2e__/runTests.js", - "test:textmate": "npm run test:textmate-ts && npm run test:textmate-jsonselection", + "test:textmate": "npm run test:textmate-ts && npm run test:textmate-jsonselection && npm run test:textmate-graphql-jsonselection", "test:textmate-ts": "npx vscode-tmgrammar-snap -s source.ts -g src/language-server/__tests__/fixtures/TypeScript.tmLanguage.json src/language-server/__tests__/fixtures/documents/*.ts", "test:textmate-jsonselection": "npx vscode-tmgrammar-snap -s source.apollo.jsonselection src/__tests__/fixtures/textmate/*.jsonselection", + "test:textmate-graphql-jsonselection": "npx vscode-tmgrammar-snap -s source.graphql src/__tests__/fixtures/textmate/*.graphql", "codegen": "graphql-codegen", "vscode:prepublish": "npm run build:production" }, diff --git a/src/__tests__/fixtures/textmate/test.connect.graphql b/src/__tests__/fixtures/textmate/test.connect.graphql new file mode 100644 index 00000000..470feed0 --- /dev/null +++ b/src/__tests__/fixtures/textmate/test.connect.graphql @@ -0,0 +1,24 @@ +type Query { + post(id: ID!): Post + @connect( + source: "jsonPlaceholder" + http: { + GET: "/posts/{$args.id}" + POST: "/posts/{$args.id}" + PATCH: "/posts/{$args.id}" + DELETE: "/posts/{$args.id}" + PUT: "/posts/{$args.id}" + body: """ + listing: { + title: $args.input.title + } + """ + } + selection: """ + foo: bar + $.root { + a + } + """ + ) +} diff --git a/src/__tests__/fixtures/textmate/test.connect.graphql.snap b/src/__tests__/fixtures/textmate/test.connect.graphql.snap new file mode 100644 index 00000000..bb9109cc --- /dev/null +++ b/src/__tests__/fixtures/textmate/test.connect.graphql.snap @@ -0,0 +1,167 @@ +>type Query { +#^^^^ source.graphql meta.type.interface.graphql keyword.type.graphql +# ^ source.graphql meta.type.interface.graphql +# ^^^^^ source.graphql meta.type.interface.graphql support.type.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql punctuation.operation.graphql +> post(id: ID!): Post +#^^ source.graphql meta.type.interface.graphql meta.type.object.graphql +# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql variable.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.brace.round.graphql +# ^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.variables.graphql variable.parameter.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.variables.graphql punctuation.colon.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.variables.graphql +# ^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.variables.graphql support.type.builtin.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.variables.graphql keyword.operator.nulltype.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.brace.round.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql punctuation.colon.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql +# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql support.type.graphql +> @connect( +#^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql +# ^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql entity.name.function.directive.connect.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.brace.round.directive.graphql +> source: "jsonPlaceholder" +#^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql +# ^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql variable.parameter.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql punctuation.colon.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql +# ^^^^^^^^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql string.quoted.double.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql +> http: { +#^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql +# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql variable.parameter.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql punctuation.colon.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql punctuation.operation.graphql +> GET: "/posts/{$args.id}" +#^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql +# ^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql variable.parameter.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql punctuation.colon.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql +# ^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.open +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.ExprPath.dollar +# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.KeyPath.key.identifier +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.dot +# ^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.key.identifier +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.close +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql +> POST: "/posts/{$args.id}" +#^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql +# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql variable.parameter.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql punctuation.colon.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql +# ^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.open +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.ExprPath.dollar +# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.KeyPath.key.identifier +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.dot +# ^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.key.identifier +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.close +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql +> PATCH: "/posts/{$args.id}" +#^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql +# ^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql variable.parameter.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql punctuation.colon.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql +# ^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.open +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.ExprPath.dollar +# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.KeyPath.key.identifier +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.dot +# ^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.key.identifier +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.close +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql +> DELETE: "/posts/{$args.id}" +#^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql +# ^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql variable.parameter.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql punctuation.colon.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql +# ^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.open +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.ExprPath.dollar +# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.KeyPath.key.identifier +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.dot +# ^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.key.identifier +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.close +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql +> PUT: "/posts/{$args.id}" +#^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql +# ^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql variable.parameter.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql punctuation.colon.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql +# ^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.open +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.ExprPath.dollar +# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.KeyPath.key.identifier +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.dot +# ^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.key.identifier +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.close +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql +> body: """ +#^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql +# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql variable.parameter.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql punctuation.colon.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql +# ^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql +> listing: { +#^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql +# ^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql string.unquoted.NamedPathSelection.alias +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql punctuation.colon.NamedPathSelection +# ^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql +> title: $args.input.title +#^^^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql +# ^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql string.unquoted.NamedPathSelection.alias +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql punctuation.colon.NamedPathSelection +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql variable.ExprPath.dollar +# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql variable.NamedFieldSelection.key +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql +# ^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql variable.NamedFieldSelection.key +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql +# ^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql variable.NamedFieldSelection.key +> } +#^^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql +> """ +#^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql +# ^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql +> } +#^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql +> selection: """ +#^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql +# ^^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql variable.parameter.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql punctuation.colon.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql +# ^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql +> foo: bar +#^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql +# ^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql string.unquoted.NamedFieldSelection.alias +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql punctuation.colon.NamedFieldSelection +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql +# ^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql variable.NamedFieldSelection.key +> $.root { +#^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql variable.ExprPath.dollar +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql variable.PathStep.dot +# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql variable.PathStep.key.identifier +# ^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql +> a +#^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql variable.NamedFieldSelection.key +> } +#^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql +> """ +#^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql +# ^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql +> ) +#^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql +>} +#^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql punctuation.operation.graphql +> \ No newline at end of file diff --git a/syntaxes/graphql.connectors.json b/syntaxes/graphql.connectors.json index 453a8d83..eccd95d6 100644 --- a/syntaxes/graphql.connectors.json +++ b/syntaxes/graphql.connectors.json @@ -32,24 +32,29 @@ "patterns": [ { "include": "source.graphql#graphql-comment" }, { "include": "#connect-jsonselection-argument" }, + { "include": "#connect-jsonselection-nested-argument" }, + { "include": "#connect-string-jsonselection-argument" }, + { "include": "source.graphql#graphql-argument" }, + { "include": "source.graphql#literal-quasi-embedded" } + ] + }, + "connect-jsonselection-nested-argument": { + "name": "meta.argument.connect.nested.graphql", + "begin": "\\s*(http)\\s*(:)\\s*({)", + "end": "\\s*(})", + "beginCaptures": { + "1": { "name": "variable.parameter.graphql" }, + "2": { "name": "punctuation.colon.graphql" }, + "3": { "name": "punctuation.operation.graphql" } + }, + "endCaptures": { + "1": { "name": "punctuation.operation.graphql" } + }, + "patterns": [ + { "include": "source.graphql#graphql-comment" }, + { "include": "#connect-jsonselection-argument" }, + { "include": "#connect-jsonselection-nested-argument" }, { "include": "#connect-string-jsonselection-argument" }, - { - "begin": "\\s*(http)(?:\\s*(:))", - "end": "(?=\\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\\s*(:))|\\)))|\\s*(,)", - "beginCaptures": { - "1": { "name": "variable.parameter.graphql" }, - "2": { "name": "punctuation.colon.graphql" } - }, - "endCaptures": { - "3": { "name": "punctuation.comma.graphql" } - }, - "patterns": [ - { "include": "#connect-arguments" }, - { "include": "source.graphql#graphql-comment" }, - { "include": "source.graphql#literal-quasi-embedded" }, - { "include": "source.graphql#graphql-skip-newlines" } - ] - }, { "include": "source.graphql#graphql-argument" }, { "include": "source.graphql#literal-quasi-embedded" } ] From 8711cf3c78e14da649c80d4fc13584f22021819e Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Tue, 29 Oct 2024 13:50:13 +0100 Subject: [PATCH 20/34] add schema ref --- syntaxes/connectors.jsonselection.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/syntaxes/connectors.jsonselection.yaml b/syntaxes/connectors.jsonselection.yaml index 4c88e602..1719573a 100644 --- a/syntaxes/connectors.jsonselection.yaml +++ b/syntaxes/connectors.jsonselection.yaml @@ -2,6 +2,7 @@ # npx js-yaml syntaxes/connectors.jsonselection.yaml >| syntaxes/connectors.jsonselection.json # fswatch -0 syntaxes/connectors.jsonselection.yaml | xargs -0 -I {} bash -c "npx js-yaml {} > syntaxes/connectors.jsonselection.json && echo saved" \; # based on https://github.com/apollographql/router/blob/next/apollo-federation/src/sources/connect/json_selection/README.md +# yaml-language-server: $schema=https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json name: "Apollo Connectors JSONSelection" scopeName: "source.apollo.jsonselection" patterns: From 7c1fd891cd9de65eabadeac904c1ae5d3be84e19 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Wed, 30 Oct 2024 14:58:28 +0100 Subject: [PATCH 21/34] fix: correct handling of nested objects ```graphql type Mutation { createListing: String @connect( http: { body: """ foo: bar """ } ) } type Query { user(id: ID!): User } ``` --- .../textmate/test.connect.graphql.snap | 232 +++++++++--------- syntaxes/graphql.connectors.json | 83 +++++-- 2 files changed, 177 insertions(+), 138 deletions(-) diff --git a/src/__tests__/fixtures/textmate/test.connect.graphql.snap b/src/__tests__/fixtures/textmate/test.connect.graphql.snap index bb9109cc..a5e8f749 100644 --- a/src/__tests__/fixtures/textmate/test.connect.graphql.snap +++ b/src/__tests__/fixtures/textmate/test.connect.graphql.snap @@ -30,138 +30,140 @@ # ^^^^^^^^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql string.quoted.double.graphql # ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql > http: { -#^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql -# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql variable.parameter.graphql -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql punctuation.colon.graphql -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql punctuation.operation.graphql +#^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql +# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql variable.parameter.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql punctuation.colon.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.brace.curly.graphql > GET: "/posts/{$args.id}" -#^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql -# ^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql variable.parameter.graphql -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql punctuation.colon.graphql -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql -# ^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.open -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.ExprPath.dollar -# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.KeyPath.key.identifier -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.dot -# ^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.key.identifier -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.close -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql +#^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql +# ^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql variable.parameter.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql punctuation.colon.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql +# ^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.open +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.ExprPath.dollar +# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.KeyPath.key.identifier +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.dot +# ^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.key.identifier +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.close +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql > POST: "/posts/{$args.id}" -#^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql -# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql variable.parameter.graphql -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql punctuation.colon.graphql -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql -# ^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.open -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.ExprPath.dollar -# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.KeyPath.key.identifier -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.dot -# ^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.key.identifier -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.close -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql +#^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql +# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql variable.parameter.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql punctuation.colon.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql +# ^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.open +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.ExprPath.dollar +# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.KeyPath.key.identifier +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.dot +# ^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.key.identifier +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.close +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql > PATCH: "/posts/{$args.id}" -#^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql -# ^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql variable.parameter.graphql -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql punctuation.colon.graphql -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql -# ^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.open -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.ExprPath.dollar -# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.KeyPath.key.identifier -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.dot -# ^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.key.identifier -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.close -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql +#^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql +# ^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql variable.parameter.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql punctuation.colon.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql +# ^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.open +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.ExprPath.dollar +# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.KeyPath.key.identifier +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.dot +# ^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.key.identifier +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.close +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql > DELETE: "/posts/{$args.id}" -#^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql -# ^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql variable.parameter.graphql -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql punctuation.colon.graphql -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql -# ^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.open -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.ExprPath.dollar -# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.KeyPath.key.identifier -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.dot -# ^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.key.identifier -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.close -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql +#^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql +# ^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql variable.parameter.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql punctuation.colon.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql +# ^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.open +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.ExprPath.dollar +# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.KeyPath.key.identifier +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.dot +# ^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.key.identifier +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.close +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql > PUT: "/posts/{$args.id}" -#^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql -# ^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql variable.parameter.graphql -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql punctuation.colon.graphql -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql -# ^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.open -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.ExprPath.dollar -# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.KeyPath.key.identifier -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.dot -# ^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.key.identifier -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.close -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql +#^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql +# ^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql variable.parameter.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql punctuation.colon.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql +# ^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.open +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.ExprPath.dollar +# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.KeyPath.key.identifier +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.dot +# ^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.key.identifier +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.close +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql > body: """ -#^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql -# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql variable.parameter.graphql -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql punctuation.colon.graphql -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql -# ^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql +#^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql +# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql variable.parameter.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql punctuation.colon.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql +# ^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql > listing: { -#^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql -# ^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql string.unquoted.NamedPathSelection.alias -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql punctuation.colon.NamedPathSelection -# ^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql +#^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql +# ^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql string.unquoted.NamedPathSelection.alias +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql punctuation.colon.NamedPathSelection +# ^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql > title: $args.input.title -#^^^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql -# ^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql string.unquoted.NamedPathSelection.alias -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql punctuation.colon.NamedPathSelection -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql variable.ExprPath.dollar -# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql variable.NamedFieldSelection.key -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql -# ^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql variable.NamedFieldSelection.key -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql -# ^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql variable.NamedFieldSelection.key +#^^^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql +# ^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql string.unquoted.NamedPathSelection.alias +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql punctuation.colon.NamedPathSelection +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql variable.ExprPath.dollar +# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql variable.NamedFieldSelection.key +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql +# ^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql variable.NamedFieldSelection.key +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql +# ^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql variable.NamedFieldSelection.key > } -#^^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql +#^^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql > """ -#^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql -# ^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql +#^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql +# ^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql > } -#^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql +#^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.brace.curly.graphql > selection: """ -#^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql -# ^^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql variable.parameter.graphql -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql punctuation.colon.graphql -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql -# ^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql +#^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.jsonselection.graphql +# ^^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.jsonselection.graphql variable.parameter.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.jsonselection.graphql punctuation.colon.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.jsonselection.graphql +# ^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql > foo: bar -#^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql -# ^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql string.unquoted.NamedFieldSelection.alias -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql punctuation.colon.NamedFieldSelection -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql -# ^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql variable.NamedFieldSelection.key +#^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql +# ^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql string.unquoted.NamedFieldSelection.alias +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql punctuation.colon.NamedFieldSelection +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql +# ^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql variable.NamedFieldSelection.key > $.root { -#^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql variable.ExprPath.dollar -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql variable.PathStep.dot -# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql variable.PathStep.key.identifier -# ^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql +#^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql variable.ExprPath.dollar +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql variable.PathStep.dot +# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql variable.PathStep.key.identifier +# ^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql > a -#^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql variable.NamedFieldSelection.key +#^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql variable.NamedFieldSelection.key > } -#^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql +#^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql > """ -#^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql -# ^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql meta.argument.connect.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql +#^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql +# ^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql > ) -#^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql +#^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.brace.round.directive.graphql >} -#^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.nested.graphql punctuation.operation.graphql +#^ source.graphql meta.type.interface.graphql meta.type.object.graphql punctuation.operation.graphql > \ No newline at end of file diff --git a/syntaxes/graphql.connectors.json b/syntaxes/graphql.connectors.json index eccd95d6..3a8dd0ed 100644 --- a/syntaxes/graphql.connectors.json +++ b/syntaxes/graphql.connectors.json @@ -32,28 +32,7 @@ "patterns": [ { "include": "source.graphql#graphql-comment" }, { "include": "#connect-jsonselection-argument" }, - { "include": "#connect-jsonselection-nested-argument" }, - { "include": "#connect-string-jsonselection-argument" }, - { "include": "source.graphql#graphql-argument" }, - { "include": "source.graphql#literal-quasi-embedded" } - ] - }, - "connect-jsonselection-nested-argument": { - "name": "meta.argument.connect.nested.graphql", - "begin": "\\s*(http)\\s*(:)\\s*({)", - "end": "\\s*(})", - "beginCaptures": { - "1": { "name": "variable.parameter.graphql" }, - "2": { "name": "punctuation.colon.graphql" }, - "3": { "name": "punctuation.operation.graphql" } - }, - "endCaptures": { - "1": { "name": "punctuation.operation.graphql" } - }, - "patterns": [ - { "include": "source.graphql#graphql-comment" }, - { "include": "#connect-jsonselection-argument" }, - { "include": "#connect-jsonselection-nested-argument" }, + { "include": "#connect-argument-http" }, { "include": "#connect-string-jsonselection-argument" }, { "include": "source.graphql#graphql-argument" }, { "include": "source.graphql#literal-quasi-embedded" } @@ -61,7 +40,7 @@ }, "connect-jsonselection-argument": { "name": "meta.argument.connect.jsonselection.graphql", - "begin": "\\s*(selection|body)(?:\\s*(:))", + "begin": "\\s*(selection)(?:\\s*(:))", "end": "(?=\\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\\s*(:))|\\)))|\\s*(,)", "beginCaptures": { "1": { "name": "variable.parameter.graphql" }, @@ -92,6 +71,64 @@ { "include": "source.graphql#graphql-skip-newlines" } ] }, + "connect-argument-http": { + "name": "meta.argument.connect.http.graphql", + "begin": "\\s*(http)\\s*(:)", + "end": "(?=\\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\\s*(:))|\\)))|\\s*(,)", + "beginCaptures": { + "1": { "name": "variable.parameter.graphql" }, + "2": { "name": "punctuation.colon.graphql" } + }, + "endCaptures": { + "3": { "name": "punctuation.comma.graphql" } + }, + "patterns": [ + { "include": "#http-object-value" }, + { "include": "source.graphql#graphql-comment" }, + { "include": "source.graphql#literal-quasi-embedded" } + ] + }, + "http-object-value": { + "patterns": [ + { + "name": "meta.objectvalues.connect.http.graphql", + "begin": "\\s*({)", + "end": "\\s*(})", + "beginCaptures": { + "1": { "name": "meta.brace.curly.graphql" } + }, + "endCaptures": { + "1": { "name": "meta.brace.curly.graphql" } + }, + "patterns": [ + { "include": "#connect-string-jsonselection-argument" }, + { "include": "#http-object-jsonselection-property" }, + { "include": "source.graphql#graphql-object-field" }, + { "include": "source.graphql#graphql-value" } + ] + } + ] + }, + "http-object-jsonselection-property": { + "name": "meta.argument.connect.body.jsonselection.graphql", + "begin": "\\s*(body)\\s*(:)\\s*((\"\"\"))", + "end": "((\"\"\"))", + "beginCaptures": { + "1": { "name": "variable.parameter.graphql" }, + "2": { "name": "punctuation.colon.graphql" }, + "3": { "name": "string.quoted.double.graphql" }, + "4": { "name": "punctuation.definition.string.begin.graphql" } + }, + "endCaptures": { + "1": { "name": "string.quoted.double.graphql" }, + "2": { "name": "punctuation.definition.string.end.graphql" } + }, + "patterns": [ + { + "include": "source.apollo.jsonselection" + } + ] + }, "connect-string-jsonselection-argument": { "name": "meta.argument.connect.string.jsonselection.graphql", "contentName": "meta.embedded.block.string.jsonselection.graphql", From 14839305bcc727a0e1999b86b7d9a1ec5b5fd635 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Wed, 30 Oct 2024 15:53:36 +0100 Subject: [PATCH 22/34] special highlighting for `({` `})` bracket pairs --- apollo.jsonselection.configuration.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apollo.jsonselection.configuration.json b/apollo.jsonselection.configuration.json index 8957d6f3..89ffe4e6 100644 --- a/apollo.jsonselection.configuration.json +++ b/apollo.jsonselection.configuration.json @@ -3,6 +3,8 @@ "lineComment": "#" }, "brackets": [ + ["({", "})"], + ["[", "]"], ["{", "}"], ["(", ")"] ] From 073162fb995c6614e39d588a40016e747eec7bd4 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Wed, 30 Oct 2024 17:27:49 +0100 Subject: [PATCH 23/34] fix typo --- syntaxes/connectors.jsonselection.json | 2 +- syntaxes/connectors.jsonselection.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/syntaxes/connectors.jsonselection.json b/syntaxes/connectors.jsonselection.json index 7702b6c6..7584fe3a 100644 --- a/syntaxes/connectors.jsonselection.json +++ b/syntaxes/connectors.jsonselection.json @@ -395,7 +395,7 @@ "name": "string.quoted.double.graphql" }, "2": { - "name\"": "punctuation.definition.string.end.graphql" + "name": "punctuation.definition.string.end.graphql" } }, "patterns": [ diff --git a/syntaxes/connectors.jsonselection.yaml b/syntaxes/connectors.jsonselection.yaml index 1719573a..14512735 100644 --- a/syntaxes/connectors.jsonselection.yaml +++ b/syntaxes/connectors.jsonselection.yaml @@ -258,7 +258,7 @@ repository: "1": name: "string.quoted.double.graphql" "2": - name": "punctuation.definition.string.end.graphql" + name: "punctuation.definition.string.end.graphql" patterns: - name: "meta.JSONSelectionString.embedded" begin: "\\s*({)" From 4deca72cbc1babe5e9bca75ac76661a8622e9131 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Wed, 30 Oct 2024 17:39:20 +0100 Subject: [PATCH 24/34] highlighting of `@`, `$.` and `$.foo` --- syntaxes/connectors.jsonselection.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/syntaxes/connectors.jsonselection.json b/syntaxes/connectors.jsonselection.json index 7584fe3a..bc069a02 100644 --- a/syntaxes/connectors.jsonselection.json +++ b/syntaxes/connectors.jsonselection.json @@ -120,10 +120,10 @@ "PathWithOrWithoutSubSelection": { "patterns": [ { - "include": "#ExprPath" + "include": "#VarPath" }, { - "include": "#VarPath" + "include": "#ExprPath" }, { "include": "#KeyPath" @@ -137,10 +137,10 @@ "begin": "(\\$)([a-zA-Z_][0-9a-zA-Z_]*)?(?!\\w)", "beginCaptures": { "1": { - "name": "variable.VarPath.dollar" + "name": "variable.language.VarPath.dollar" }, "2": { - "name": "variable.VarPath.identifier" + "name": "variable.language.VarPath.identifier" } }, "end": "(?=.)", @@ -170,7 +170,7 @@ "begin": "(\\@)", "beginCaptures": { "1": { - "name": "variable.AtPath.at" + "name": "variable.language.AtPath.at" } }, "end": "(?=.)", @@ -185,7 +185,7 @@ "begin": "(\\$)", "beginCaptures": { "1": { - "name": "variable.ExprPath.dollar" + "name": "variable.language.ExprPath.dollar" } }, "end": "(?=.)", From 810cf1a5f0c890e90a2f6a5641ab5a874d0948d3 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Wed, 30 Oct 2024 17:43:41 +0100 Subject: [PATCH 25/34] undo `{(` grouping --- apollo.jsonselection.configuration.json | 1 - 1 file changed, 1 deletion(-) diff --git a/apollo.jsonselection.configuration.json b/apollo.jsonselection.configuration.json index 89ffe4e6..d47de769 100644 --- a/apollo.jsonselection.configuration.json +++ b/apollo.jsonselection.configuration.json @@ -3,7 +3,6 @@ "lineComment": "#" }, "brackets": [ - ["({", "})"], ["[", "]"], ["{", "}"], ["(", ")"] From 5c2ea2fc9305261a2e55b3e20a2ee6d7ff7e62af Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Wed, 30 Oct 2024 17:43:55 +0100 Subject: [PATCH 26/34] set apart `{` in `JSONSelectionString` visually --- syntaxes/connectors.jsonselection.json | 16 ++++++++-------- syntaxes/connectors.jsonselection.yaml | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/syntaxes/connectors.jsonselection.json b/syntaxes/connectors.jsonselection.json index bc069a02..e8703f89 100644 --- a/syntaxes/connectors.jsonselection.json +++ b/syntaxes/connectors.jsonselection.json @@ -120,10 +120,10 @@ "PathWithOrWithoutSubSelection": { "patterns": [ { - "include": "#VarPath" + "include": "#ExprPath" }, { - "include": "#ExprPath" + "include": "#VarPath" }, { "include": "#KeyPath" @@ -137,10 +137,10 @@ "begin": "(\\$)([a-zA-Z_][0-9a-zA-Z_]*)?(?!\\w)", "beginCaptures": { "1": { - "name": "variable.language.VarPath.dollar" + "name": "variable.VarPath.dollar" }, "2": { - "name": "variable.language.VarPath.identifier" + "name": "variable.VarPath.identifier" } }, "end": "(?=.)", @@ -170,7 +170,7 @@ "begin": "(\\@)", "beginCaptures": { "1": { - "name": "variable.language.AtPath.at" + "name": "variable.AtPath.at" } }, "end": "(?=.)", @@ -185,7 +185,7 @@ "begin": "(\\$)", "beginCaptures": { "1": { - "name": "variable.language.ExprPath.dollar" + "name": "variable.ExprPath.dollar" } }, "end": "(?=.)", @@ -404,13 +404,13 @@ "begin": "\\s*({)", "beginCaptures": { "1": { - "name": "punctuation.JSONSelectionString.open" + "name": "constant.language.JSONSelectionString.open" } }, "end": "\\s*(})", "endCaptures": { "1": { - "name": "punctuation.JSONSelectionString.close" + "name": "constant.language.JSONSelectionString.close" } }, "patterns": [ diff --git a/syntaxes/connectors.jsonselection.yaml b/syntaxes/connectors.jsonselection.yaml index 14512735..4366409c 100644 --- a/syntaxes/connectors.jsonselection.yaml +++ b/syntaxes/connectors.jsonselection.yaml @@ -264,10 +264,10 @@ repository: begin: "\\s*({)" beginCaptures: "1": - name: "punctuation.JSONSelectionString.open" + name: "constant.language.JSONSelectionString.open" end: "\\s*(})" endCaptures: "1": - name: "punctuation.JSONSelectionString.close" + name: "constant.language.JSONSelectionString.close" patterns: - include: "#PathSelection" From 07b9f61b88873ad9b93c9f095c6649ffbd4c5034 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Wed, 30 Oct 2024 17:48:22 +0100 Subject: [PATCH 27/34] redo accidental wrong edit --- syntaxes/connectors.jsonselection.json | 16 ++++++++-------- syntaxes/connectors.jsonselection.yaml | 14 +++++++------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/syntaxes/connectors.jsonselection.json b/syntaxes/connectors.jsonselection.json index e8703f89..bc069a02 100644 --- a/syntaxes/connectors.jsonselection.json +++ b/syntaxes/connectors.jsonselection.json @@ -120,10 +120,10 @@ "PathWithOrWithoutSubSelection": { "patterns": [ { - "include": "#ExprPath" + "include": "#VarPath" }, { - "include": "#VarPath" + "include": "#ExprPath" }, { "include": "#KeyPath" @@ -137,10 +137,10 @@ "begin": "(\\$)([a-zA-Z_][0-9a-zA-Z_]*)?(?!\\w)", "beginCaptures": { "1": { - "name": "variable.VarPath.dollar" + "name": "variable.language.VarPath.dollar" }, "2": { - "name": "variable.VarPath.identifier" + "name": "variable.language.VarPath.identifier" } }, "end": "(?=.)", @@ -170,7 +170,7 @@ "begin": "(\\@)", "beginCaptures": { "1": { - "name": "variable.AtPath.at" + "name": "variable.language.AtPath.at" } }, "end": "(?=.)", @@ -185,7 +185,7 @@ "begin": "(\\$)", "beginCaptures": { "1": { - "name": "variable.ExprPath.dollar" + "name": "variable.language.ExprPath.dollar" } }, "end": "(?=.)", @@ -404,13 +404,13 @@ "begin": "\\s*({)", "beginCaptures": { "1": { - "name": "constant.language.JSONSelectionString.open" + "name": "punctuation.JSONSelectionString.open" } }, "end": "\\s*(})", "endCaptures": { "1": { - "name": "constant.language.JSONSelectionString.close" + "name": "punctuation.JSONSelectionString.close" } }, "patterns": [ diff --git a/syntaxes/connectors.jsonselection.yaml b/syntaxes/connectors.jsonselection.yaml index 4366409c..bdf99b61 100644 --- a/syntaxes/connectors.jsonselection.yaml +++ b/syntaxes/connectors.jsonselection.yaml @@ -77,8 +77,8 @@ repository: - include: "#PathWithOrWithoutSubSelection" PathWithOrWithoutSubSelection: patterns: - - include: "#ExprPath" - include: "#VarPath" + - include: "#ExprPath" - include: "#KeyPath" - include: "#AtPath" # VarPath ::= "$" (NO_SPACE Identifier)? PathStep* @@ -86,9 +86,9 @@ repository: begin: "(\\$)([a-zA-Z_][0-9a-zA-Z_]*)?(?!\\w)" beginCaptures: "1": - name: "variable.VarPath.dollar" + name: "variable.language.VarPath.dollar" "2": - name: "variable.VarPath.identifier" + name: "variable.language.VarPath.identifier" end: "(?=.)" applyEndPatternLast: 1 patterns: @@ -108,7 +108,7 @@ repository: begin: "(\\@)" beginCaptures: "1": - name: "variable.AtPath.at" + name: "variable.language.AtPath.at" end: "(?=.)" applyEndPatternLast: 1 patterns: @@ -118,7 +118,7 @@ repository: begin: "(\\$)" beginCaptures: "1": - name: "variable.ExprPath.dollar" + name: "variable.language.ExprPath.dollar" end: "(?=.)" applyEndPatternLast: 1 patterns: @@ -264,10 +264,10 @@ repository: begin: "\\s*({)" beginCaptures: "1": - name: "constant.language.JSONSelectionString.open" + name: "punctuation.JSONSelectionString.open" end: "\\s*(})" endCaptures: "1": - name: "constant.language.JSONSelectionString.close" + name: "punctuation.JSONSelectionString.close" patterns: - include: "#PathSelection" From f433e1496fe969ab8d89e1d11bbda1782901f75d Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Thu, 31 Oct 2024 11:02:56 +0100 Subject: [PATCH 28/34] update snapshots, run more tests in CI --- .github/workflows/E2E.yml | 14 +- .../textmate/test.apollo.jsonselection.snap | 167 +++++++++--------- .../textmate/test.connect.graphql.snap | 44 ++--- 3 files changed, 115 insertions(+), 110 deletions(-) diff --git a/.github/workflows/E2E.yml b/.github/workflows/E2E.yml index aa951bc8..7382dcf4 100644 --- a/.github/workflows/E2E.yml +++ b/.github/workflows/E2E.yml @@ -5,7 +5,7 @@ on: branches: - main jobs: - test: + e2e: name: Run E2E tests runs-on: ubuntu-latest strategy: @@ -30,3 +30,15 @@ jobs: - run: xvfb-run -a npm run test:extension env: VSCODE_VERSION: "${{ matrix.version }}" + test: + name: Run other tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + cache: "npm" + - run: npm install + - run: npm run build:production + - run: yarn test + - run: yarn test:textmate diff --git a/src/__tests__/fixtures/textmate/test.apollo.jsonselection.snap b/src/__tests__/fixtures/textmate/test.apollo.jsonselection.snap index 580a41da..6914d93f 100644 --- a/src/__tests__/fixtures/textmate/test.apollo.jsonselection.snap +++ b/src/__tests__/fixtures/textmate/test.apollo.jsonselection.snap @@ -163,10 +163,10 @@ # ^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias # ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection # ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.ExprPath.dollar -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection variable.language.VarPath.dollar +# ^^^^ source.apollo.jsonselection variable.language.VarPath.identifier +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^ source.apollo.jsonselection variable.PathStep.key.identifier > name #^^^^^^ source.apollo.jsonselection # ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key @@ -188,7 +188,7 @@ # ^^ source.apollo.jsonselection meta.SubSelection string.unquoted.NamedPathSelection.alias # ^ source.apollo.jsonselection meta.SubSelection punctuation.colon.NamedPathSelection # ^ source.apollo.jsonselection meta.SubSelection -# ^ source.apollo.jsonselection meta.SubSelection variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.SubSelection variable.language.VarPath.dollar # ^ source.apollo.jsonselection meta.SubSelection # ^ source.apollo.jsonselection meta.SubSelection punctuation.SubSelection.close >items: data.nested.items { id name } @@ -241,7 +241,7 @@ # ^ source.apollo.jsonselection # ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key >$.data { id name } -#^ source.apollo.jsonselection variable.ExprPath.dollar +#^ source.apollo.jsonselection variable.language.VarPath.dollar # ^ source.apollo.jsonselection variable.PathStep.dot # ^^^^ source.apollo.jsonselection variable.PathStep.key.identifier # ^^^ source.apollo.jsonselection @@ -267,20 +267,20 @@ #^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias # ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection # ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection variable.language.VarPath.dollar # ^ source.apollo.jsonselection variable.PathStep.dot # ^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier # ^^ source.apollo.jsonselection punctuation.PathStep.arrow # ^^^ source.apollo.jsonselection variable.PathStep.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot # ^^^^^^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close # ^^ source.apollo.jsonselection punctuation.PathStep.arrow # ^^^ source.apollo.jsonselection variable.PathStep.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot # ^^^^^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close @@ -295,7 +295,7 @@ # ^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias # ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection # ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.AtPath.at +# ^ source.apollo.jsonselection variable.language.AtPath.at # ^^^ source.apollo.jsonselection >children: parent->echo([@.child1, @.child2, @.child3]) #^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias @@ -305,15 +305,15 @@ # ^^ source.apollo.jsonselection # ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key # ^^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.AtPath.at +# ^ source.apollo.jsonselection variable.language.AtPath.at # ^ source.apollo.jsonselection variable.PathStep.dot # ^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier # ^^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.AtPath.at +# ^ source.apollo.jsonselection variable.language.AtPath.at # ^ source.apollo.jsonselection variable.PathStep.dot # ^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier # ^^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.AtPath.at +# ^ source.apollo.jsonselection variable.language.AtPath.at # ^ source.apollo.jsonselection variable.PathStep.dot # ^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier # ^^ source.apollo.jsonselection @@ -328,7 +328,7 @@ # ^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias # ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection # ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.AtPath.at +# ^ source.apollo.jsonselection variable.language.AtPath.at # ^^ source.apollo.jsonselection punctuation.PathStep.arrow # ^^^ source.apollo.jsonselection variable.PathStep.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open @@ -343,7 +343,7 @@ # ^^ source.apollo.jsonselection # ^^^ source.apollo.jsonselection variable.NamedFieldSelection.key # ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.AtPath.at +# ^ source.apollo.jsonselection variable.language.AtPath.at # ^^ source.apollo.jsonselection punctuation.PathStep.arrow # ^^^^^^ source.apollo.jsonselection variable.PathStep.identifier # ^ source.apollo.jsonselection @@ -351,40 +351,38 @@ #^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias # ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection # ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.ExprPath.dollar -# ^ source.apollo.jsonselection meta.ExprPathArgs punctuation.brace.round.ExprPathArgs.open -# ^^^^^^^^^ source.apollo.jsonselection meta.ExprPathArgs string.quoted.LitString -# ^ source.apollo.jsonselection meta.ExprPathArgs punctuation.brace.round.ExprPathArgs.close +# ^ source.apollo.jsonselection variable.language.VarPath.dollar +# ^ source.apollo.jsonselection +# ^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^ source.apollo.jsonselection >condition: $(true) #^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias # ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection # ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.ExprPath.dollar -# ^ source.apollo.jsonselection meta.ExprPathArgs punctuation.brace.round.ExprPathArgs.open -# ^^^^ source.apollo.jsonselection meta.ExprPathArgs constant.language.LitPrimitive -# ^ source.apollo.jsonselection meta.ExprPathArgs punctuation.brace.round.ExprPathArgs.close +# ^ source.apollo.jsonselection variable.language.VarPath.dollar +# ^ source.apollo.jsonselection +# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection >alphabetSlice: $("abcdefghijklmnopqrstuvwxyz")->slice($args.start, $args.end) #^^^^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias # ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection # ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.ExprPath.dollar -# ^ source.apollo.jsonselection meta.ExprPathArgs punctuation.brace.round.ExprPathArgs.open -# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection meta.ExprPathArgs string.quoted.LitString -# ^ source.apollo.jsonselection meta.ExprPathArgs punctuation.brace.round.ExprPathArgs.close -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar -# ^^^^ source.apollo.jsonselection meta.MethodArgs variable.KeyPath.key.identifier -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot -# ^^^^^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.comma.MethodArgs.separator -# ^ source.apollo.jsonselection meta.MethodArgs -# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar -# ^^^^ source.apollo.jsonselection meta.MethodArgs variable.KeyPath.key.identifier -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot -# ^^^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +# ^ source.apollo.jsonselection variable.language.VarPath.dollar +# ^ source.apollo.jsonselection +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier +# ^^^ source.apollo.jsonselection +# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.language.VarPath.dollar +# ^^^^ source.apollo.jsonselection variable.language.VarPath.identifier +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.language.VarPath.dollar +# ^^^^ source.apollo.jsonselection variable.language.VarPath.identifier +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^ source.apollo.jsonselection >suffix: results.slice($(-1)->mul($args.suffixLength)) #^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias # ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection @@ -393,20 +391,15 @@ # ^ source.apollo.jsonselection # ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key # ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.ExprPath.dollar -# ^ source.apollo.jsonselection meta.ExprPathArgs punctuation.brace.round.ExprPathArgs.open -# ^ source.apollo.jsonselection meta.ExprPathArgs -# ^ source.apollo.jsonselection meta.ExprPathArgs constant.numeric.LitNumber -# ^ source.apollo.jsonselection meta.ExprPathArgs punctuation.brace.round.ExprPathArgs.close -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar -# ^^^^ source.apollo.jsonselection meta.MethodArgs variable.KeyPath.key.identifier -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot -# ^^^^^^^^^^^^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close -# ^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.language.VarPath.dollar +# ^^^^^^ source.apollo.jsonselection +# ^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +# ^ source.apollo.jsonselection +# ^ source.apollo.jsonselection variable.language.VarPath.dollar +# ^^^^ source.apollo.jsonselection variable.language.VarPath.identifier +# ^ source.apollo.jsonselection variable.PathStep.dot +# ^^^^^^^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier +# ^^ source.apollo.jsonselection ># The ->echo method returns its first input argument as-is, ignoring #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection ># the input data. Useful for embedding literal values, as in @@ -417,7 +410,7 @@ #^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias # ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection # ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection variable.language.VarPath.dollar # ^^ source.apollo.jsonselection punctuation.PathStep.arrow # ^^^^ source.apollo.jsonselection variable.PathStep.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open @@ -434,7 +427,7 @@ # ^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias # ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection # ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.AtPath.at +# ^ source.apollo.jsonselection variable.language.AtPath.at # ^^^ source.apollo.jsonselection > ># Returns the type of the data as a string, e.g. "object", "array", @@ -469,7 +462,7 @@ # ^^ source.apollo.jsonselection # ^^^ source.apollo.jsonselection variable.NamedFieldSelection.key # ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.AtPath.at +# ^ source.apollo.jsonselection variable.language.AtPath.at # ^^ source.apollo.jsonselection punctuation.PathStep.arrow # ^^^ source.apollo.jsonselection variable.PathStep.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open @@ -484,7 +477,7 @@ # ^^ source.apollo.jsonselection # ^^^ source.apollo.jsonselection variable.NamedFieldSelection.key # ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.AtPath.at +# ^ source.apollo.jsonselection variable.language.AtPath.at # ^^ source.apollo.jsonselection punctuation.PathStep.arrow # ^^^^^^ source.apollo.jsonselection variable.PathStep.identifier # ^ source.apollo.jsonselection @@ -559,7 +552,7 @@ # ^ source.apollo.jsonselection > [@->eq("dog"), "Canine"], #^^^^^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.AtPath.at +# ^ source.apollo.jsonselection variable.language.AtPath.at # ^^ source.apollo.jsonselection punctuation.PathStep.arrow # ^^ source.apollo.jsonselection variable.PathStep.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open @@ -570,7 +563,7 @@ # ^^ source.apollo.jsonselection > [@->eq("cat"), "Feline"], #^^^^^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.AtPath.at +# ^ source.apollo.jsonselection variable.language.AtPath.at # ^^ source.apollo.jsonselection punctuation.PathStep.arrow # ^^ source.apollo.jsonselection variable.PathStep.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open @@ -596,20 +589,20 @@ #^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias # ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection # ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection variable.language.VarPath.dollar # ^ source.apollo.jsonselection variable.PathStep.dot # ^ source.apollo.jsonselection variable.PathStep.key.identifier # ^^ source.apollo.jsonselection punctuation.PathStep.arrow # ^^^ source.apollo.jsonselection variable.PathStep.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close # ^^ source.apollo.jsonselection punctuation.PathStep.arrow # ^^^ source.apollo.jsonselection variable.PathStep.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close @@ -617,20 +610,20 @@ #^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias # ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection # ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection variable.language.VarPath.dollar # ^ source.apollo.jsonselection variable.PathStep.dot # ^ source.apollo.jsonselection variable.PathStep.key.identifier # ^^ source.apollo.jsonselection punctuation.PathStep.arrow # ^^^ source.apollo.jsonselection variable.PathStep.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close # ^^ source.apollo.jsonselection punctuation.PathStep.arrow # ^^^ source.apollo.jsonselection variable.PathStep.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close @@ -638,18 +631,18 @@ #^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias # ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection # ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection variable.language.VarPath.dollar # ^ source.apollo.jsonselection variable.PathStep.dot # ^ source.apollo.jsonselection variable.PathStep.key.identifier # ^^ source.apollo.jsonselection punctuation.PathStep.arrow # ^^^ source.apollo.jsonselection variable.PathStep.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.comma.MethodArgs.separator # ^ source.apollo.jsonselection meta.MethodArgs -# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close @@ -657,13 +650,13 @@ #^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias # ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection # ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection variable.language.VarPath.dollar # ^ source.apollo.jsonselection variable.PathStep.dot # ^ source.apollo.jsonselection variable.PathStep.key.identifier # ^^ source.apollo.jsonselection punctuation.PathStep.arrow # ^^^ source.apollo.jsonselection variable.PathStep.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close @@ -671,13 +664,13 @@ #^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias # ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection # ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection variable.language.VarPath.dollar # ^ source.apollo.jsonselection variable.PathStep.dot # ^ source.apollo.jsonselection variable.PathStep.key.identifier # ^^ source.apollo.jsonselection punctuation.PathStep.arrow # ^^^ source.apollo.jsonselection variable.PathStep.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close @@ -751,7 +744,7 @@ #^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias # ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection # ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection variable.language.VarPath.dollar # ^^ source.apollo.jsonselection punctuation.PathStep.arrow # ^^^^ source.apollo.jsonselection variable.PathStep.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open @@ -850,7 +843,7 @@ #^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias # ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection # ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection variable.language.VarPath.dollar # ^ source.apollo.jsonselection variable.PathStep.dot # ^^^^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier # ^^ source.apollo.jsonselection punctuation.PathStep.arrow @@ -859,7 +852,7 @@ #^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias # ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection # ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection variable.language.VarPath.dollar # ^ source.apollo.jsonselection variable.PathStep.dot # ^^^^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier # ^^ source.apollo.jsonselection punctuation.PathStep.arrow @@ -870,20 +863,20 @@ #^^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias # ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection # ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection variable.language.VarPath.dollar # ^ source.apollo.jsonselection variable.PathStep.dot # ^ source.apollo.jsonselection variable.PathStep.key.identifier # ^^ source.apollo.jsonselection punctuation.PathStep.arrow # ^^ source.apollo.jsonselection variable.PathStep.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close # ^^ source.apollo.jsonselection punctuation.PathStep.arrow # ^^ source.apollo.jsonselection variable.PathStep.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close @@ -891,18 +884,18 @@ #^^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias # ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection # ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection variable.language.VarPath.dollar # ^ source.apollo.jsonselection variable.PathStep.dot # ^ source.apollo.jsonselection variable.PathStep.key.identifier # ^^ source.apollo.jsonselection punctuation.PathStep.arrow # ^^^ source.apollo.jsonselection variable.PathStep.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.comma.MethodArgs.separator # ^ source.apollo.jsonselection meta.MethodArgs -# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close @@ -910,7 +903,7 @@ #^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias # ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection # ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection variable.language.VarPath.dollar # ^ source.apollo.jsonselection variable.PathStep.dot # ^ source.apollo.jsonselection variable.PathStep.key.identifier # ^^ source.apollo.jsonselection punctuation.PathStep.arrow @@ -918,7 +911,7 @@ # ^^ source.apollo.jsonselection punctuation.PathStep.arrow # ^^ source.apollo.jsonselection variable.PathStep.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close @@ -926,13 +919,13 @@ #^^^^^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias # ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection # ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.ExprPath.dollar +# ^ source.apollo.jsonselection variable.language.VarPath.dollar # ^ source.apollo.jsonselection variable.PathStep.dot # ^^^^ source.apollo.jsonselection variable.PathStep.key.identifier # ^^ source.apollo.jsonselection punctuation.PathStep.arrow # ^^ source.apollo.jsonselection variable.PathStep.identifier # ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.ExprPath.dollar +# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar # ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot # ^^^^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier # ^^ source.apollo.jsonselection meta.MethodArgs punctuation.PathStep.arrow diff --git a/src/__tests__/fixtures/textmate/test.connect.graphql.snap b/src/__tests__/fixtures/textmate/test.connect.graphql.snap index a5e8f749..dcdbee44 100644 --- a/src/__tests__/fixtures/textmate/test.connect.graphql.snap +++ b/src/__tests__/fixtures/textmate/test.connect.graphql.snap @@ -43,12 +43,12 @@ # ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql # ^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString # ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.open -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.ExprPath.dollar -# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.KeyPath.key.identifier +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.language.VarPath.dollar +# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.language.VarPath.identifier # ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.dot # ^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.key.identifier # ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.close -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql > POST: "/posts/{$args.id}" #^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql # ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql variable.parameter.graphql @@ -57,12 +57,12 @@ # ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql # ^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString # ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.open -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.ExprPath.dollar -# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.KeyPath.key.identifier +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.language.VarPath.dollar +# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.language.VarPath.identifier # ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.dot # ^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.key.identifier # ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.close -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql > PATCH: "/posts/{$args.id}" #^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql # ^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql variable.parameter.graphql @@ -71,12 +71,12 @@ # ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql # ^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString # ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.open -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.ExprPath.dollar -# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.KeyPath.key.identifier +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.language.VarPath.dollar +# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.language.VarPath.identifier # ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.dot # ^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.key.identifier # ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.close -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql > DELETE: "/posts/{$args.id}" #^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql # ^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql variable.parameter.graphql @@ -85,12 +85,12 @@ # ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql # ^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString # ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.open -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.ExprPath.dollar -# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.KeyPath.key.identifier +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.language.VarPath.dollar +# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.language.VarPath.identifier # ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.dot # ^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.key.identifier # ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.close -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql > PUT: "/posts/{$args.id}" #^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql # ^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql variable.parameter.graphql @@ -99,12 +99,12 @@ # ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql # ^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString # ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.open -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.ExprPath.dollar -# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.KeyPath.key.identifier +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.language.VarPath.dollar +# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.language.VarPath.identifier # ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.dot # ^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded variable.PathStep.key.identifier # ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.JSONSelectionString meta.JSONSelectionString.embedded punctuation.JSONSelectionString.close -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.string.jsonselection.graphql meta.embedded.block.string.jsonselection.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql > body: """ #^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql # ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql variable.parameter.graphql @@ -121,12 +121,12 @@ # ^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql string.unquoted.NamedPathSelection.alias # ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql punctuation.colon.NamedPathSelection # ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql variable.ExprPath.dollar -# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql variable.NamedFieldSelection.key -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql -# ^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql variable.NamedFieldSelection.key -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql -# ^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql variable.NamedFieldSelection.key +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql variable.language.VarPath.dollar +# ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql variable.language.VarPath.identifier +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql variable.PathStep.dot +# ^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql variable.PathStep.key.identifier +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql variable.PathStep.dot +# ^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql variable.PathStep.key.identifier > } #^^^^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.http.graphql meta.objectvalues.connect.http.graphql meta.argument.connect.body.jsonselection.graphql > """ @@ -149,7 +149,7 @@ # ^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql variable.NamedFieldSelection.key > $.root { #^^^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql -# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql variable.ExprPath.dollar +# ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql variable.language.VarPath.dollar # ^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql variable.PathStep.dot # ^^^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql variable.PathStep.key.identifier # ^^ source.graphql meta.type.interface.graphql meta.type.object.graphql meta.embedded.block.directive.graphql meta.arguments.connect.graphql meta.argument.connect.jsonselection.graphql meta.embedded.block.jsonselection.graphql From 304b70ccc6fb66811f2ea7acc0a329deff29eb1b Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Thu, 31 Oct 2024 11:25:09 +0100 Subject: [PATCH 29/34] also write graphql.connectors with a yaml source --- .vscode/settings.json | 9 +- syntaxes/graphql.connectors.json | 178 +++++++++++++++++++++++-------- syntaxes/graphql.connectors.yaml | 131 +++++++++++++++++++++++ 3 files changed, 272 insertions(+), 46 deletions(-) create mode 100644 syntaxes/graphql.connectors.yaml diff --git a/.vscode/settings.json b/.vscode/settings.json index ff787520..4e0d5d9b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,7 +2,9 @@ { "editor.tabSize": 2, "editor.insertSpaces": true, - "editor.rulers": [110], + "editor.rulers": [ + 110 + ], "editor.wordWrapColumn": 110, "files.trimTrailingWhitespace": true, "files.insertFinalNewline": true, @@ -12,5 +14,8 @@ "node_modules": false }, "typescript.tsdk": "node_modules/typescript/lib", - "debug.node.autoAttach": "on" + "debug.node.autoAttach": "on", + "yaml.schemas": { + "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json": "/syntaxes/*.yaml" + } } diff --git a/syntaxes/graphql.connectors.json b/syntaxes/graphql.connectors.json index 3a8dd0ed..a9f768a7 100644 --- a/syntaxes/graphql.connectors.json +++ b/syntaxes/graphql.connectors.json @@ -1,7 +1,11 @@ { "scopeName": "inline.connectors.graphql", "injectionSelector": "L:meta.embedded.block.directive.graphql -string -comment", - "patterns": [{ "include": "#connect-directive" }], + "patterns": [ + { + "include": "#connect-directive" + } + ], "repository": { "connect-directive": { "begin": "((@)\\s*(connect))", @@ -13,10 +17,18 @@ } }, "patterns": [ - { "include": "#connect-arguments" }, - { "include": "source.graphql#graphql-comment" }, - { "include": "source.graphql#literal-quasi-embedded" }, - { "include": "source.graphql#graphql-skip-newlines" } + { + "include": "#connect-arguments" + }, + { + "include": "source.graphql#graphql-comment" + }, + { + "include": "source.graphql#literal-quasi-embedded" + }, + { + "include": "source.graphql#graphql-skip-newlines" + } ] }, "connect-arguments": { @@ -24,18 +36,34 @@ "begin": "\\s*(\\()", "end": "\\s*(\\))", "beginCaptures": { - "1": { "name": "meta.brace.round.directive.graphql" } + "1": { + "name": "meta.brace.round.directive.graphql" + } }, "endCaptures": { - "1": { "name": "meta.brace.round.directive.graphql" } + "1": { + "name": "meta.brace.round.directive.graphql" + } }, "patterns": [ - { "include": "source.graphql#graphql-comment" }, - { "include": "#connect-jsonselection-argument" }, - { "include": "#connect-argument-http" }, - { "include": "#connect-string-jsonselection-argument" }, - { "include": "source.graphql#graphql-argument" }, - { "include": "source.graphql#literal-quasi-embedded" } + { + "include": "source.graphql#graphql-comment" + }, + { + "include": "#connect-jsonselection-argument" + }, + { + "include": "#connect-argument-http" + }, + { + "include": "#connect-string-jsonselection-argument" + }, + { + "include": "source.graphql#graphql-argument" + }, + { + "include": "source.graphql#literal-quasi-embedded" + } ] }, "connect-jsonselection-argument": { @@ -43,11 +71,17 @@ "begin": "\\s*(selection)(?:\\s*(:))", "end": "(?=\\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\\s*(:))|\\)))|\\s*(,)", "beginCaptures": { - "1": { "name": "variable.parameter.graphql" }, - "2": { "name": "punctuation.colon.graphql" } + "1": { + "name": "variable.parameter.graphql" + }, + "2": { + "name": "punctuation.colon.graphql" + } }, "endCaptures": { - "3": { "name": "punctuation.comma.graphql" } + "3": { + "name": "punctuation.comma.graphql" + } }, "patterns": [ { @@ -55,12 +89,20 @@ "begin": "((\"\"\"))", "end": "((\"\"\"))", "beginCaptures": { - "1": { "name": "string.quoted.double.graphql" }, - "2": { "name": "punctuation.definition.string.begin.graphql" } + "1": { + "name": "string.quoted.double.graphql" + }, + "2": { + "name": "punctuation.definition.string.begin.graphql" + } }, "endCaptures": { - "1": { "name": "string.quoted.double.graphql" }, - "2": { "name": "punctuation.definition.string.end.graphql" } + "1": { + "name": "string.quoted.double.graphql" + }, + "2": { + "name": "punctuation.definition.string.end.graphql" + } }, "patterns": [ { @@ -68,7 +110,9 @@ } ] }, - { "include": "source.graphql#graphql-skip-newlines" } + { + "include": "source.graphql#graphql-skip-newlines" + } ] }, "connect-argument-http": { @@ -76,16 +120,28 @@ "begin": "\\s*(http)\\s*(:)", "end": "(?=\\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\\s*(:))|\\)))|\\s*(,)", "beginCaptures": { - "1": { "name": "variable.parameter.graphql" }, - "2": { "name": "punctuation.colon.graphql" } + "1": { + "name": "variable.parameter.graphql" + }, + "2": { + "name": "punctuation.colon.graphql" + } }, "endCaptures": { - "3": { "name": "punctuation.comma.graphql" } + "3": { + "name": "punctuation.comma.graphql" + } }, "patterns": [ - { "include": "#http-object-value" }, - { "include": "source.graphql#graphql-comment" }, - { "include": "source.graphql#literal-quasi-embedded" } + { + "include": "#http-object-value" + }, + { + "include": "source.graphql#graphql-comment" + }, + { + "include": "source.graphql#literal-quasi-embedded" + } ] }, "http-object-value": { @@ -95,16 +151,28 @@ "begin": "\\s*({)", "end": "\\s*(})", "beginCaptures": { - "1": { "name": "meta.brace.curly.graphql" } + "1": { + "name": "meta.brace.curly.graphql" + } }, "endCaptures": { - "1": { "name": "meta.brace.curly.graphql" } + "1": { + "name": "meta.brace.curly.graphql" + } }, "patterns": [ - { "include": "#connect-string-jsonselection-argument" }, - { "include": "#http-object-jsonselection-property" }, - { "include": "source.graphql#graphql-object-field" }, - { "include": "source.graphql#graphql-value" } + { + "include": "#connect-string-jsonselection-argument" + }, + { + "include": "#http-object-jsonselection-property" + }, + { + "include": "source.graphql#graphql-object-field" + }, + { + "include": "source.graphql#graphql-value" + } ] } ] @@ -114,14 +182,26 @@ "begin": "\\s*(body)\\s*(:)\\s*((\"\"\"))", "end": "((\"\"\"))", "beginCaptures": { - "1": { "name": "variable.parameter.graphql" }, - "2": { "name": "punctuation.colon.graphql" }, - "3": { "name": "string.quoted.double.graphql" }, - "4": { "name": "punctuation.definition.string.begin.graphql" } + "1": { + "name": "variable.parameter.graphql" + }, + "2": { + "name": "punctuation.colon.graphql" + }, + "3": { + "name": "string.quoted.double.graphql" + }, + "4": { + "name": "punctuation.definition.string.begin.graphql" + } }, "endCaptures": { - "1": { "name": "string.quoted.double.graphql" }, - "2": { "name": "punctuation.definition.string.end.graphql" } + "1": { + "name": "string.quoted.double.graphql" + }, + "2": { + "name": "punctuation.definition.string.end.graphql" + } }, "patterns": [ { @@ -135,15 +215,25 @@ "begin": "\\s*(GET|POST|PUT|PATCH|DELETE)(?:\\s*(:))", "end": "(?=\\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\\s*(:))|[\\)}]))|\\s*(,)", "beginCaptures": { - "1": { "name": "variable.parameter.graphql" }, - "2": { "name": "punctuation.colon.graphql" } + "1": { + "name": "variable.parameter.graphql" + }, + "2": { + "name": "punctuation.colon.graphql" + } }, "endCaptures": { - "3": { "name": "punctuation.comma.graphql" } + "3": { + "name": "punctuation.comma.graphql" + } }, "patterns": [ - { "include": "source.apollo.jsonselection#JSONSelectionString" }, - { "include": "source.graphql#graphql-skip-newlines" } + { + "include": "source.apollo.jsonselection#JSONSelectionString" + }, + { + "include": "source.graphql#graphql-skip-newlines" + } ] } } diff --git a/syntaxes/graphql.connectors.yaml b/syntaxes/graphql.connectors.yaml new file mode 100644 index 00000000..e9189562 --- /dev/null +++ b/syntaxes/graphql.connectors.yaml @@ -0,0 +1,131 @@ +scopeName: inline.connectors.graphql +injectionSelector: L:meta.embedded.block.directive.graphql -string -comment +patterns: + - include: "#connect-directive" +repository: + connect-directive: + begin: ((@)\s*(connect)) + end: (?=.) + applyEndPatternLast: 1 + beginCaptures: + "1": + name: entity.name.function.directive.connect.graphql + patterns: + - include: "#connect-arguments" + - include: source.graphql#graphql-comment + - include: source.graphql#literal-quasi-embedded + - include: source.graphql#graphql-skip-newlines + connect-arguments: + name: meta.arguments.connect.graphql + begin: \s*(\() + end: \s*(\)) + beginCaptures: + "1": + name: meta.brace.round.directive.graphql + endCaptures: + "1": + name: meta.brace.round.directive.graphql + patterns: + - include: source.graphql#graphql-comment + - include: "#connect-jsonselection-argument" + - include: "#connect-argument-http" + - include: "#connect-string-jsonselection-argument" + - include: source.graphql#graphql-argument + - include: source.graphql#literal-quasi-embedded + connect-jsonselection-argument: + name: meta.argument.connect.jsonselection.graphql + begin: \s*(selection)(?:\s*(:)) + end: (?=\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\s*(:))|\)))|\s*(,) + beginCaptures: + "1": + name: variable.parameter.graphql + "2": + name: punctuation.colon.graphql + endCaptures: + "3": + name: punctuation.comma.graphql + patterns: + - contentName: meta.embedded.block.jsonselection.graphql + begin: ((""")) + end: ((""")) + beginCaptures: + "1": + name: string.quoted.double.graphql + "2": + name: punctuation.definition.string.begin.graphql + endCaptures: + "1": + name: string.quoted.double.graphql + "2": + name: punctuation.definition.string.end.graphql + patterns: + - include: source.apollo.jsonselection + - include: source.graphql#graphql-skip-newlines + connect-argument-http: + name: meta.argument.connect.http.graphql + begin: \s*(http)\s*(:) + end: (?=\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\s*(:))|\)))|\s*(,) + beginCaptures: + "1": + name: variable.parameter.graphql + "2": + name: punctuation.colon.graphql + endCaptures: + "3": + name: punctuation.comma.graphql + patterns: + - include: "#http-object-value" + - include: source.graphql#graphql-comment + - include: source.graphql#literal-quasi-embedded + http-object-value: + patterns: + - name: meta.objectvalues.connect.http.graphql + begin: \s*({) + end: \s*(}) + beginCaptures: + "1": + name: meta.brace.curly.graphql + endCaptures: + "1": + name: meta.brace.curly.graphql + patterns: + - include: "#connect-string-jsonselection-argument" + - include: "#http-object-jsonselection-property" + - include: source.graphql#graphql-object-field + - include: source.graphql#graphql-value + http-object-jsonselection-property: + name: meta.argument.connect.body.jsonselection.graphql + begin: \s*(body)\s*(:)\s*((""")) + end: ((""")) + beginCaptures: + "1": + name: variable.parameter.graphql + "2": + name: punctuation.colon.graphql + "3": + name: string.quoted.double.graphql + "4": + name: punctuation.definition.string.begin.graphql + endCaptures: + "1": + name: string.quoted.double.graphql + "2": + name: punctuation.definition.string.end.graphql + patterns: + - include: source.apollo.jsonselection + connect-string-jsonselection-argument: + name: meta.argument.connect.string.jsonselection.graphql + contentName: meta.embedded.block.string.jsonselection.graphql + begin: \s*(GET|POST|PUT|PATCH|DELETE)(?:\s*(:)) + end: (?=\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\s*(:))|[\)}]))|\s*(,) + beginCaptures: + "1": + name: variable.parameter.graphql + "2": + name: punctuation.colon.graphql + endCaptures: + "3": + name: punctuation.comma.graphql + patterns: + - include: source.apollo.jsonselection#JSONSelectionString + - include: source.graphql#graphql-skip-newlines From 5738e9aee3af107b4dc435eeaef5c5b6e499f9b2 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Thu, 31 Oct 2024 11:43:22 +0100 Subject: [PATCH 30/34] rename scope according to recommendations --- package.json | 6 +++++- syntaxes/graphql.connectors.json | 2 +- syntaxes/graphql.connectors.yaml | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 67921996..bd3b7a9e 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "watch": "rimraf lib; npm-run-all -p watch:*", "watch:esbuild": "npm run build -- --watch", "watch:tsc": "npm run typecheck -- --watch", + "watch:textmate-yaml": "fswatch syntaxes/*.yaml | sed -u -e 's/\\.yaml$//' | xargs -I {} bash -c \"npx js-yaml {}.yaml > {}.json && echo {}\"", "sampleWorkspace:run": "node src/__e2e__/mockServer.js", "changeset-version": "changeset version && npm i", "changeset-publish": "npm run build -- --production && changeset publish", @@ -159,6 +160,9 @@ }, { "id": "apollo.jsonselection", + "aliases": [ + "Apollo Connectors Mapping Syntax" + ], "filenames": [ "test.apollo.jsonselection" ], @@ -186,7 +190,7 @@ "injectTo": [ "source.graphql" ], - "scopeName": "inline.connectors.graphql", + "scopeName": "source.apollo.connectors.graphql", "path": "./syntaxes/graphql.connectors.json", "embeddedLanguages": { "meta.embedded.block.jsonselection.graphql": "apollo.jsonselection", diff --git a/syntaxes/graphql.connectors.json b/syntaxes/graphql.connectors.json index a9f768a7..82c122bf 100644 --- a/syntaxes/graphql.connectors.json +++ b/syntaxes/graphql.connectors.json @@ -1,5 +1,5 @@ { - "scopeName": "inline.connectors.graphql", + "scopeName": "source.apollo.connectors.graphql", "injectionSelector": "L:meta.embedded.block.directive.graphql -string -comment", "patterns": [ { diff --git a/syntaxes/graphql.connectors.yaml b/syntaxes/graphql.connectors.yaml index e9189562..23b3e232 100644 --- a/syntaxes/graphql.connectors.yaml +++ b/syntaxes/graphql.connectors.yaml @@ -1,4 +1,4 @@ -scopeName: inline.connectors.graphql +scopeName: source.apollo.connectors.graphql injectionSelector: L:meta.embedded.block.directive.graphql -string -comment patterns: - include: "#connect-directive" From c84606b38db210e4852b92620986eb6dbb18dede Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Thu, 31 Oct 2024 12:00:36 +0100 Subject: [PATCH 31/34] rename things to "Apollo Connectors Mapping Syntax" --- package.json | 12 +- .../textmate/test.apollo.jsonselection.snap | 1610 ++++++++--------- syntaxes/connectors.jsonselection.json | 5 +- syntaxes/connectors.jsonselection.yaml | 4 +- syntaxes/graphql.connectors.json | 6 +- syntaxes/graphql.connectors.yaml | 6 +- 6 files changed, 822 insertions(+), 821 deletions(-) diff --git a/package.json b/package.json index bd3b7a9e..21bb742d 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "test:extension": "node src/__e2e__/runTests.js", "test:textmate": "npm run test:textmate-ts && npm run test:textmate-jsonselection && npm run test:textmate-graphql-jsonselection", "test:textmate-ts": "npx vscode-tmgrammar-snap -s source.ts -g src/language-server/__tests__/fixtures/TypeScript.tmLanguage.json src/language-server/__tests__/fixtures/documents/*.ts", - "test:textmate-jsonselection": "npx vscode-tmgrammar-snap -s source.apollo.jsonselection src/__tests__/fixtures/textmate/*.jsonselection", + "test:textmate-jsonselection": "npx vscode-tmgrammar-snap -s source.apollo.connectors.mapping src/__tests__/fixtures/textmate/*.jsonselection", "test:textmate-graphql-jsonselection": "npx vscode-tmgrammar-snap -s source.graphql src/__tests__/fixtures/textmate/*.graphql", "codegen": "graphql-codegen", "vscode:prepublish": "npm run build:production" @@ -159,7 +159,7 @@ "configuration": "./graphql.configuration.json" }, { - "id": "apollo.jsonselection", + "id": "apollo.connectors.mapping", "aliases": [ "Apollo Connectors Mapping Syntax" ], @@ -182,8 +182,8 @@ "path": "./syntaxes/graphql.json" }, { - "language": "apollo.jsonselection", - "scopeName": "source.apollo.jsonselection", + "language": "apollo.connectors.mapping", + "scopeName": "source.apollo.connectors.mapping", "path": "./syntaxes/connectors.jsonselection.json" }, { @@ -193,8 +193,8 @@ "scopeName": "source.apollo.connectors.graphql", "path": "./syntaxes/graphql.connectors.json", "embeddedLanguages": { - "meta.embedded.block.jsonselection.graphql": "apollo.jsonselection", - "meta.embedded.block.string.jsonselection.graphql": "apollo.jsonselection" + "meta.embedded.block.jsonselection.graphql": "apollo.connectors.mapping", + "meta.embedded.block.string.jsonselection.graphql": "apollo.connectors.mapping" } }, { diff --git a/src/__tests__/fixtures/textmate/test.apollo.jsonselection.snap b/src/__tests__/fixtures/textmate/test.apollo.jsonselection.snap index 6914d93f..b53a0963 100644 --- a/src/__tests__/fixtures/textmate/test.apollo.jsonselection.snap +++ b/src/__tests__/fixtures/textmate/test.apollo.jsonselection.snap @@ -1,943 +1,943 @@ ># Examples from https://github.com/apollographql/router/blob/next/apollo-federation/src/sources/connect/json_selection/README.md -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection > >id -#^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key >name -#^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key >abc: some.nested.path { a b c } -#^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection meta.SubSelection -# ^ source.apollo.jsonselection meta.SubSelection punctuation.SubSelection.open -# ^ source.apollo.jsonselection meta.SubSelection -# ^ source.apollo.jsonselection meta.SubSelection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection meta.SubSelection -# ^ source.apollo.jsonselection meta.SubSelection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection meta.SubSelection -# ^ source.apollo.jsonselection meta.SubSelection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection meta.SubSelection -# ^ source.apollo.jsonselection meta.SubSelection punctuation.SubSelection.close +#^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping meta.SubSelection +# ^ source.apollo.connectors.mapping meta.SubSelection punctuation.SubSelection.open +# ^ source.apollo.connectors.mapping meta.SubSelection +# ^ source.apollo.connectors.mapping meta.SubSelection variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping meta.SubSelection +# ^ source.apollo.connectors.mapping meta.SubSelection variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping meta.SubSelection +# ^ source.apollo.connectors.mapping meta.SubSelection variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping meta.SubSelection +# ^ source.apollo.connectors.mapping meta.SubSelection punctuation.SubSelection.close >id -#^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key >name -#^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key >some.nested.path { a b c } -#^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection meta.SubSelection -# ^ source.apollo.jsonselection meta.SubSelection punctuation.SubSelection.open -# ^ source.apollo.jsonselection meta.SubSelection -# ^ source.apollo.jsonselection meta.SubSelection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection meta.SubSelection -# ^ source.apollo.jsonselection meta.SubSelection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection meta.SubSelection -# ^ source.apollo.jsonselection meta.SubSelection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection meta.SubSelection -# ^ source.apollo.jsonselection meta.SubSelection punctuation.SubSelection.close +#^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping meta.SubSelection +# ^ source.apollo.connectors.mapping meta.SubSelection punctuation.SubSelection.open +# ^ source.apollo.connectors.mapping meta.SubSelection +# ^ source.apollo.connectors.mapping meta.SubSelection variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping meta.SubSelection +# ^ source.apollo.connectors.mapping meta.SubSelection variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping meta.SubSelection +# ^ source.apollo.connectors.mapping meta.SubSelection variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping meta.SubSelection +# ^ source.apollo.connectors.mapping meta.SubSelection punctuation.SubSelection.close >names: { -#^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection -# ^^ source.apollo.jsonselection +#^^^^^ source.apollo.connectors.mapping string.unquoted.NamedPathSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedPathSelection +# ^^ source.apollo.connectors.mapping > first: firstName -#^^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^ source.apollo.connectors.mapping +# ^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key > last: lastName -#^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key >} -#^ source.apollo.jsonselection +#^ source.apollo.connectors.mapping ># Also allowed: -#^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection >firstName -#^^^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^^^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key >lastName -#^^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key >postID -#^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key >title -#^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key >author: { -#^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection -# ^^ source.apollo.jsonselection +#^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedPathSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedPathSelection +# ^^ source.apollo.connectors.mapping > id: authorID -#^^ source.apollo.jsonselection -# ^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^ source.apollo.connectors.mapping +# ^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key > name: authorName -#^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key >} -#^ source.apollo.jsonselection +#^ source.apollo.connectors.mapping > title -#^^^^^^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^^^^^ source.apollo.connectors.mapping +# ^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key > year: publication.year -#^^^^^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^^^^^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^^^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key > authorName: author.name -#^^^^^^ source.apollo.jsonselection -# ^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^^^^^ source.apollo.connectors.mapping +# ^^^^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key >id -#^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key >created -#^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key >model -#^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key > ># The { role content } SubSelection is mandatory so the output keys -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection ># can be statically determined: -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection >choices->first.message { role content } -#^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection meta.SubSelection -# ^ source.apollo.jsonselection meta.SubSelection punctuation.SubSelection.open -# ^ source.apollo.jsonselection meta.SubSelection -# ^^^^ source.apollo.jsonselection meta.SubSelection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection meta.SubSelection -# ^^^^^^^ source.apollo.jsonselection meta.SubSelection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection meta.SubSelection -# ^ source.apollo.jsonselection meta.SubSelection punctuation.SubSelection.close +#^^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping meta.SubSelection +# ^ source.apollo.connectors.mapping meta.SubSelection punctuation.SubSelection.open +# ^ source.apollo.connectors.mapping meta.SubSelection +# ^^^^ source.apollo.connectors.mapping meta.SubSelection variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping meta.SubSelection +# ^^^^^^^ source.apollo.connectors.mapping meta.SubSelection variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping meta.SubSelection +# ^ source.apollo.connectors.mapping meta.SubSelection punctuation.SubSelection.close > ># Multiple PathWithSubSelections are allowed in the same SubSelection: -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection >choices->last.message { lastContent: content } -#^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection meta.SubSelection -# ^ source.apollo.jsonselection meta.SubSelection punctuation.SubSelection.open -# ^ source.apollo.jsonselection meta.SubSelection -# ^^^^^^^^^^^ source.apollo.jsonselection meta.SubSelection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection meta.SubSelection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection meta.SubSelection -# ^^^^^^^ source.apollo.jsonselection meta.SubSelection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection meta.SubSelection -# ^ source.apollo.jsonselection meta.SubSelection punctuation.SubSelection.close +#^^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping meta.SubSelection +# ^ source.apollo.connectors.mapping meta.SubSelection punctuation.SubSelection.open +# ^ source.apollo.connectors.mapping meta.SubSelection +# ^^^^^^^^^^^ source.apollo.connectors.mapping meta.SubSelection string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping meta.SubSelection punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping meta.SubSelection +# ^^^^^^^ source.apollo.connectors.mapping meta.SubSelection variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping meta.SubSelection +# ^ source.apollo.connectors.mapping meta.SubSelection punctuation.SubSelection.close > # For some reason /users/{$args.id} returns an object with name -#^^^^^^ source.apollo.jsonselection comment.line.jsonselection punctuation.whitespace.comment.leading.jsonselection -# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection punctuation.whitespace.comment.leading.jsonselection +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection > # and email but no id, so we inject the id manually: -#^^^^^^ source.apollo.jsonselection comment.line.jsonselection punctuation.whitespace.comment.leading.jsonselection -# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection punctuation.whitespace.comment.leading.jsonselection +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection > id: $args.id -#^^^^^^ source.apollo.jsonselection -# ^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.VarPath.dollar -# ^^^^ source.apollo.jsonselection variable.language.VarPath.identifier -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^ source.apollo.jsonselection variable.PathStep.key.identifier +#^^^^^^ source.apollo.connectors.mapping +# ^^ source.apollo.connectors.mapping string.unquoted.NamedPathSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedPathSelection +# ^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.VarPath.dollar +# ^^^^ source.apollo.connectors.mapping variable.language.VarPath.identifier +# ^ source.apollo.connectors.mapping variable.PathStep.dot +# ^^ source.apollo.connectors.mapping variable.PathStep.key.identifier > name -#^^^^^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^^^^^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key > email -#^^^^^^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^^^^^ source.apollo.connectors.mapping +# ^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key >id name friends: friend_ids { id: $ } -#^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection meta.SubSelection -# ^ source.apollo.jsonselection meta.SubSelection punctuation.SubSelection.open -# ^ source.apollo.jsonselection meta.SubSelection -# ^^ source.apollo.jsonselection meta.SubSelection string.unquoted.NamedPathSelection.alias -# ^ source.apollo.jsonselection meta.SubSelection punctuation.colon.NamedPathSelection -# ^ source.apollo.jsonselection meta.SubSelection -# ^ source.apollo.jsonselection meta.SubSelection variable.language.VarPath.dollar -# ^ source.apollo.jsonselection meta.SubSelection -# ^ source.apollo.jsonselection meta.SubSelection punctuation.SubSelection.close +#^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping meta.SubSelection +# ^ source.apollo.connectors.mapping meta.SubSelection punctuation.SubSelection.open +# ^ source.apollo.connectors.mapping meta.SubSelection +# ^^ source.apollo.connectors.mapping meta.SubSelection string.unquoted.NamedPathSelection.alias +# ^ source.apollo.connectors.mapping meta.SubSelection punctuation.colon.NamedPathSelection +# ^ source.apollo.connectors.mapping meta.SubSelection +# ^ source.apollo.connectors.mapping meta.SubSelection variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping meta.SubSelection +# ^ source.apollo.connectors.mapping meta.SubSelection punctuation.SubSelection.close >items: data.nested.items { id name } -#^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection meta.SubSelection -# ^ source.apollo.jsonselection meta.SubSelection punctuation.SubSelection.open -# ^ source.apollo.jsonselection meta.SubSelection -# ^^ source.apollo.jsonselection meta.SubSelection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection meta.SubSelection -# ^^^^ source.apollo.jsonselection meta.SubSelection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection meta.SubSelection -# ^ source.apollo.jsonselection meta.SubSelection punctuation.SubSelection.close +#^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping meta.SubSelection +# ^ source.apollo.connectors.mapping meta.SubSelection punctuation.SubSelection.open +# ^ source.apollo.connectors.mapping meta.SubSelection +# ^^ source.apollo.connectors.mapping meta.SubSelection variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping meta.SubSelection +# ^^^^ source.apollo.connectors.mapping meta.SubSelection variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping meta.SubSelection +# ^ source.apollo.connectors.mapping meta.SubSelection punctuation.SubSelection.close >firstItem: data.nested.items->first { id name } -#^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection meta.SubSelection -# ^ source.apollo.jsonselection meta.SubSelection punctuation.SubSelection.open -# ^ source.apollo.jsonselection meta.SubSelection -# ^^ source.apollo.jsonselection meta.SubSelection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection meta.SubSelection -# ^^^^ source.apollo.jsonselection meta.SubSelection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection meta.SubSelection -# ^ source.apollo.jsonselection meta.SubSelection punctuation.SubSelection.close +#^^^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping meta.SubSelection +# ^ source.apollo.connectors.mapping meta.SubSelection punctuation.SubSelection.open +# ^ source.apollo.connectors.mapping meta.SubSelection +# ^^ source.apollo.connectors.mapping meta.SubSelection variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping meta.SubSelection +# ^^^^ source.apollo.connectors.mapping meta.SubSelection variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping meta.SubSelection +# ^ source.apollo.connectors.mapping meta.SubSelection punctuation.SubSelection.close >firstItemName: data.nested.items->first.name -#^^^^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^^^^^^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key >$.data { id name } -#^ source.apollo.jsonselection variable.language.VarPath.dollar -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^^^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^^^ source.apollo.jsonselection -# ^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection +#^ source.apollo.connectors.mapping variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping variable.PathStep.dot +# ^^^^ source.apollo.connectors.mapping variable.PathStep.key.identifier +# ^^^ source.apollo.connectors.mapping +# ^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping >id: data.id -#^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key >name: data.name -#^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key >all: $.first->and($.second)->and($.third) -#^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.VarPath.dollar -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot -# ^^^^^^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot -# ^^^^^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +#^^^ source.apollo.connectors.mapping string.unquoted.NamedPathSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedPathSelection +# ^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping variable.PathStep.dot +# ^^^^^ source.apollo.connectors.mapping variable.PathStep.key.identifier +# ^^ source.apollo.connectors.mapping punctuation.PathStep.arrow +# ^^^ source.apollo.connectors.mapping variable.PathStep.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.dot +# ^^^^^^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.close +# ^^ source.apollo.connectors.mapping punctuation.PathStep.arrow +# ^^^ source.apollo.connectors.mapping variable.PathStep.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.dot +# ^^^^^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.close >wrapped: field->echo({ fieldValue: @ }) -#^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^^ source.apollo.jsonselection -# ^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.AtPath.at -# ^^^ source.apollo.jsonselection +#^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^^ source.apollo.connectors.mapping +# ^^^^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedPathSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedPathSelection +# ^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.AtPath.at +# ^^^ source.apollo.connectors.mapping >children: parent->echo([@.child1, @.child2, @.child3]) -#^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.AtPath.at -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.AtPath.at -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.AtPath.at -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^^ source.apollo.jsonselection +#^^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.AtPath.at +# ^ source.apollo.connectors.mapping variable.PathStep.dot +# ^^^^^^ source.apollo.connectors.mapping variable.PathStep.key.identifier +# ^^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.AtPath.at +# ^ source.apollo.connectors.mapping variable.PathStep.dot +# ^^^^^^ source.apollo.connectors.mapping variable.PathStep.key.identifier +# ^^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.AtPath.at +# ^ source.apollo.connectors.mapping variable.PathStep.dot +# ^^^^^^ source.apollo.connectors.mapping variable.PathStep.key.identifier +# ^^ source.apollo.connectors.mapping >doubled: numbers->map({ value: @->mul(2) }) -#^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.AtPath.at -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs constant.numeric.LitNumber -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close -# ^^^ source.apollo.jsonselection +#^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^^ source.apollo.connectors.mapping +# ^^^^^ source.apollo.connectors.mapping string.unquoted.NamedPathSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedPathSelection +# ^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.AtPath.at +# ^^ source.apollo.connectors.mapping punctuation.PathStep.arrow +# ^^^ source.apollo.connectors.mapping variable.PathStep.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.connectors.mapping meta.MethodArgs constant.numeric.LitNumber +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.close +# ^^^ source.apollo.connectors.mapping >types: values->map(@->typeof) -#^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.AtPath.at -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection +#^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.AtPath.at +# ^^ source.apollo.connectors.mapping punctuation.PathStep.arrow +# ^^^^^^ source.apollo.connectors.mapping variable.PathStep.identifier +# ^ source.apollo.connectors.mapping >__typename: $("Product") -#^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.VarPath.dollar -# ^ source.apollo.jsonselection -# ^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^ source.apollo.jsonselection +#^^^^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedPathSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedPathSelection +# ^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping +# ^^^^^^^^^ source.apollo.connectors.mapping variable.KeyPath.key.identifier +# ^ source.apollo.connectors.mapping >condition: $(true) -#^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.VarPath.dollar -# ^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection +#^^^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedPathSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedPathSelection +# ^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping >alphabetSlice: $("abcdefghijklmnopqrstuvwxyz")->slice($args.start, $args.end) -#^^^^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.VarPath.dollar -# ^ source.apollo.jsonselection -# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.VarPath.dollar -# ^^^^ source.apollo.jsonselection variable.language.VarPath.identifier -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.VarPath.dollar -# ^^^^ source.apollo.jsonselection variable.language.VarPath.identifier -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^ source.apollo.jsonselection +#^^^^^^^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedPathSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedPathSelection +# ^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping variable.KeyPath.key.identifier +# ^^^ source.apollo.connectors.mapping +# ^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.VarPath.dollar +# ^^^^ source.apollo.connectors.mapping variable.language.VarPath.identifier +# ^ source.apollo.connectors.mapping variable.PathStep.dot +# ^^^^^ source.apollo.connectors.mapping variable.PathStep.key.identifier +# ^^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.VarPath.dollar +# ^^^^ source.apollo.connectors.mapping variable.language.VarPath.identifier +# ^ source.apollo.connectors.mapping variable.PathStep.dot +# ^^^ source.apollo.connectors.mapping variable.PathStep.key.identifier +# ^ source.apollo.connectors.mapping >suffix: results.slice($(-1)->mul($args.suffixLength)) -#^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.VarPath.dollar -# ^^^^^^ source.apollo.jsonselection -# ^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.VarPath.dollar -# ^^^^ source.apollo.jsonselection variable.language.VarPath.identifier -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^^^^^^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^^ source.apollo.jsonselection +#^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.VarPath.dollar +# ^^^^^^ source.apollo.connectors.mapping +# ^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.VarPath.dollar +# ^^^^ source.apollo.connectors.mapping variable.language.VarPath.identifier +# ^ source.apollo.connectors.mapping variable.PathStep.dot +# ^^^^^^^^^^^^ source.apollo.connectors.mapping variable.PathStep.key.identifier +# ^^ source.apollo.connectors.mapping ># The ->echo method returns its first input argument as-is, ignoring -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection ># the input data. Useful for embedding literal values, as in -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection ># $->echo("give me this string"), or wrapping the input value. -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection >__typename: $->echo("Book") -#^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.VarPath.dollar -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^^^^^^ source.apollo.jsonselection meta.MethodArgs string.quoted.LitString -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +#^^^^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedPathSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedPathSelection +# ^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.VarPath.dollar +# ^^ source.apollo.connectors.mapping punctuation.PathStep.arrow +# ^^^^ source.apollo.connectors.mapping variable.PathStep.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^^^^^^ source.apollo.connectors.mapping meta.MethodArgs string.quoted.LitString +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.close >wrapped: field->echo({ fieldValue: @ }) -#^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^^ source.apollo.jsonselection -# ^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.AtPath.at -# ^^^ source.apollo.jsonselection +#^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^^ source.apollo.connectors.mapping +# ^^^^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedPathSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedPathSelection +# ^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.AtPath.at +# ^^^ source.apollo.connectors.mapping > ># Returns the type of the data as a string, e.g. "object", "array", -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection ># "string", "number", "boolean", or "null". Note that `typeof null` is -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection ># "object" in JavaScript but "null" for our purposes. -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection >typeOfValue: value->typeof -#^^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^^^^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key > ># When invoked against an array, ->map evaluates its first argument -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection ># against each element of the array, binding the element values to `@`, -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection ># and returns an array of the results. When invoked against a non-array, -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection ># ->map evaluates its first argument against that value and returns the -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection ># result without wrapping it in an array. -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection >doubled: numbers->map(@->mul(2)) -#^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.AtPath.at -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs constant.numeric.LitNumber -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close -# ^ source.apollo.jsonselection +#^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.AtPath.at +# ^^ source.apollo.connectors.mapping punctuation.PathStep.arrow +# ^^^ source.apollo.connectors.mapping variable.PathStep.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.connectors.mapping meta.MethodArgs constant.numeric.LitNumber +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.close +# ^ source.apollo.connectors.mapping >types: values->map(@->typeof) -#^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.AtPath.at -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection +#^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.AtPath.at +# ^^ source.apollo.connectors.mapping punctuation.PathStep.arrow +# ^^^^^^ source.apollo.connectors.mapping variable.PathStep.identifier +# ^ source.apollo.connectors.mapping > ># Returns true if the data is deeply equal to the first argument, false -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection ># otherwise. Equality is solely value-based (all JSON), no references. -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection >isObject: value->typeof->eq("object") -#^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^ source.apollo.jsonselection +#^^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^^^^^^^^ source.apollo.connectors.mapping variable.KeyPath.key.identifier +# ^ source.apollo.connectors.mapping > ># Takes any number of pairs [candidate, value], and returns value for -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection ># the first candidate that equals the input data. If none of the -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection ># pairs match, a runtime error is reported, but a single-element -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection ># [] array as the final argument guarantees a default value. -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection >__typename: kind->match( -#^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection +#^^^^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping > ["dog", "Canine"], -#^^^^^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection +#^^^^^ source.apollo.connectors.mapping +# ^^^^^ source.apollo.connectors.mapping variable.KeyPath.key.identifier +# ^^ source.apollo.connectors.mapping +# ^^^^^^^^ source.apollo.connectors.mapping variable.KeyPath.key.identifier +# ^^ source.apollo.connectors.mapping > ["cat", "Feline"], -#^^^^^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection -# ^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection +#^^^^^ source.apollo.connectors.mapping +# ^^^^^ source.apollo.connectors.mapping variable.KeyPath.key.identifier +# ^^ source.apollo.connectors.mapping +# ^^^^^^^^ source.apollo.connectors.mapping variable.KeyPath.key.identifier +# ^^ source.apollo.connectors.mapping > ["Exotic"] -#^^^^^ source.apollo.jsonselection -# ^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^ source.apollo.jsonselection +#^^^^^ source.apollo.connectors.mapping +# ^^^^^^^^ source.apollo.connectors.mapping variable.KeyPath.key.identifier +# ^ source.apollo.connectors.mapping >) -#^ source.apollo.jsonselection +#^ source.apollo.connectors.mapping > ># Like ->match, but expects the first element of each pair to evaluate -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection ># to a boolean, returning the second element of the first pair whose -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection ># first element is true. This makes providing a final catch-all case -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection ># easy, since the last pair can be [true, ]. -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection >__typename: kind->matchIf( -#^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection +#^^^^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping > [@->eq("dog"), "Canine"], -#^^^^^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.AtPath.at -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^^^^^ source.apollo.jsonselection meta.MethodArgs string.quoted.LitString -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close -# ^^ source.apollo.jsonselection -# ^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection +#^^^^^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.AtPath.at +# ^^ source.apollo.connectors.mapping punctuation.PathStep.arrow +# ^^ source.apollo.connectors.mapping variable.PathStep.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^^^^^ source.apollo.connectors.mapping meta.MethodArgs string.quoted.LitString +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.close +# ^^ source.apollo.connectors.mapping +# ^^^^^^^^ source.apollo.connectors.mapping variable.KeyPath.key.identifier +# ^^ source.apollo.connectors.mapping > [@->eq("cat"), "Feline"], -#^^^^^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.AtPath.at -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^^^^^ source.apollo.jsonselection meta.MethodArgs string.quoted.LitString -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close -# ^^ source.apollo.jsonselection -# ^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection +#^^^^^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.AtPath.at +# ^^ source.apollo.connectors.mapping punctuation.PathStep.arrow +# ^^ source.apollo.connectors.mapping variable.PathStep.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^^^^^ source.apollo.connectors.mapping meta.MethodArgs string.quoted.LitString +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.close +# ^^ source.apollo.connectors.mapping +# ^^^^^^^^ source.apollo.connectors.mapping variable.KeyPath.key.identifier +# ^^ source.apollo.connectors.mapping > [true, "Exotic"] -#^^^^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^ source.apollo.jsonselection +#^^^^^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^^^^^^ source.apollo.connectors.mapping variable.KeyPath.key.identifier +# ^ source.apollo.connectors.mapping >) -#^ source.apollo.jsonselection +#^ source.apollo.connectors.mapping > ># Arithmetic methods, supporting both integers and floating point values, -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection ># similar to JavaScript. -#^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection >sum: $.a->add($.b)->add($.c) -#^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.VarPath.dollar -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +#^^^ source.apollo.connectors.mapping string.unquoted.NamedPathSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedPathSelection +# ^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping variable.PathStep.dot +# ^ source.apollo.connectors.mapping variable.PathStep.key.identifier +# ^^ source.apollo.connectors.mapping punctuation.PathStep.arrow +# ^^^ source.apollo.connectors.mapping variable.PathStep.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.dot +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.close +# ^^ source.apollo.connectors.mapping punctuation.PathStep.arrow +# ^^^ source.apollo.connectors.mapping variable.PathStep.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.dot +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.close >difference: $.a->sub($.b)->sub($.c) -#^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.VarPath.dollar -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +#^^^^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedPathSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedPathSelection +# ^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping variable.PathStep.dot +# ^ source.apollo.connectors.mapping variable.PathStep.key.identifier +# ^^ source.apollo.connectors.mapping punctuation.PathStep.arrow +# ^^^ source.apollo.connectors.mapping variable.PathStep.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.dot +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.close +# ^^ source.apollo.connectors.mapping punctuation.PathStep.arrow +# ^^^ source.apollo.connectors.mapping variable.PathStep.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.dot +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.close >product: $.a->mul($.b, $.c) -#^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.VarPath.dollar -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.comma.MethodArgs.separator -# ^ source.apollo.jsonselection meta.MethodArgs -# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +#^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedPathSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedPathSelection +# ^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping variable.PathStep.dot +# ^ source.apollo.connectors.mapping variable.PathStep.key.identifier +# ^^ source.apollo.connectors.mapping punctuation.PathStep.arrow +# ^^^ source.apollo.connectors.mapping variable.PathStep.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.dot +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.comma.MethodArgs.separator +# ^ source.apollo.connectors.mapping meta.MethodArgs +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.dot +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.close >quotient: $.a->div($.b) -#^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.VarPath.dollar -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +#^^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedPathSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedPathSelection +# ^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping variable.PathStep.dot +# ^ source.apollo.connectors.mapping variable.PathStep.key.identifier +# ^^ source.apollo.connectors.mapping punctuation.PathStep.arrow +# ^^^ source.apollo.connectors.mapping variable.PathStep.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.dot +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.close >remainder: $.a->mod($.b) -#^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.VarPath.dollar -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +#^^^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedPathSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedPathSelection +# ^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping variable.PathStep.dot +# ^ source.apollo.connectors.mapping variable.PathStep.key.identifier +# ^^ source.apollo.connectors.mapping punctuation.PathStep.arrow +# ^^^ source.apollo.connectors.mapping variable.PathStep.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.dot +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.close > ># Array/string methods -#^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection >first: list->first -#^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key >last: list->last -#^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key >index3: list->get(3) -#^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^^ source.apollo.jsonselection +#^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^^ source.apollo.connectors.mapping >secondToLast: list->get(-2) -#^^^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^^^ source.apollo.jsonselection +#^^^^^^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^^^ source.apollo.connectors.mapping >slice: list->slice(0, 5) -#^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^^^^^ source.apollo.jsonselection +#^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^^^^^ source.apollo.connectors.mapping >substring: string->slice(2, 5) -#^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^^^^^ source.apollo.jsonselection +#^^^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^^^^^ source.apollo.connectors.mapping >arraySize: array->size -#^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key >stringLength: string->size -#^^^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^^^^^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key > ># Object methods -#^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection >aValue: $->echo({ a: 123 })->get("a") -#^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.VarPath.dollar -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject punctuation.LitObject.open -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty variable.LitProperty.key -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty punctuation.colon.LitProperty -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty -# ^^^ source.apollo.jsonselection meta.MethodArgs meta.LitObject meta.LitProperty constant.numeric.LitNumber -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject -# ^ source.apollo.jsonselection meta.MethodArgs meta.LitObject punctuation.LitObject.close -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^^^ source.apollo.jsonselection meta.MethodArgs string.quoted.LitString -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +#^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedPathSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedPathSelection +# ^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.VarPath.dollar +# ^^ source.apollo.connectors.mapping punctuation.PathStep.arrow +# ^^^^ source.apollo.connectors.mapping variable.PathStep.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.connectors.mapping meta.MethodArgs meta.LitObject punctuation.LitObject.open +# ^ source.apollo.connectors.mapping meta.MethodArgs meta.LitObject +# ^ source.apollo.connectors.mapping meta.MethodArgs meta.LitObject meta.LitProperty variable.LitProperty.key +# ^ source.apollo.connectors.mapping meta.MethodArgs meta.LitObject meta.LitProperty punctuation.colon.LitProperty +# ^ source.apollo.connectors.mapping meta.MethodArgs meta.LitObject meta.LitProperty +# ^^^ source.apollo.connectors.mapping meta.MethodArgs meta.LitObject meta.LitProperty constant.numeric.LitNumber +# ^ source.apollo.connectors.mapping meta.MethodArgs meta.LitObject +# ^ source.apollo.connectors.mapping meta.MethodArgs meta.LitObject punctuation.LitObject.close +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.close +# ^^ source.apollo.connectors.mapping punctuation.PathStep.arrow +# ^^^ source.apollo.connectors.mapping variable.PathStep.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^^^ source.apollo.connectors.mapping meta.MethodArgs string.quoted.LitString +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.close >hasKey: object->has("key") -#^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^ source.apollo.jsonselection +#^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^^^^^ source.apollo.connectors.mapping variable.KeyPath.key.identifier +# ^ source.apollo.connectors.mapping >hasAB: object->has("a")->and(object->has("b")) -#^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^^ source.apollo.jsonselection -# ^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^^^ source.apollo.jsonselection variable.KeyPath.key.identifier -# ^^ source.apollo.jsonselection +#^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^^^ source.apollo.connectors.mapping variable.KeyPath.key.identifier +# ^^^ source.apollo.connectors.mapping +# ^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^^^ source.apollo.connectors.mapping variable.KeyPath.key.identifier +# ^^ source.apollo.connectors.mapping >numberOfProperties: object->size -#^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key >keys: object->keys -#^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key >values: object->values -#^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key >entries: object->entries -#^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key >keysFromEntries: object->entries.key -#^^^^^^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^^^^^^^^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key >valuesFromEntries: object->entries.value -#^^^^^^^^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedFieldSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedFieldSelection -# ^ source.apollo.jsonselection -# ^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^^ source.apollo.jsonselection -# ^^^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key -# ^ source.apollo.jsonselection -# ^^^^^ source.apollo.jsonselection variable.NamedFieldSelection.key +#^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedFieldSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedFieldSelection +# ^ source.apollo.connectors.mapping +# ^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^^ source.apollo.connectors.mapping +# ^^^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key +# ^ source.apollo.connectors.mapping +# ^^^^^ source.apollo.connectors.mapping variable.NamedFieldSelection.key > ># Logical methods -#^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection >negation: $.condition->not -#^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.VarPath.dollar -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^^^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection variable.PathStep.identifier +#^^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedPathSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedPathSelection +# ^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping variable.PathStep.dot +# ^^^^^^^^^ source.apollo.connectors.mapping variable.PathStep.key.identifier +# ^^ source.apollo.connectors.mapping punctuation.PathStep.arrow +# ^^^ source.apollo.connectors.mapping variable.PathStep.identifier >bangBang: $.condition->not->not -#^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.VarPath.dollar -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^^^^^^^^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection variable.PathStep.identifier +#^^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedPathSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedPathSelection +# ^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping variable.PathStep.dot +# ^^^^^^^^^ source.apollo.connectors.mapping variable.PathStep.key.identifier +# ^^ source.apollo.connectors.mapping punctuation.PathStep.arrow +# ^^^ source.apollo.connectors.mapping variable.PathStep.identifier +# ^^ source.apollo.connectors.mapping punctuation.PathStep.arrow +# ^^^ source.apollo.connectors.mapping variable.PathStep.identifier >disjunction: $.a->or($.b)->or($.c) -#^^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.VarPath.dollar -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +#^^^^^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedPathSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedPathSelection +# ^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping variable.PathStep.dot +# ^ source.apollo.connectors.mapping variable.PathStep.key.identifier +# ^^ source.apollo.connectors.mapping punctuation.PathStep.arrow +# ^^ source.apollo.connectors.mapping variable.PathStep.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.dot +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.close +# ^^ source.apollo.connectors.mapping punctuation.PathStep.arrow +# ^^ source.apollo.connectors.mapping variable.PathStep.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.dot +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.close >conjunction: $.a->and($.b, $.c) -#^^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.VarPath.dollar -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.comma.MethodArgs.separator -# ^ source.apollo.jsonselection meta.MethodArgs -# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +#^^^^^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedPathSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedPathSelection +# ^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping variable.PathStep.dot +# ^ source.apollo.connectors.mapping variable.PathStep.key.identifier +# ^^ source.apollo.connectors.mapping punctuation.PathStep.arrow +# ^^^ source.apollo.connectors.mapping variable.PathStep.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.dot +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.comma.MethodArgs.separator +# ^ source.apollo.connectors.mapping meta.MethodArgs +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.dot +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.close >aImpliesB: $.a->not->or($.b) -#^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.VarPath.dollar -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection variable.PathStep.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +#^^^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedPathSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedPathSelection +# ^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping variable.PathStep.dot +# ^ source.apollo.connectors.mapping variable.PathStep.key.identifier +# ^^ source.apollo.connectors.mapping punctuation.PathStep.arrow +# ^^^ source.apollo.connectors.mapping variable.PathStep.identifier +# ^^ source.apollo.connectors.mapping punctuation.PathStep.arrow +# ^^ source.apollo.connectors.mapping variable.PathStep.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.dot +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.key.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.close >excludedMiddle: $.toBe->or($.toBe->not)->eq(true) -#^^^^^^^^^^^^^^ source.apollo.jsonselection string.unquoted.NamedPathSelection.alias -# ^ source.apollo.jsonselection punctuation.colon.NamedPathSelection -# ^ source.apollo.jsonselection -# ^ source.apollo.jsonselection variable.language.VarPath.dollar -# ^ source.apollo.jsonselection variable.PathStep.dot -# ^^^^ source.apollo.jsonselection variable.PathStep.key.identifier -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^ source.apollo.jsonselection meta.MethodArgs variable.language.VarPath.dollar -# ^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.dot -# ^^^^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.key.identifier -# ^^ source.apollo.jsonselection meta.MethodArgs punctuation.PathStep.arrow -# ^^^ source.apollo.jsonselection meta.MethodArgs variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close -# ^^ source.apollo.jsonselection punctuation.PathStep.arrow -# ^^ source.apollo.jsonselection variable.PathStep.identifier -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.open -# ^^^^ source.apollo.jsonselection meta.MethodArgs constant.language.LitPrimitive -# ^ source.apollo.jsonselection meta.MethodArgs punctuation.brace.round.MethodArgs.close +#^^^^^^^^^^^^^^ source.apollo.connectors.mapping string.unquoted.NamedPathSelection.alias +# ^ source.apollo.connectors.mapping punctuation.colon.NamedPathSelection +# ^ source.apollo.connectors.mapping +# ^ source.apollo.connectors.mapping variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping variable.PathStep.dot +# ^^^^ source.apollo.connectors.mapping variable.PathStep.key.identifier +# ^^ source.apollo.connectors.mapping punctuation.PathStep.arrow +# ^^ source.apollo.connectors.mapping variable.PathStep.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.language.VarPath.dollar +# ^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.dot +# ^^^^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.key.identifier +# ^^ source.apollo.connectors.mapping meta.MethodArgs punctuation.PathStep.arrow +# ^^^ source.apollo.connectors.mapping meta.MethodArgs variable.PathStep.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.close +# ^^ source.apollo.connectors.mapping punctuation.PathStep.arrow +# ^^ source.apollo.connectors.mapping variable.PathStep.identifier +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.open +# ^^^^ source.apollo.connectors.mapping meta.MethodArgs constant.language.LitPrimitive +# ^ source.apollo.connectors.mapping meta.MethodArgs punctuation.brace.round.MethodArgs.close > ># Tests from https://github.com/apollographql/router/blob/next/apollo-federation/src/sources/connect/url_template.rs -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.jsonselection comment.line.jsonselection +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.apollo.connectors.mapping comment.line.jsonselection > > \ No newline at end of file diff --git a/syntaxes/connectors.jsonselection.json b/syntaxes/connectors.jsonselection.json index bc069a02..d4e6bf04 100644 --- a/syntaxes/connectors.jsonselection.json +++ b/syntaxes/connectors.jsonselection.json @@ -1,6 +1,7 @@ { - "name": "Apollo Connectors JSONSelection", - "scopeName": "source.apollo.jsonselection", + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "name": "Apollo Connectors Mapping Syntax", + "scopeName": "source.apollo.connectors.mapping", "patterns": [ { "include": "#JSONSelection" diff --git a/syntaxes/connectors.jsonselection.yaml b/syntaxes/connectors.jsonselection.yaml index bdf99b61..08301c1a 100644 --- a/syntaxes/connectors.jsonselection.yaml +++ b/syntaxes/connectors.jsonselection.yaml @@ -2,8 +2,8 @@ # npx js-yaml syntaxes/connectors.jsonselection.yaml >| syntaxes/connectors.jsonselection.json # fswatch -0 syntaxes/connectors.jsonselection.yaml | xargs -0 -I {} bash -c "npx js-yaml {} > syntaxes/connectors.jsonselection.json && echo saved" \; # based on https://github.com/apollographql/router/blob/next/apollo-federation/src/sources/connect/json_selection/README.md -# yaml-language-server: $schema=https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json -name: "Apollo Connectors JSONSelection" +$schema: https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json +name: "Apollo Connectors Mapping Syntax" scopeName: "source.apollo.jsonselection" patterns: - include: "#JSONSelection" diff --git a/syntaxes/graphql.connectors.json b/syntaxes/graphql.connectors.json index 82c122bf..00dd066c 100644 --- a/syntaxes/graphql.connectors.json +++ b/syntaxes/graphql.connectors.json @@ -106,7 +106,7 @@ }, "patterns": [ { - "include": "source.apollo.jsonselection" + "include": "source.apollo.connectors.mapping" } ] }, @@ -205,7 +205,7 @@ }, "patterns": [ { - "include": "source.apollo.jsonselection" + "include": "source.apollo.connectors.mapping" } ] }, @@ -229,7 +229,7 @@ }, "patterns": [ { - "include": "source.apollo.jsonselection#JSONSelectionString" + "include": "source.apollo.connectors.mapping#JSONSelectionString" }, { "include": "source.graphql#graphql-skip-newlines" diff --git a/syntaxes/graphql.connectors.yaml b/syntaxes/graphql.connectors.yaml index 23b3e232..fe321201 100644 --- a/syntaxes/graphql.connectors.yaml +++ b/syntaxes/graphql.connectors.yaml @@ -59,7 +59,7 @@ repository: "2": name: punctuation.definition.string.end.graphql patterns: - - include: source.apollo.jsonselection + - include: source.apollo.connectors.mapping - include: source.graphql#graphql-skip-newlines connect-argument-http: name: meta.argument.connect.http.graphql @@ -112,7 +112,7 @@ repository: "2": name: punctuation.definition.string.end.graphql patterns: - - include: source.apollo.jsonselection + - include: source.apollo.connectors.mapping connect-string-jsonselection-argument: name: meta.argument.connect.string.jsonselection.graphql contentName: meta.embedded.block.string.jsonselection.graphql @@ -127,5 +127,5 @@ repository: "3": name: punctuation.comma.graphql patterns: - - include: source.apollo.jsonselection#JSONSelectionString + - include: source.apollo.connectors.mapping#JSONSelectionString - include: source.graphql#graphql-skip-newlines From 4280f23ba22e8121a655588b5b95c6640da1a6df Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Thu, 31 Oct 2024 12:08:42 +0100 Subject: [PATCH 32/34] sort the language at the end of the list --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 21bb742d..fb409942 100644 --- a/package.json +++ b/package.json @@ -161,7 +161,7 @@ { "id": "apollo.connectors.mapping", "aliases": [ - "Apollo Connectors Mapping Syntax" + "[Apollo Connectors Mapping Syntax]" ], "filenames": [ "test.apollo.jsonselection" From 9c2ede1af0f96d11bdde40f7edd86804789f7dea Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Thu, 31 Oct 2024 12:48:18 +0100 Subject: [PATCH 33/34] reduce diff to original graphql grammar --- syntaxes/graphql.connectors.json | 30 ++++++++++++++++++++++++++++- syntaxes/graphql.connectors.yaml | 17 +++++++++++++++- syntaxes/graphql.json | 33 ++++++++++++++++---------------- 3 files changed, 61 insertions(+), 19 deletions(-) diff --git a/syntaxes/graphql.connectors.json b/syntaxes/graphql.connectors.json index 00dd066c..379cbda2 100644 --- a/syntaxes/graphql.connectors.json +++ b/syntaxes/graphql.connectors.json @@ -59,7 +59,7 @@ "include": "#connect-string-jsonselection-argument" }, { - "include": "source.graphql#graphql-argument" + "include": "#graphql-argument" }, { "include": "source.graphql#literal-quasi-embedded" @@ -235,6 +235,34 @@ "include": "source.graphql#graphql-skip-newlines" } ] + }, + "graphql-argument": { + "begin": "\\s*([_A-Za-z][_0-9A-Za-z]*)(?:\\s*(:))", + "end": "(?=\\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\\s*(:))|\\)))|\\s*(,)", + "beginCaptures": { + "1": { + "name": "variable.parameter.graphql" + }, + "2": { + "name": "punctuation.colon.graphql" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.comma.graphql" + } + }, + "patterns": [ + { + "include": "source.graphql#graphql-value" + }, + { + "include": "source.graphql#graphql-comment" + }, + { + "include": "source.graphql#graphql-skip-newlines" + } + ] } } } diff --git a/syntaxes/graphql.connectors.yaml b/syntaxes/graphql.connectors.yaml index fe321201..9b11369b 100644 --- a/syntaxes/graphql.connectors.yaml +++ b/syntaxes/graphql.connectors.yaml @@ -30,7 +30,7 @@ repository: - include: "#connect-jsonselection-argument" - include: "#connect-argument-http" - include: "#connect-string-jsonselection-argument" - - include: source.graphql#graphql-argument + - include: "#graphql-argument" - include: source.graphql#literal-quasi-embedded connect-jsonselection-argument: name: meta.argument.connect.jsonselection.graphql @@ -129,3 +129,18 @@ repository: patterns: - include: source.apollo.connectors.mapping#JSONSelectionString - include: source.graphql#graphql-skip-newlines + graphql-argument: + begin: "\\s*([_A-Za-z][_0-9A-Za-z]*)(?:\\s*(:))" + end: "(?=\\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\\s*(:))|\\)))|\\s*(,)" + beginCaptures: + "1": + name: variable.parameter.graphql + "2": + name: punctuation.colon.graphql + endCaptures: + "3": + name: punctuation.comma.graphql + patterns: + - include: "source.graphql#graphql-value" + - include: "source.graphql#graphql-comment" + - include: "source.graphql#graphql-skip-newlines" diff --git a/syntaxes/graphql.json b/syntaxes/graphql.json index 0c247798..f5972b33 100644 --- a/syntaxes/graphql.json +++ b/syntaxes/graphql.json @@ -449,26 +449,25 @@ }, "patterns": [ { "include": "#graphql-comment" }, - { "include": "#graphql-argument" }, + { + "begin": "\\s*([_A-Za-z][_0-9A-Za-z]*)(?:\\s*(:))", + "end": "(?=\\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\\s*(:))|\\)))|\\s*(,)", + "beginCaptures": { + "1": { "name": "variable.parameter.graphql" }, + "2": { "name": "punctuation.colon.graphql" } + }, + "endCaptures": { + "3": { "name": "punctuation.comma.graphql" } + }, + "patterns": [ + { "include": "#graphql-value" }, + { "include": "#graphql-comment" }, + { "include": "#graphql-skip-newlines" } + ] + }, { "include": "#literal-quasi-embedded" } ] }, - "graphql-argument": { - "begin": "\\s*([_A-Za-z][_0-9A-Za-z]*)(?:\\s*(:))", - "end": "(?=\\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\\s*(:))|\\)))|\\s*(,)", - "beginCaptures": { - "1": { "name": "variable.parameter.graphql" }, - "2": { "name": "punctuation.colon.graphql" } - }, - "endCaptures": { - "3": { "name": "punctuation.comma.graphql" } - }, - "patterns": [ - { "include": "#graphql-value" }, - { "include": "#graphql-comment" }, - { "include": "#graphql-skip-newlines" } - ] - }, "graphql-variable-name": { "match": "\\s*(\\$[_A-Za-z][_0-9A-Za-z]*)", "captures": { From ca52e1f80abdf949508e6a0669cacadbc98aa225 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Thu, 31 Oct 2024 13:07:48 +0100 Subject: [PATCH 34/34] add comments to document injection logic --- syntaxes/graphql.connectors.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/syntaxes/graphql.connectors.yaml b/syntaxes/graphql.connectors.yaml index 9b11369b..ad2fd151 100644 --- a/syntaxes/graphql.connectors.yaml +++ b/syntaxes/graphql.connectors.yaml @@ -1,8 +1,10 @@ scopeName: source.apollo.connectors.graphql +# inject these rules into source.graphql#graphql-directive, before all other patterns (:L), ignoring strings and comments injectionSelector: L:meta.embedded.block.directive.graphql -string -comment patterns: - include: "#connect-directive" repository: + # if we encounter a `@connect` directive, move forward into this set of rules, otherwise it will just follow the default graphql rules connect-directive: begin: ((@)\s*(connect)) end: (?=.) @@ -15,6 +17,7 @@ repository: - include: source.graphql#graphql-comment - include: source.graphql#literal-quasi-embedded - include: source.graphql#graphql-skip-newlines + # a variation of source.graphql#graphql-arguments connect-arguments: name: meta.arguments.connect.graphql begin: \s*(\() @@ -27,11 +30,19 @@ repository: name: meta.brace.round.directive.graphql patterns: - include: source.graphql#graphql-comment + # this was added - include: "#connect-jsonselection-argument" + # this was added - include: "#connect-argument-http" + # this was added - include: "#connect-string-jsonselection-argument" + # this is also present in the original source.graphql#graphql-arguments, but as an inlined pattern + # moved into it's own rule here for readability - include: "#graphql-argument" - include: source.graphql#literal-quasi-embedded + # based to #graphql-argument, but only matching `selection` arguments + # with a sub-pattern to match """ blocks and embed the + # source.apollo.connectors.mapping grammar into those connect-jsonselection-argument: name: meta.argument.connect.jsonselection.graphql begin: \s*(selection)(?:\s*(:)) @@ -61,6 +72,7 @@ repository: patterns: - include: source.apollo.connectors.mapping - include: source.graphql#graphql-skip-newlines + # based to #graphql-argument, but only matching `http` arguments connect-argument-http: name: meta.argument.connect.http.graphql begin: \s*(http)\s*(:) @@ -74,9 +86,12 @@ repository: "3": name: punctuation.comma.graphql patterns: + # we know that the child of this can not be a full #graphql-value, but only an object + # and we want to look for connectors-specific keys inside of that - include: "#http-object-value" - include: source.graphql#graphql-comment - include: source.graphql#literal-quasi-embedded + # based on source.graphql#graphql-object-value http-object-value: patterns: - name: meta.objectvalues.connect.http.graphql @@ -89,10 +104,14 @@ repository: "1": name: meta.brace.curly.graphql patterns: + # this was added for GET/POST/PUT/PATCH/DELETE - include: "#connect-string-jsonselection-argument" + # this was added for body - include: "#http-object-jsonselection-property" + # original child patterns of source.graphql#graphql-object-value - include: source.graphql#graphql-object-field - include: source.graphql#graphql-value + # handling for @connect(http: { body: """ ... """ }) http-object-jsonselection-property: name: meta.argument.connect.body.jsonselection.graphql begin: \s*(body)\s*(:)\s*((""")) @@ -113,6 +132,7 @@ repository: name: punctuation.definition.string.end.graphql patterns: - include: source.apollo.connectors.mapping + # handling for @connect(GET: " ... ") connect-string-jsonselection-argument: name: meta.argument.connect.string.jsonselection.graphql contentName: meta.embedded.block.string.jsonselection.graphql @@ -129,6 +149,7 @@ repository: patterns: - include: source.apollo.connectors.mapping#JSONSelectionString - include: source.graphql#graphql-skip-newlines + # repeating an inlined pattern that's found within source.graphql#graphql-arguments here to only have minimal changes to graphql.json graphql-argument: begin: "\\s*([_A-Za-z][_0-9A-Za-z]*)(?:\\s*(:))" end: "(?=\\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\\s*(:))|\\)))|\\s*(,)"