Skip to content

Commit

Permalink
Fixed missing or and and keywords and auto content assist in AQL view…
Browse files Browse the repository at this point in the history
… configuration.
  • Loading branch information
ylussaud committed Feb 21, 2024
1 parent 5652d9c commit 7a69ec1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2017 Obeo.
* Copyright (c) 2017, 2024 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -114,7 +114,7 @@ public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceVie
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
final ContentAssistant assistant = new ContentAssistant();
assistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE);
assistant.enableAutoActivation(true);
assistant.enableAutoActivation(false);
assistant.setAutoActivationDelay(COMPLETION_AUTO_ACTIVATION_DELAY);
assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2017 Obeo.
* Copyright (c) 2017, 2024 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -30,7 +30,7 @@ public class AQLScanner implements ITokenScanner {
/**
* Keyword regular expression.
*/
private static final String KEYWORD_REGEX = "if|then|else|endif|let|in|true|false|null|not";
private static final String KEYWORD_REGEX = "if|then|else|endif|let|in|true|false|null|not|and|or";

/**
* String literal regular expression.
Expand All @@ -51,8 +51,9 @@ public class AQLScanner implements ITokenScanner {
/**
* Scanner {@link Pattern}.
*/
private static final Pattern SCANNER = Pattern.compile("(\\s+)|((?<![a-zA-Z])(" + KEYWORD_REGEX + ")(?![a-zA-Z]))|("
+ STRING_LITERAL_REGEX + ")|((?<![a-zA-Z])((String|Integer|Real|Boolean)(?![a-zA-Z]))|Sequence(?=\\()|OrderedSet(?=\\()|"
private static final Pattern SCANNER = Pattern.compile("(\\s+)|((?<![a-zA-Z])(" + KEYWORD_REGEX
+ ")(?![a-zA-Z]))|(" + STRING_LITERAL_REGEX
+ ")|((?<![a-zA-Z])((String|Integer|Real|Boolean)(?![a-zA-Z]))|Sequence(?=\\()|OrderedSet(?=\\()|"
+ ECLASSIFIER_SET_TYPE_REGEX + "|" + ECLASSIFIER_TYPE_REGEX + ")");

/**
Expand Down Expand Up @@ -129,8 +130,8 @@ public class AQLScanner implements ITokenScanner {
public AQLScanner(ColorManager colorManager) {
keywordToken = new Token(new TextAttribute(colorManager.getColor(IAQLColorConstants.KEYWORD)));
stringToken = new Token(new TextAttribute(colorManager.getColor(IAQLColorConstants.STRING)));
typeLiteralToken = new Token(
new TextAttribute(colorManager.getColor(IAQLColorConstants.TYPE_LITERAL)));
typeLiteralToken = new Token(new TextAttribute(colorManager.getColor(
IAQLColorConstants.TYPE_LITERAL)));
}

/**
Expand Down

0 comments on commit 7a69ec1

Please sign in to comment.