Skip to content

Commit 6866132

Browse files
neo4j-browser-botgithub-actions[bot]angrykoalaanderson4j
authored
Automated update of artifacts to neo4j version 2026.07.0 (#704)
* Updates artifacts to those from latest dev snapshot 2026.07.0 * WIP add missing lexer keywords * fix clash between auto keyword and auto console command * add changeset * Apply suggestions from code review Co-authored-by: Isak Nilsson <143806924+anderson4j@users.noreply.github.com> --------- Co-authored-by: Dev Artifact Bot <github-actions[bot]@users.noreply.github.com> Co-authored-by: angrykoala <angrykoala@outlook.es> Co-authored-by: Isak <isak.nilsson@neo4j.com> Co-authored-by: Isak Nilsson <143806924+anderson4j@users.noreply.github.com>
1 parent 0400f27 commit 6866132

14 files changed

Lines changed: 14059 additions & 13782 deletions

File tree

.changeset/icy-forks-yawn.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@neo4j-cypher/language-support": patch
3+
"@neo4j-cypher/react-codemirror": patch
4+
"@neo4j-cypher/lint-worker": patch
5+
---
6+
7+
Update grammar and semantic analysis to 2026.07

packages/language-support/src/antlr-grammar/Cypher25Lexer.g4

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,10 @@ AUTH
183183
: A U T H
184184
;
185185
186+
AUTO
187+
: A U T O
188+
;
189+
186190
BAR
187191
: '|'
188192
;
@@ -395,6 +399,10 @@ DOLLAR
395399
: '$'
396400
;
397401
402+
DISJOINT
403+
: D I S J O I N T
404+
;
405+
398406
DISTINCT
399407
: D I S T I N C T
400408
;
@@ -1408,6 +1416,10 @@ VARCHAR
14081416
: V A R C H A R
14091417
;
14101418
1419+
VIA
1420+
: V I A
1421+
;
1422+
14111423
VECTOR
14121424
: V E C T O R
14131425
;

packages/language-support/src/antlr-grammar/Cypher25Parser.g4

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,8 @@ hint
257257
;
258258

259259
expandHintStep
260-
: (ALL | INTO)? FROM variable TO variable
260+
: (ALL | INTO)? FROM from=variable TO to=variable (VIA via=variable)?
261+
| (ALL | INTO)? VIA via=variable
261262
;
262263

263264
mergeClause
@@ -321,13 +322,23 @@ subqueryScope
321322
;
322323

323324
subqueryInTransactionsParameters
324-
: IN (expression? CONCURRENT)? TRANSACTIONS (subqueryInTransactionsBatchParameters | subqueryInTransactionsErrorParameters | subqueryInTransactionsReportParameters)*
325+
: IN (expression? CONCURRENT)? TRANSACTIONS (subqueryInTransactionsBatchParameters | subqueryInTransactionsDisjointByParameters | subqueryInTransactionsErrorParameters | subqueryInTransactionsReportParameters)*
325326
;
326327

327328
subqueryInTransactionsBatchParameters
328329
: OF expression (ROW | ROWS)
329330
;
330331

332+
subqueryInTransactionsDisjointByParameters
333+
: DISJOINT BY AUTO
334+
| DISJOINT BY NONE
335+
| DISJOINT BY LPAREN subqueryInTransactionsDisjointByExpressions RPAREN
336+
;
337+
338+
subqueryInTransactionsDisjointByExpressions
339+
: expression (COMMA expression)*
340+
;
341+
331342
subqueryInTransactionsErrorParameters
332343
: ON ERROR RETRY (subqueryInTransactionsRetryParameters)? (THEN (CONTINUE | BREAK | FAIL))?
333344
| ON ERROR (CONTINUE | BREAK | FAIL)
@@ -1431,6 +1442,11 @@ authRuleKeywords
14311442
: AUTH (RULE | RULES)
14321443
;
14331444

1445+
commandToken
1446+
: COMMAND
1447+
| COMMANDS
1448+
;
1449+
14341450
// Server commands
14351451

14361452
enableServerCommand
@@ -1480,7 +1496,7 @@ renameRole
14801496
;
14811497

14821498
showRoles
1483-
: (ALL | POPULATED)? roleToken (WITH (USER | USERS | authRuleKeywords))? showCommandYield?
1499+
: (ALL | POPULATED)? roleToken (WITH (USER | USERS | authRuleKeywords))? (AS commandToken)? showCommandYield?
14841500
;
14851501

14861502
grantRole
@@ -1626,7 +1642,7 @@ showUserPrivileges
16261642
;
16271643

16281644
privilegeAsCommand
1629-
: AS REVOKE? (COMMAND | COMMANDS)
1645+
: AS REVOKE? commandToken
16301646
;
16311647

16321648
privilegeToken
@@ -1931,7 +1947,7 @@ dropAuthRule
19311947
;
19321948

19331949
showAuthRules
1934-
: authRuleKeywords (AS (COMMAND | COMMANDS))? showCommandYield?
1950+
: authRuleKeywords (AS commandToken)? showCommandYield?
19351951
;
19361952

19371953
// Database commands
@@ -2219,6 +2235,7 @@ unescapedSymbolicNameString_
22192235
| ASSIGN
22202236
| AT
22212237
| AUTH
2238+
| AUTO
22222239
| BINDINGS
22232240
| BOOL
22242241
| BOOLEAN
@@ -2267,6 +2284,7 @@ unescapedSymbolicNameString_
22672284
| DESTROY
22682285
| DETACH
22692286
| DIFFERENT
2287+
| DISJOINT
22702288
| DISTINCT
22712289
| DRIVER
22722290
| DOT_METRIC
@@ -2492,6 +2510,7 @@ unescapedSymbolicNameString_
24922510
| USERS
24932511
| USING
24942512
| VALUE
2513+
| VIA
24952514
| VECTOR
24962515
| VECTOR_DISTANCE
24972516
| VECTOR_NORM

packages/language-support/src/antlr-grammar/CypherCmdLexer.g4

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,3 @@ PLAY: P L A Y;
2525
ACCESSMODE: A C C E S S '-' M O D E;
2626

2727
HELP: H E L P;
28-
29-
AUTO: A U T O;

packages/language-support/src/antlr-grammar/CypherCmdParser.g4

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ accessModeCmd: ACCESSMODE accessModeArgs?;
5959

6060
helpCmd: HELP;
6161

62-
autoCmd: AUTO statement;
62+
autoCmd: autoCompletionRule statement;
6363

6464
// These rules are needed to distinguish cypher <-> commands, for example `USE` and `:use` in autocompletion
6565
listCompletionRule: LIST;
@@ -72,6 +72,8 @@ readCompletionRule: READ;
7272

7373
writeCompletionRule: WRITE;
7474

75+
autoCompletionRule: AUTO;
76+
7577
// This rule overrides the identifiers adding EXPLAIN, PROFILE, etc
7678
unescapedSymbolicNameString:
7779
preparserKeyword

packages/language-support/src/autocompletion/completionCoreCompletions.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,7 @@ export function completionCoreCompletion(
525525
CypherParser.RULE_serverCompletionRule,
526526
CypherParser.RULE_readCompletionRule,
527527
CypherParser.RULE_writeCompletionRule,
528+
CypherParser.RULE_autoCompletionRule,
528529
]
529530
: [CypherParser.RULE_consoleCommand]),
530531

@@ -778,6 +779,10 @@ export function completionCoreCompletion(
778779
return [{ label: 'write', kind: CompletionItemKind.Event }];
779780
}
780781

782+
if (ruleNumber === CypherParser.RULE_autoCompletionRule) {
783+
return [{ label: 'auto', kind: CompletionItemKind.Event }];
784+
}
785+
781786
return [];
782787
},
783788
);

packages/language-support/src/lexerSymbols.ts

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ export const lexerKeywords = [
114114
CypherLexer.ADMINISTRATOR,
115115
CypherLexer.ALIAS,
116116
CypherLexer.ALIASES,
117+
CypherLexer.ALL_SHORTEST_PATHS,
117118
CypherLexer.ALL,
118119
CypherLexer.ALLREDUCE,
119-
CypherLexer.ALL_SHORTEST_PATHS,
120120
CypherLexer.ALTER,
121121
CypherLexer.AND,
122122
CypherLexer.ANY,
@@ -127,6 +127,7 @@ export const lexerKeywords = [
127127
CypherLexer.ASSIGN,
128128
CypherLexer.AT,
129129
CypherLexer.AUTH,
130+
CypherLexer.AUTO,
130131
CypherLexer.BINDINGS,
131132
CypherLexer.BOOL,
132133
CypherLexer.BOOLEAN,
@@ -138,12 +139,13 @@ export const lexerKeywords = [
138139
CypherLexer.CALL,
139140
CypherLexer.CASCADE,
140141
CypherLexer.CASE,
141-
CypherLexer.CIDR,
142142
CypherLexer.CHANGE,
143+
CypherLexer.CIDR,
143144
CypherLexer.COLLECT,
144145
CypherLexer.COMMAND,
145146
CypherLexer.COMMANDS,
146147
CypherLexer.COMPOSITE,
148+
CypherLexer.CONCURRENT,
147149
CypherLexer.CONDITION,
148150
CypherLexer.CONSTRAINT,
149151
CypherLexer.CONSTRAINTS,
@@ -155,7 +157,6 @@ export const lexerKeywords = [
155157
CypherLexer.CREATE,
156158
CypherLexer.CREDENTIAL,
157159
CypherLexer.CSV,
158-
CypherLexer.CONCURRENT,
159160
CypherLexer.CURRENT,
160161
CypherLexer.DATA,
161162
CypherLexer.DATABASE,
@@ -174,6 +175,7 @@ export const lexerKeywords = [
174175
CypherLexer.DESTROY,
175176
CypherLexer.DETACH,
176177
CypherLexer.DIFFERENT,
178+
CypherLexer.DISJOINT,
177179
CypherLexer.DISTINCT,
178180
CypherLexer.DOT_METRIC,
179181
CypherLexer.DRIVER,
@@ -192,8 +194,8 @@ export const lexerKeywords = [
192194
CypherLexer.END,
193195
CypherLexer.ENDS,
194196
CypherLexer.ERROR,
195-
CypherLexer.EUCLIDEAN,
196197
CypherLexer.EUCLIDEAN_SQUARED,
198+
CypherLexer.EUCLIDEAN,
197199
CypherLexer.EXECUTABLE,
198200
CypherLexer.EXECUTE,
199201
CypherLexer.EXIST,
@@ -236,15 +238,15 @@ export const lexerKeywords = [
236238
CypherLexer.INFINITY,
237239
CypherLexer.INSERT,
238240
CypherLexer.INT,
239-
CypherLexer.INT8,
240241
CypherLexer.INT16,
241242
CypherLexer.INT32,
242243
CypherLexer.INT64,
244+
CypherLexer.INT8,
243245
CypherLexer.INTEGER,
244-
CypherLexer.INTEGER8,
245246
CypherLexer.INTEGER16,
246247
CypherLexer.INTEGER32,
247248
CypherLexer.INTEGER64,
249+
CypherLexer.INTEGER8,
248250
CypherLexer.INTO,
249251
CypherLexer.IS,
250252
CypherLexer.JOIN,
@@ -276,8 +278,8 @@ export const lexerKeywords = [
276278
CypherLexer.NFKC,
277279
CypherLexer.NFKD,
278280
CypherLexer.NODE,
279-
CypherLexer.NODETACH,
280281
CypherLexer.NODES,
282+
CypherLexer.NODETACH,
281283
CypherLexer.NONE,
282284
CypherLexer.NORMALIZE,
283285
CypherLexer.NORMALIZED,
@@ -302,15 +304,15 @@ export const lexerKeywords = [
302304
CypherLexer.PLAINTEXT,
303305
CypherLexer.POINT,
304306
CypherLexer.POPULATED,
305-
CypherLexer.PRIMARY,
306307
CypherLexer.PRIMARIES,
308+
CypherLexer.PRIMARY,
307309
CypherLexer.PRIVILEGE,
308310
CypherLexer.PRIVILEGES,
309311
CypherLexer.PROCEDURE,
310312
CypherLexer.PROCEDURES,
311313
CypherLexer.PROPERTIES,
312-
CypherLexer.PROPERTY,
313314
CypherLexer.PROPERTY_EXISTS,
315+
CypherLexer.PROPERTY,
314316
CypherLexer.PROVIDER,
315317
CypherLexer.PROVIDERS,
316318
CypherLexer.RANGE,
@@ -342,10 +344,10 @@ export const lexerKeywords = [
342344
CypherLexer.SCAN,
343345
CypherLexer.SCORE,
344346
CypherLexer.SEARCH,
345-
CypherLexer.SECONDARY,
346-
CypherLexer.SECONDARIES,
347347
CypherLexer.SEC,
348348
CypherLexer.SECOND,
349+
CypherLexer.SECONDARIES,
350+
CypherLexer.SECONDARY,
349351
CypherLexer.SECONDS,
350352
CypherLexer.SEEK,
351353
CypherLexer.SERVER,
@@ -355,8 +357,8 @@ export const lexerKeywords = [
355357
CypherLexer.SETTINGS,
356358
CypherLexer.SHARD,
357359
CypherLexer.SHARDS,
358-
CypherLexer.SHORTEST,
359360
CypherLexer.SHORTEST_PATH,
361+
CypherLexer.SHORTEST,
360362
CypherLexer.SHOW,
361363
CypherLexer.SIGNED,
362364
CypherLexer.SINGLE,
@@ -365,7 +367,6 @@ export const lexerKeywords = [
365367
CypherLexer.STARTS,
366368
CypherLexer.STATUS,
367369
CypherLexer.STOP,
368-
CypherLexer.VARCHAR,
369370
CypherLexer.STRING,
370371
CypherLexer.SUPPORTED,
371372
CypherLexer.SUSPENDED,
@@ -400,10 +401,12 @@ export const lexerKeywords = [
400401
CypherLexer.USING,
401402
CypherLexer.UUID,
402403
CypherLexer.VALUE,
403-
CypherLexer.VECTOR,
404+
CypherLexer.VARCHAR,
404405
CypherLexer.VECTOR_DISTANCE,
405406
CypherLexer.VECTOR_NORM,
407+
CypherLexer.VECTOR,
406408
CypherLexer.VERTEX,
409+
CypherLexer.VIA,
407410
CypherLexer.WAIT,
408411
CypherLexer.WHEN,
409412
CypherLexer.WHERE,
@@ -433,7 +436,6 @@ export const lexerConsoleCmds = [
433436
CypherLexer.PLAY,
434437
CypherLexer.ACCESSMODE,
435438
CypherLexer.HELP,
436-
CypherLexer.AUTO,
437439
];
438440

439441
function toTokentypeObject(arr: number[], tokenType: CypherTokenType) {

packages/language-support/src/syntaxHighlighting/syntaxHighlighting.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { ParseTreeWalker, TerminalNode, Token } from 'antlr4';
33
import {
44
AccessModeArgsContext,
55
ArrowLineContext,
6+
AutoCompletionRuleContext,
67
BooleanLiteralContext,
78
ConsoleCommandContext,
89
CypherOptionNameContext,
@@ -276,6 +277,12 @@ class SyntaxHighlighter extends CypherParserListener {
276277
);
277278
};
278279

280+
exitAutoCompletionRule = (ctx: AutoCompletionRuleContext) => {
281+
const auto = ctx.AUTO();
282+
283+
this.addToken(auto.symbol, CypherTokenType.consoleCommand, auto.getText());
284+
};
285+
279286
exitParamsArgs = (ctx: ParamsArgsContext) => {
280287
const clear = ctx.CLEAR();
281288
if (clear) {

packages/language-support/src/syntaxValidation/completionCoreErrors.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export function completionCoreErrormessage(
5353
[CypherParser.RULE_serverCompletionRule]: 'server',
5454
[CypherParser.RULE_readCompletionRule]: 'read',
5555
[CypherParser.RULE_writeCompletionRule]: 'write',
56+
[CypherParser.RULE_autoCompletionRule]: 'auto',
5657
}
5758
: { [CypherParser.RULE_consoleCommand]: null }),
5859
};

0 commit comments

Comments
 (0)