From 0f67eb2d84bdfc4204ad7c5eb6576dc295b89fe5 Mon Sep 17 00:00:00 2001 From: Isak Date: Tue, 7 Jan 2025 13:18:55 +0100 Subject: [PATCH] fixed bad merge --- .../autocompletion/completionCoreCompletions.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/language-support/src/autocompletion/completionCoreCompletions.ts b/packages/language-support/src/autocompletion/completionCoreCompletions.ts index 9685da13..4d25203c 100644 --- a/packages/language-support/src/autocompletion/completionCoreCompletions.ts +++ b/packages/language-support/src/autocompletion/completionCoreCompletions.ts @@ -474,6 +474,8 @@ export function completionCoreCompletion( // this rule is used for usernames and roles. CypherParser.RULE_commandNameExpression, CypherParser.RULE_procedureResultItem, + CypherParser.RULE_cypherVersion, + CypherParser.RULE_cypher, // Either enable the helper rules for lexer clashes, // or collect all console commands like below with symbolicNameString @@ -509,6 +511,20 @@ export function completionCoreCompletion( const ruleCompletions = Array.from(candidates.rules.entries()).flatMap( (candidate): CompletionItem[] => { const [ruleNumber, candidateRule] = candidate; + if (ruleNumber === CypherParser.RULE_cypher) { + return [ + ...cypherVersionCompletions(), + { + label: 'CYPHER', + kind: CompletionItemKind.Keyword, + }, + ]; + } + + if (ruleNumber === CypherParser.RULE_cypherVersion) { + return versionCompletions(); + } + if (ruleNumber === CypherParser.RULE_procedureResultItem) { const callContext = findParent( parsingResult.stopNode.parentCtx,