You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by ju...@apache.org on 2020/12/06 22:56:40 UTC
[netbeans] branch master updated: [NETBEANS-5091] PHP - more
improvements for constants in code completion
This is an automated email from the ASF dual-hosted git repository.
junichi11 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/master by this push:
new d139f6d [NETBEANS-5091] PHP - more improvements for constants in code completion
new e5a80b4 Merge pull request #2578 from KacerCZ/netbeans-5091-class-constants-improvements
d139f6d is described below
commit d139f6d1ab0a833407b75e6e419ea0b75ecd6b5e
Author: Tomas Prochazka <ka...@razdva.cz>
AuthorDate: Thu Dec 3 23:36:06 2020 +0100
[NETBEANS-5091] PHP - more improvements for constants in code completion
https://issues.apache.org/jira/browse/NETBEANS-5091
- Improved display of class constants (previous change affected only global constants).
- Display more values, not only the first one.
- Unsupported key or value is displayed as "?".
- Conversion code was moved to parent class (`ClassConstantDeclarationInfo`) and child class (`ConstantDeclarationInfo`) uses the same method.
- Added new tests and updated existing.
---
.../model/nodes/ClassConstantDeclarationInfo.java | 78 +++++++++++++++++++---
.../model/nodes/ConstantDeclarationInfo.java | 67 -------------------
.../testfiles/completion/lib/php56/classConst.php | 41 ++++++++++++
.../classConst.php.testClassConst_01.completion | 4 ++
.../classConst.php.testClassConst_02.completion | 4 ++
.../classConst.php.testClassConst_03.completion | 4 ++
.../classConst.php.testClassConst_04.completion | 4 ++
.../classConst.php.testClassConst_05.completion | 4 ++
.../classConst.php.testClassConst_06.completion | 4 ++
.../classConst.php.testClassConst_07.completion | 4 ++
.../testfiles/completion/lib/php56/globalConst.php | 35 ++++++++++
.../globalConst.php.testGlobalConst_01.completion | 4 ++
.../globalConst.php.testGlobalConst_02.completion | 4 ++
.../globalConst.php.testGlobalConst_03.completion | 4 ++
.../globalConst.php.testGlobalConst_04.completion | 4 ++
.../globalConst.php.testGlobalConst_05.completion | 4 ++
.../globalConst.php.testGlobalConst_06.completion | 4 ++
.../globalConst.php.testGlobalConst_07.completion | 4 ++
...testContextSensitiveLexerInterface02.completion | 40 +++++------
...stSpreadOperatorInArrayExpression_02.completion | 14 ++--
...tSpreadOperatorInArrayExpression_02a.completion | 14 ++--
...stSpreadOperatorInArrayExpression_03.completion | 14 ++--
...stSpreadOperatorInArrayExpression_04.completion | 14 ++--
...atorInArrayExpression_GlobalConst_01.completion | 14 ++--
...atorInArrayExpression_GlobalConst_02.completion | 14 ++--
...atorInArrayExpression_GlobalConst_03.completion | 14 ++--
...atorInArrayExpression_GlobalConst_09.completion | 14 ++--
...hp.testSpreadOperatorInClassConst_00.completion | 10 +--
...hp.testSpreadOperatorInClassConst_01.completion | 10 +--
...hp.testSpreadOperatorInClassConst_02.completion | 10 +--
...hp.testSpreadOperatorInClassConst_04.completion | 10 +--
...hp.testSpreadOperatorInClassConst_06.completion | 10 +--
...hp.testSpreadOperatorInClassConst_07.completion | 12 ++--
...hp.testSpreadOperatorInClassConst_08.completion | 10 +--
...hp.testSpreadOperatorInClassConst_10.completion | 10 +--
...hp.testSpreadOperatorInClassConst_11.completion | 8 +--
...hp.testSpreadOperatorInClassConst_12.completion | 10 +--
...hp.testSpreadOperatorInClassConst_15.completion | 10 +--
.../testClassConstantVisibility.php.indexed | 2 +-
.../editor/completion/PHP56CodeCompletionTest.java | 56 ++++++++++++++++
40 files changed, 388 insertions(+), 209 deletions(-)
diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/ClassConstantDeclarationInfo.java b/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/ClassConstantDeclarationInfo.java
index 53efa28..8413a38 100644
--- a/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/ClassConstantDeclarationInfo.java
+++ b/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/ClassConstantDeclarationInfo.java
@@ -22,20 +22,29 @@ package org.netbeans.modules.php.editor.model.nodes;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import org.netbeans.api.annotations.common.CheckForNull;
import org.netbeans.modules.csl.api.OffsetRange;
import org.netbeans.modules.php.editor.api.PhpModifiers;
import org.netbeans.modules.php.editor.api.QualifiedName;
import org.netbeans.modules.php.editor.model.nodes.ASTNodeInfo.Kind;
+import org.netbeans.modules.php.editor.parser.astnodes.ArrayCreation;
+import org.netbeans.modules.php.editor.parser.astnodes.ArrayElement;
import org.netbeans.modules.php.editor.parser.astnodes.ConstantDeclaration;
import org.netbeans.modules.php.editor.parser.astnodes.Expression;
import org.netbeans.modules.php.editor.parser.astnodes.Identifier;
import org.netbeans.modules.php.editor.parser.astnodes.Scalar;
import org.netbeans.modules.php.editor.parser.astnodes.UnaryOperation;
+import org.netbeans.modules.php.editor.parser.astnodes.UnpackableArrayElement;
+import org.openide.util.NbBundle;
/**
* @author Radek Matous
*/
public class ClassConstantDeclarationInfo extends ASTNodeInfo<Identifier> {
+ // Array display is stopped after this length of string is reached.
+ private static final int ARRAY_CUT_LENGTH = 50;
+ private static final String UNKNOWN_VALUE = "?"; //NOI18N
+
private final String value;
private final ConstantDeclaration constantDeclaration;
@@ -51,18 +60,9 @@ public class ClassConstantDeclarationInfo extends ASTNodeInfo<Identifier> {
Iterator<Expression> iteratorInitializers = constantDeclaration.getInitializers().iterator();
Identifier name;
while (iteratorNames.hasNext()) {
- String value = null;
name = iteratorNames.next();
Expression initializer = iteratorInitializers.next();
- if (initializer instanceof Scalar) {
- value = ((Scalar) initializer).getStringValue();
- } else if (initializer instanceof UnaryOperation) {
- UnaryOperation unaryOperation = (UnaryOperation) initializer;
- Expression expression = unaryOperation.getExpression();
- if (expression instanceof Scalar) {
- value = unaryOperation.getOperator() + ((Scalar) expression).getStringValue();
- }
- }
+ String value = getConstantValue(initializer);
retval.add(new ClassConstantDeclarationInfo(name, value, constantDeclaration));
}
return retval;
@@ -97,4 +97,62 @@ public class ClassConstantDeclarationInfo extends ASTNodeInfo<Identifier> {
return PhpModifiers.fromBitMask(constantDeclaration.getModifier());
}
+ @CheckForNull
+ protected static String getConstantValue(Expression expr) {
+ if (expr instanceof Scalar) {
+ return ((Scalar) expr).getStringValue();
+ }
+ if (expr instanceof UnaryOperation) {
+ UnaryOperation up = (UnaryOperation) expr;
+ if (up.getOperator() == UnaryOperation.Operator.MINUS
+ && up.getExpression() instanceof Scalar) {
+ return "-" + ((Scalar) up.getExpression()).getStringValue(); //NOI18N
+ }
+ }
+ if (expr instanceof ArrayCreation) {
+ return getConstantValue((ArrayCreation) expr);
+ }
+ return null;
+ }
+
+ @NbBundle.Messages("MoreElementsDesc={0} more")
+ private static String getConstantValue(ArrayCreation expr) {
+ String debug = expr.toString();
+ StringBuilder sb = new StringBuilder("["); //NOI18N
+ Integer displayedElements = 0;
+ List<ArrayElement> elements = expr.getElements();
+ for (ArrayElement element : elements) {
+ if (displayedElements > 0) {
+ sb.append(", "); //NOI18N
+ }
+ sb.append(getConstantValue(element));
+ displayedElements++;
+ if (sb.length() > ARRAY_CUT_LENGTH) {
+ break;
+ }
+ }
+ if (displayedElements < elements.size()) {
+ sb.append(", ... (").append(Bundle.MoreElementsDesc(elements.size() - displayedElements)).append(")"); //NOI18N
+ }
+ sb.append("]"); //NOI18N
+ return sb.toString();
+ }
+
+ private static String getConstantValue(ArrayElement element) {
+ if (element instanceof UnpackableArrayElement) {
+ String innerContent = getConstantValue(element.getValue());
+ return innerContent != null ? "..." + innerContent : UNKNOWN_VALUE; //NOI18N
+ }
+ StringBuilder sb = new StringBuilder();
+ Expression key = element.getKey();
+ if (key != null) {
+ String convertedKey = getConstantValue(key);
+ sb.append(convertedKey != null ? convertedKey : UNKNOWN_VALUE);
+ sb.append(" => "); //NOI18N
+ }
+ String convertedValue = getConstantValue(element.getValue());
+ sb.append(convertedValue != null ? convertedValue : UNKNOWN_VALUE);
+ return sb.toString();
+ }
+
}
diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/ConstantDeclarationInfo.java b/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/ConstantDeclarationInfo.java
index a8246d9..959eaf2 100644
--- a/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/ConstantDeclarationInfo.java
+++ b/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/ConstantDeclarationInfo.java
@@ -20,15 +20,10 @@ package org.netbeans.modules.php.editor.model.nodes;
import java.util.ArrayList;
import java.util.List;
-import org.netbeans.api.annotations.common.CheckForNull;
import org.netbeans.modules.php.editor.model.nodes.ASTNodeInfo.Kind;
-import org.netbeans.modules.php.editor.parser.astnodes.ArrayCreation;
-import org.netbeans.modules.php.editor.parser.astnodes.ArrayElement;
import org.netbeans.modules.php.editor.parser.astnodes.ConstantDeclaration;
import org.netbeans.modules.php.editor.parser.astnodes.Expression;
import org.netbeans.modules.php.editor.parser.astnodes.Identifier;
-import org.netbeans.modules.php.editor.parser.astnodes.Scalar;
-import org.netbeans.modules.php.editor.parser.astnodes.UnaryOperation;
/**
* @author Radek Matous
@@ -49,20 +44,6 @@ public class ConstantDeclarationInfo extends ClassConstantDeclarationInfo {
if (value != null) {
break;
}
- /*
- if (expression instanceof Scalar) {
- value = ((Scalar) expression).getStringValue();
- break;
- }
- if (expression instanceof UnaryOperation) {
- UnaryOperation up = (UnaryOperation) expression;
- if (up.getOperator() == UnaryOperation.Operator.MINUS
- && up.getExpression() instanceof Scalar) {
- value = "-" + ((Scalar) up.getExpression()).getStringValue();
- break;
- }
- }
- */
}
retval.add(new ConstantDeclarationInfo(identifier, value, constantDeclaration));
}
@@ -74,52 +55,4 @@ public class ConstantDeclarationInfo extends ClassConstantDeclarationInfo {
return Kind.CONSTANT;
}
- @CheckForNull
- private static String getConstantValue(Expression expr) {
- if (expr instanceof Scalar) {
- return ((Scalar) expr).getStringValue();
- }
- if (expr instanceof UnaryOperation) {
- UnaryOperation up = (UnaryOperation) expr;
- if (up.getOperator() == UnaryOperation.Operator.MINUS
- && up.getExpression() instanceof Scalar) {
- return "-" + ((Scalar) up.getExpression()).getStringValue();
- }
- }
- if (expr instanceof ArrayCreation) {
- return getConstantValue((ArrayCreation) expr);
- }
- return null;
- }
-
- private static String getConstantValue(ArrayCreation expr) {
- StringBuilder sb = new StringBuilder("["); //NOI18N
- boolean itemAdded = false;
- List<ArrayElement> elements = expr.getElements();
- if (elements.size() > 0) {
- ArrayElement firstElement = elements.get(0);
- Expression key = firstElement.getKey();
- if (key != null) {
- String convertedKey = getConstantValue(key);
- if (convertedKey != null) {
- sb.append(convertedKey);
- sb.append(" => "); //NOI18N
- }
- }
- String convertedValue = getConstantValue(firstElement.getValue());
- if (convertedValue != null) {
- sb.append(convertedValue);
- itemAdded = true;
- } else {
- // Case when element exist but value was not converted to output.
- sb.append("..."); //NOI18N
- }
- }
- if (itemAdded && elements.size() > 1) {
- sb.append(",..."); //NOI18N
- }
- sb.append("]"); //NOI18N
- return sb.toString();
- }
-
}
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php56/classConst.php b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/classConst.php
new file mode 100644
index 0000000..e44c2df
--- /dev/null
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/classConst.php
@@ -0,0 +1,41 @@
+<?php
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+class Constants {
+
+ const INDEX = 123;
+ const ALICE = 'Alice';
+ const PLANET = "Earth";
+ const NO_KEYS = [ 44, 55, 66, 77 ];
+ const WITH_KEYS = [ 1 => 'A', 2 => 'B' ];
+ const LONG_ARRAY = [ 1 => 'Alice', 2 => 'Bob', 3 => 'Charlie', 4 => 'Dave', 5 => 'Eve', 6 => 'Frank' ];
+ const CONST_REF = [ 1 => self::ALICE, self::INDEX => 'Bob' ];
+
+ public function printConsts() {
+ echo self::INDEX;
+ echo self::ALICE;
+ echo self::PLANET;
+ echo self::NO_KEYS;
+ echo self::WITH_KEYS;
+ echo self::LONG_ARRAY;
+ echo self::CONST_REF;
+ }
+
+}
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php56/classConst.php.testClassConst_01.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/classConst.php.testClassConst_01.completion
new file mode 100644
index 0000000..2262166
--- /dev/null
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/classConst.php.testClassConst_01.completion
@@ -0,0 +1,4 @@
+Code completion result for source line:
+echo self::INDEX|;
+(QueryType=COMPLETION, prefixSearch=true, caseSensitive=true)
+CONSTANT INDEX 123 [PUBLIC] Constants
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php56/classConst.php.testClassConst_02.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/classConst.php.testClassConst_02.completion
new file mode 100644
index 0000000..a750c3e
--- /dev/null
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/classConst.php.testClassConst_02.completion
@@ -0,0 +1,4 @@
+Code completion result for source line:
+echo self::ALICE|;
+(QueryType=COMPLETION, prefixSearch=true, caseSensitive=true)
+CONSTANT ALICE 'Alice' [PUBLIC] Constants
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php56/classConst.php.testClassConst_03.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/classConst.php.testClassConst_03.completion
new file mode 100644
index 0000000..0bb56a2
--- /dev/null
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/classConst.php.testClassConst_03.completion
@@ -0,0 +1,4 @@
+Code completion result for source line:
+echo self::PLANET|;
+(QueryType=COMPLETION, prefixSearch=true, caseSensitive=true)
+CONSTANT PLANET "Earth" [PUBLIC] Constants
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php56/classConst.php.testClassConst_04.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/classConst.php.testClassConst_04.completion
new file mode 100644
index 0000000..6c57a00
--- /dev/null
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/classConst.php.testClassConst_04.completion
@@ -0,0 +1,4 @@
+Code completion result for source line:
+echo self::NO_KEYS|;
+(QueryType=COMPLETION, prefixSearch=true, caseSensitive=true)
+CONSTANT NO_KEYS [44, 55, 66, 77] [PUBLIC] Constants
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php56/classConst.php.testClassConst_05.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/classConst.php.testClassConst_05.completion
new file mode 100644
index 0000000..27f15af
--- /dev/null
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/classConst.php.testClassConst_05.completion
@@ -0,0 +1,4 @@
+Code completion result for source line:
+echo self::WITH_KEYS|;
+(QueryType=COMPLETION, prefixSearch=true, caseSensitive=true)
+CONSTANT WITH_KEYS [1 => 'A', 2 => 'B'] [PUBLIC] Constants
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php56/classConst.php.testClassConst_06.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/classConst.php.testClassConst_06.completion
new file mode 100644
index 0000000..e80877e
--- /dev/null
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/classConst.php.testClassConst_06.completion
@@ -0,0 +1,4 @@
+Code completion result for source line:
+echo self::LONG_ARRAY|;
+(QueryType=COMPLETION, prefixSearch=true, caseSensitive=true)
+CONSTANT LONG_ARRAY [1 => 'Alice', 2 => [PUBLIC] Constants
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php56/classConst.php.testClassConst_07.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/classConst.php.testClassConst_07.completion
new file mode 100644
index 0000000..727cba8
--- /dev/null
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/classConst.php.testClassConst_07.completion
@@ -0,0 +1,4 @@
+Code completion result for source line:
+echo self::CONST_REF|;
+(QueryType=COMPLETION, prefixSearch=true, caseSensitive=true)
+CONSTANT CONST_REF [1 => ?, ? => 'Bob'] [PUBLIC] Constants
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php56/globalConst.php b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/globalConst.php
new file mode 100644
index 0000000..c00f081
--- /dev/null
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/globalConst.php
@@ -0,0 +1,35 @@
+<?php
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+const INDEX = 123;
+const ALICE = 'Alice';
+const PLANET = "Earth";
+const NO_KEYS = [44, 55, 66, 77];
+const WITH_KEYS = [1 => 'A', 2 => 'B'];
+const LONG_ARRAY = [1 => 'Alice', 2 => 'Bob', 3 => 'Charlie', 4 => 'Dave', 5 => 'Eve', 6 => 'Frank'];
+const CONST_REF = [1 => ALICE, INDEX => 'Bob'];
+
+echo INDEX;
+echo ALICE;
+echo PLANET;
+echo NO_KEYS;
+echo WITH_KEYS;
+echo LONG_ARRAY;
+echo CONST_REF;
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php56/globalConst.php.testGlobalConst_01.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/globalConst.php.testGlobalConst_01.completion
new file mode 100644
index 0000000..f697e09
--- /dev/null
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/globalConst.php.testGlobalConst_01.completion
@@ -0,0 +1,4 @@
+Code completion result for source line:
+echo INDEX|;
+(QueryType=COMPLETION, prefixSearch=true, caseSensitive=true)
+CONSTANT INDEX 123 [PUBLIC] globalConst.php
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php56/globalConst.php.testGlobalConst_02.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/globalConst.php.testGlobalConst_02.completion
new file mode 100644
index 0000000..a8e75dc
--- /dev/null
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/globalConst.php.testGlobalConst_02.completion
@@ -0,0 +1,4 @@
+Code completion result for source line:
+echo ALICE|;
+(QueryType=COMPLETION, prefixSearch=true, caseSensitive=true)
+CONSTANT ALICE 'Alice' [PUBLIC] globalConst.php
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php56/globalConst.php.testGlobalConst_03.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/globalConst.php.testGlobalConst_03.completion
new file mode 100644
index 0000000..53e4d33
--- /dev/null
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/globalConst.php.testGlobalConst_03.completion
@@ -0,0 +1,4 @@
+Code completion result for source line:
+echo PLANET|;
+(QueryType=COMPLETION, prefixSearch=true, caseSensitive=true)
+CONSTANT PLANET "Earth" [PUBLIC] globalConst.php
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php56/globalConst.php.testGlobalConst_04.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/globalConst.php.testGlobalConst_04.completion
new file mode 100644
index 0000000..6f75629
--- /dev/null
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/globalConst.php.testGlobalConst_04.completion
@@ -0,0 +1,4 @@
+Code completion result for source line:
+echo NO_KEYS|;
+(QueryType=COMPLETION, prefixSearch=true, caseSensitive=true)
+CONSTANT NO_KEYS [44, 55, 66, 77] [PUBLIC] globalConst.php
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php56/globalConst.php.testGlobalConst_05.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/globalConst.php.testGlobalConst_05.completion
new file mode 100644
index 0000000..049d792
--- /dev/null
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/globalConst.php.testGlobalConst_05.completion
@@ -0,0 +1,4 @@
+Code completion result for source line:
+echo WITH_KEYS|;
+(QueryType=COMPLETION, prefixSearch=true, caseSensitive=true)
+CONSTANT WITH_KEYS [1 => 'A', 2 => 'B'] [PUBLIC] globalConst.php
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php56/globalConst.php.testGlobalConst_06.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/globalConst.php.testGlobalConst_06.completion
new file mode 100644
index 0000000..a6ca8d5
--- /dev/null
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/globalConst.php.testGlobalConst_06.completion
@@ -0,0 +1,4 @@
+Code completion result for source line:
+echo LONG_ARRAY|;
+(QueryType=COMPLETION, prefixSearch=true, caseSensitive=true)
+CONSTANT LONG_ARRAY [1 => 'Alice', 2 => [PUBLIC] globalConst.php
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php56/globalConst.php.testGlobalConst_07.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/globalConst.php.testGlobalConst_07.completion
new file mode 100644
index 0000000..cdb674d
--- /dev/null
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php56/globalConst.php.testGlobalConst_07.completion
@@ -0,0 +1,4 @@
+Code completion result for source line:
+echo CONST_REF|;
+(QueryType=COMPLETION, prefixSearch=true, caseSensitive=true)
+CONSTANT CONST_REF [1 => ?, ? => 'Bob'] [PUBLIC] globalConst.php
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php70/contextSensitiveLexer/contextSensitiveLexerInterface.php.testContextSensitiveLexerInterface02.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php70/contextSensitiveLexer/contextSensitiveLexerInterface.php.testContextSensitiveLexerInterface02.completion
index a52a112..69cef7c 100644
--- a/php/php.editor/test/unit/data/testfiles/completion/lib/php70/contextSensitiveLexer/contextSensitiveLexerInterface.php.testContextSensitiveLexerInterface02.completion
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php70/contextSensitiveLexer/contextSensitiveLexerInterface.php.testContextSensitiveLexerInterface02.completion
@@ -9,43 +9,43 @@ CONSTANT __line__ 100 [PUBLIC] InterfaceExample
CONSTANT __method__ 100 [PUBLIC] InterfaceExample
CONSTANT __namespace__ 100 [PUBLIC] InterfaceExample
CONSTANT __trait__ 100 [PUBLIC] InterfaceExample
-CONSTANT abstract ? [PUBLIC] InterfaceExample
-CONSTANT and ? [PUBLIC] InterfaceExample
+CONSTANT abstract [1, 2] [PUBLIC] InterfaceExample
+CONSTANT and [1, 2] [PUBLIC] InterfaceExample
CONSTANT array 100 [PUBLIC] InterfaceExample
CONSTANT as 100 [PUBLIC] InterfaceExample
CONSTANT break 100 [PUBLIC] InterfaceExample
-CONSTANT callable ? [PUBLIC] InterfaceExample
+CONSTANT callable [1, 2] [PUBLIC] InterfaceExample
CONSTANT case 100 [PUBLIC] InterfaceExample
CONSTANT catch 100 [PUBLIC] InterfaceExample
CONSTANT class \InterfaceExample [PUBLIC] Magic Constant
CONSTANT clone 100 [PUBLIC] InterfaceExample
-CONSTANT const ? [PUBLIC] InterfaceExample
+CONSTANT const [1, 2] [PUBLIC] InterfaceExample
CONSTANT continue 100 [PUBLIC] InterfaceExample
CONSTANT declare 100 [PUBLIC] InterfaceExample
CONSTANT default 100 [PUBLIC] InterfaceExample
-CONSTANT define ? [PUBLIC] InterfaceExample
+CONSTANT define [1, 2] [PUBLIC] InterfaceExample
CONSTANT die 100 [PUBLIC] InterfaceExample
CONSTANT do 100 [PUBLIC] InterfaceExample
CONSTANT echo 100 [PUBLIC] InterfaceExample
CONSTANT else 100 [PUBLIC] InterfaceExample
CONSTANT elseif 100 [PUBLIC] InterfaceExample
-CONSTANT enddeclare ? [PUBLIC] InterfaceExample
-CONSTANT endfor ? [PUBLIC] InterfaceExample
-CONSTANT endforeach ? [PUBLIC] InterfaceExample
-CONSTANT endif ? [PUBLIC] InterfaceExample
+CONSTANT enddeclare [1, 2] [PUBLIC] InterfaceExample
+CONSTANT endfor [1, 2] [PUBLIC] InterfaceExample
+CONSTANT endforeach [1, 2] [PUBLIC] InterfaceExample
+CONSTANT endif [1, 2] [PUBLIC] InterfaceExample
CONSTANT endswitch 100 [PUBLIC] InterfaceExample
-CONSTANT endwhile ? [PUBLIC] InterfaceExample
+CONSTANT endwhile [1, 2] [PUBLIC] InterfaceExample
CONSTANT exit 100 [PUBLIC] InterfaceExample
-CONSTANT extends ? [PUBLIC] InterfaceExample
-CONSTANT final ? [PUBLIC] InterfaceExample
+CONSTANT extends [1, 2] [PUBLIC] InterfaceExample
+CONSTANT final [1, 2] [PUBLIC] InterfaceExample
CONSTANT finally 100 [PUBLIC] InterfaceExample
CONSTANT for 100 [PUBLIC] InterfaceExample
CONSTANT foreach 100 [PUBLIC] InterfaceExample
CONSTANT function 100 [PUBLIC] InterfaceExample
-CONSTANT global ? [PUBLIC] InterfaceExample
-CONSTANT goto ? [PUBLIC] InterfaceExample
+CONSTANT global [1, 2] [PUBLIC] InterfaceExample
+CONSTANT goto [1, 2] [PUBLIC] InterfaceExample
CONSTANT if 100 [PUBLIC] InterfaceExample
-CONSTANT implements ? [PUBLIC] InterfaceExample
+CONSTANT implements [1, 2] [PUBLIC] InterfaceExample
CONSTANT include 100 [PUBLIC] InterfaceExample
CONSTANT include_once 100 [PUBLIC] InterfaceExample
CONSTANT instanceof 100 [PUBLIC] InterfaceExample
@@ -57,17 +57,17 @@ CONSTANT new 100 [PUBLIC] InterfaceExample
CONSTANT or 100 [PUBLIC] InterfaceExample
CONSTANT parent 100 [PUBLIC] InterfaceExample
CONSTANT print 100 [PUBLIC] InterfaceExample
-CONSTANT private ? [PUBLIC] InterfaceExample
-CONSTANT protected ? [PUBLIC] InterfaceExample
-CONSTANT public ? [PUBLIC] InterfaceExample
+CONSTANT private [1, 2] [PUBLIC] InterfaceExample
+CONSTANT protected [1, 2] [PUBLIC] InterfaceExample
+CONSTANT public [1, 2] [PUBLIC] InterfaceExample
CONSTANT require 100 [PUBLIC] InterfaceExample
CONSTANT require_once 100 [PUBLIC] InterfaceExample
CONSTANT return 100 [PUBLIC] InterfaceExample
CONSTANT self 100 [PUBLIC] InterfaceExample
-CONSTANT static ? [PUBLIC] InterfaceExample
+CONSTANT static [1, 2] [PUBLIC] InterfaceExample
CONSTANT switch 100 [PUBLIC] InterfaceExample
CONSTANT throw 100 [PUBLIC] InterfaceExample
-CONSTANT trait ? [PUBLIC] InterfaceExample
+CONSTANT trait [1, 2] [PUBLIC] InterfaceExample
CONSTANT try 100 [PUBLIC] InterfaceExample
CONSTANT use 100 [PUBLIC] InterfaceExample
CONSTANT var 100 [PUBLIC] InterfaceExample
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_02.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_02.completion
index c295a81..a35757c 100644
--- a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_02.completion
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_02.completion
@@ -12,13 +12,13 @@ VARIABLE array $array2 [PUBLIC] spreadOperatorInArrayExpre
VARIABLE array $array2_a [PUBLIC] spreadOperatorInArrayExpression.php
VARIABLE array $array3 [PUBLIC] spreadOperatorInArrayExpression.php
CONSTANT BAR_CONSTANT [] [PUBLIC] Bar
-CONSTANT CONSTANT [0,...] [PUBLIC] Foo
-CONSTANT CONSTANT1 [...] [PUBLIC] Foo
-CONSTANT CONSTANT1a [[0,...]] [PUBLIC] Foo
-CONSTANT CONSTANT2 [100,...] [PUBLIC] Foo
-CONSTANT CONSTANT3 [...] [PUBLIC] Foo
-CONSTANT CONSTANT4 [...] [PUBLIC] Foo
-CONSTANT CONSTANT5 [...] [PUBLIC] Foo
+CONSTANT CONSTANT [0, 1, 2, 3] [PUBLIC] Foo
+CONSTANT CONSTANT1 [?] [PUBLIC] Foo
+CONSTANT CONSTANT1a [...[0, 1, 2, 3]] [PUBLIC] Foo
+CONSTANT CONSTANT2 [100, ?, ?] [PUBLIC] Foo
+CONSTANT CONSTANT3 [?, 100 => 0, ?] [PUBLIC] Foo
+CONSTANT CONSTANT4 [?, 100 => 0, ?] [PUBLIC] Foo
+CONSTANT CONSTANT5 [?, 100 => 0, ?] [PUBLIC] Foo
------------------------------------
VARIABLE $GLOBALS PHP Platform
VARIABLE $HTTP_RAW_POST_DATA PHP Platform
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_02a.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_02a.completion
index 914defe..2262bdd 100644
--- a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_02a.completion
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_02a.completion
@@ -13,13 +13,13 @@ VARIABLE array $array2_a [PUBLIC] spreadOperatorInArrayExpre
VARIABLE array $array3 [PUBLIC] spreadOperatorInArrayExpression.php
VARIABLE array $array3_a [PUBLIC] spreadOperatorInArrayExpression.php
CONSTANT BAR_CONSTANT [] [PUBLIC] Bar
-CONSTANT CONSTANT [0,...] [PUBLIC] Foo
-CONSTANT CONSTANT1 [...] [PUBLIC] Foo
-CONSTANT CONSTANT1a [[0,...]] [PUBLIC] Foo
-CONSTANT CONSTANT2 [100,...] [PUBLIC] Foo
-CONSTANT CONSTANT3 [...] [PUBLIC] Foo
-CONSTANT CONSTANT4 [...] [PUBLIC] Foo
-CONSTANT CONSTANT5 [...] [PUBLIC] Foo
+CONSTANT CONSTANT [0, 1, 2, 3] [PUBLIC] Foo
+CONSTANT CONSTANT1 [?] [PUBLIC] Foo
+CONSTANT CONSTANT1a [...[0, 1, 2, 3]] [PUBLIC] Foo
+CONSTANT CONSTANT2 [100, ?, ?] [PUBLIC] Foo
+CONSTANT CONSTANT3 [?, 100 => 0, ?] [PUBLIC] Foo
+CONSTANT CONSTANT4 [?, 100 => 0, ?] [PUBLIC] Foo
+CONSTANT CONSTANT5 [?, 100 => 0, ?] [PUBLIC] Foo
------------------------------------
VARIABLE $GLOBALS PHP Platform
VARIABLE $HTTP_RAW_POST_DATA PHP Platform
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_03.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_03.completion
index c63a5e9..4b54f19 100644
--- a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_03.completion
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_03.completion
@@ -14,13 +14,13 @@ VARIABLE array $array3 [PUBLIC] spreadOperatorInArrayExpre
VARIABLE array $array3_a [PUBLIC] spreadOperatorInArrayExpression.php
VARIABLE array $array4 [PUBLIC] spreadOperatorInArrayExpression.php
CONSTANT BAR_CONSTANT [] [PUBLIC] Bar
-CONSTANT CONSTANT [0,...] [PUBLIC] Foo
-CONSTANT CONSTANT1 [...] [PUBLIC] Foo
-CONSTANT CONSTANT1a [[0,...]] [PUBLIC] Foo
-CONSTANT CONSTANT2 [100,...] [PUBLIC] Foo
-CONSTANT CONSTANT3 [...] [PUBLIC] Foo
-CONSTANT CONSTANT4 [...] [PUBLIC] Foo
-CONSTANT CONSTANT5 [...] [PUBLIC] Foo
+CONSTANT CONSTANT [0, 1, 2, 3] [PUBLIC] Foo
+CONSTANT CONSTANT1 [?] [PUBLIC] Foo
+CONSTANT CONSTANT1a [...[0, 1, 2, 3]] [PUBLIC] Foo
+CONSTANT CONSTANT2 [100, ?, ?] [PUBLIC] Foo
+CONSTANT CONSTANT3 [?, 100 => 0, ?] [PUBLIC] Foo
+CONSTANT CONSTANT4 [?, 100 => 0, ?] [PUBLIC] Foo
+CONSTANT CONSTANT5 [?, 100 => 0, ?] [PUBLIC] Foo
------------------------------------
VARIABLE $GLOBALS PHP Platform
VARIABLE $HTTP_RAW_POST_DATA PHP Platform
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_04.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_04.completion
index 3907fdc..43e9cd1 100644
--- a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_04.completion
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_04.completion
@@ -14,13 +14,13 @@ VARIABLE array $array3 [PUBLIC] spreadOperatorInArrayExpre
VARIABLE array $array3_a [PUBLIC] spreadOperatorInArrayExpression.php
VARIABLE array $array4 [PUBLIC] spreadOperatorInArrayExpression.php
CONSTANT BAR_CONSTANT [] [PUBLIC] Bar
-CONSTANT CONSTANT [0,...] [PUBLIC] Foo
-CONSTANT CONSTANT1 [...] [PUBLIC] Foo
-CONSTANT CONSTANT1a [[0,...]] [PUBLIC] Foo
-CONSTANT CONSTANT2 [100,...] [PUBLIC] Foo
-CONSTANT CONSTANT3 [...] [PUBLIC] Foo
-CONSTANT CONSTANT4 [...] [PUBLIC] Foo
-CONSTANT CONSTANT5 [...] [PUBLIC] Foo
+CONSTANT CONSTANT [0, 1, 2, 3] [PUBLIC] Foo
+CONSTANT CONSTANT1 [?] [PUBLIC] Foo
+CONSTANT CONSTANT1a [...[0, 1, 2, 3]] [PUBLIC] Foo
+CONSTANT CONSTANT2 [100, ?, ?] [PUBLIC] Foo
+CONSTANT CONSTANT3 [?, 100 => 0, ?] [PUBLIC] Foo
+CONSTANT CONSTANT4 [?, 100 => 0, ?] [PUBLIC] Foo
+CONSTANT CONSTANT5 [?, 100 => 0, ?] [PUBLIC] Foo
------------------------------------
VARIABLE $GLOBALS PHP Platform
VARIABLE $HTTP_RAW_POST_DATA PHP Platform
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_GlobalConst_01.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_GlobalConst_01.completion
index 7b09d8f..391f099 100644
--- a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_GlobalConst_01.completion
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_GlobalConst_01.completion
@@ -5,12 +5,12 @@ PACKAGE Bar [PUBLIC] null
PACKAGE Foo [PUBLIC] null
CLASS Qux [PUBLIC] Bar
CONSTANT BAR_CONSTANT [] [PUBLIC] Bar
-CONSTANT CONSTANT [0,...] [PUBLIC] Foo
-CONSTANT CONSTANT1 [...] [PUBLIC] Foo
-CONSTANT CONSTANT1a [[0,...]] [PUBLIC] Foo
-CONSTANT CONSTANT2 [100,...] [PUBLIC] Foo
-CONSTANT CONSTANT3 [...] [PUBLIC] Foo
-CONSTANT CONSTANT4 [...] [PUBLIC] Foo
-CONSTANT CONSTANT5 [...] [PUBLIC] Foo
+CONSTANT CONSTANT [0, 1, 2, 3] [PUBLIC] Foo
+CONSTANT CONSTANT1 [?] [PUBLIC] Foo
+CONSTANT CONSTANT1a [...[0, 1, 2, 3]] [PUBLIC] Foo
+CONSTANT CONSTANT2 [100, ?, ?] [PUBLIC] Foo
+CONSTANT CONSTANT3 [?, 100 => 0, ?] [PUBLIC] Foo
+CONSTANT CONSTANT4 [?, 100 => 0, ?] [PUBLIC] Foo
+CONSTANT CONSTANT5 [?, 100 => 0, ?] [PUBLIC] Foo
------------------------------------
KEYWORD array null
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_GlobalConst_02.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_GlobalConst_02.completion
index 36c0403..01f7596 100644
--- a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_GlobalConst_02.completion
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_GlobalConst_02.completion
@@ -5,12 +5,12 @@ PACKAGE Bar [PUBLIC] null
PACKAGE Foo [PUBLIC] null
CLASS Qux [PUBLIC] Bar
CONSTANT BAR_CONSTANT [] [PUBLIC] Bar
-CONSTANT CONSTANT [0,...] [PUBLIC] Foo
-CONSTANT CONSTANT1 [...] [PUBLIC] Foo
-CONSTANT CONSTANT1a [[0,...]] [PUBLIC] Foo
-CONSTANT CONSTANT2 [100,...] [PUBLIC] Foo
-CONSTANT CONSTANT3 [...] [PUBLIC] Foo
-CONSTANT CONSTANT4 [...] [PUBLIC] Foo
-CONSTANT CONSTANT5 [...] [PUBLIC] Foo
+CONSTANT CONSTANT [0, 1, 2, 3] [PUBLIC] Foo
+CONSTANT CONSTANT1 [?] [PUBLIC] Foo
+CONSTANT CONSTANT1a [...[0, 1, 2, 3]] [PUBLIC] Foo
+CONSTANT CONSTANT2 [100, ?, ?] [PUBLIC] Foo
+CONSTANT CONSTANT3 [?, 100 => 0, ?] [PUBLIC] Foo
+CONSTANT CONSTANT4 [?, 100 => 0, ?] [PUBLIC] Foo
+CONSTANT CONSTANT5 [?, 100 => 0, ?] [PUBLIC] Foo
------------------------------------
KEYWORD array null
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_GlobalConst_03.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_GlobalConst_03.completion
index f22e2db..e2fa16a 100644
--- a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_GlobalConst_03.completion
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_GlobalConst_03.completion
@@ -1,10 +1,10 @@
Code completion result for source line:
const CONSTANT3 = [...CONSTANT2, 100 => 0, ...CONSTANT|];
(QueryType=COMPLETION, prefixSearch=true, caseSensitive=true)
-CONSTANT CONSTANT [0,...] [PUBLIC] Foo
-CONSTANT CONSTANT1 [...] [PUBLIC] Foo
-CONSTANT CONSTANT1a [[0,...]] [PUBLIC] Foo
-CONSTANT CONSTANT2 [100,...] [PUBLIC] Foo
-CONSTANT CONSTANT3 [...] [PUBLIC] Foo
-CONSTANT CONSTANT4 [...] [PUBLIC] Foo
-CONSTANT CONSTANT5 [...] [PUBLIC] Foo
+CONSTANT CONSTANT [0, 1, 2, 3] [PUBLIC] Foo
+CONSTANT CONSTANT1 [?] [PUBLIC] Foo
+CONSTANT CONSTANT1a [...[0, 1, 2, 3]] [PUBLIC] Foo
+CONSTANT CONSTANT2 [100, ?, ?] [PUBLIC] Foo
+CONSTANT CONSTANT3 [?, 100 => 0, ?] [PUBLIC] Foo
+CONSTANT CONSTANT4 [?, 100 => 0, ?] [PUBLIC] Foo
+CONSTANT CONSTANT5 [?, 100 => 0, ?] [PUBLIC] Foo
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_GlobalConst_09.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_GlobalConst_09.completion
index cdaffd9..ae630a5 100644
--- a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_GlobalConst_09.completion
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInArrayExpression/spreadOperatorInArrayExpression.php.testSpreadOperatorInArrayExpression_GlobalConst_09.completion
@@ -5,12 +5,12 @@ PACKAGE Bar [PUBLIC] null
PACKAGE Foo [PUBLIC] null
CLASS Qux [PUBLIC] Bar
CONSTANT BAR_CONSTANT [] [PUBLIC] Bar
-CONSTANT CONSTANT [0,...] [PUBLIC] Foo
-CONSTANT CONSTANT1 [...] [PUBLIC] Foo
-CONSTANT CONSTANT1a [[0,...]] [PUBLIC] Foo
-CONSTANT CONSTANT2 [100,...] [PUBLIC] Foo
-CONSTANT CONSTANT3 [...] [PUBLIC] Foo
-CONSTANT CONSTANT4 [...] [PUBLIC] Foo
-CONSTANT CONSTANT5 [...] [PUBLIC] Foo
+CONSTANT CONSTANT [0, 1, 2, 3] [PUBLIC] Foo
+CONSTANT CONSTANT1 [?] [PUBLIC] Foo
+CONSTANT CONSTANT1a [...[0, 1, 2, 3]] [PUBLIC] Foo
+CONSTANT CONSTANT2 [100, ?, ?] [PUBLIC] Foo
+CONSTANT CONSTANT3 [?, 100 => 0, ?] [PUBLIC] Foo
+CONSTANT CONSTANT4 [?, 100 => 0, ?] [PUBLIC] Foo
+CONSTANT CONSTANT5 [?, 100 => 0, ?] [PUBLIC] Foo
------------------------------------
KEYWORD array null
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_00.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_00.completion
index 53d7777..4c36561 100644
--- a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_00.completion
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_00.completion
@@ -6,12 +6,12 @@ PACKAGE Foo [PUBLIC] null
CLASS BarUnpackClass [PUBLIC] Bar
CLASS UnpackChildClass [PUBLIC] Foo
CLASS UnpackClass [PUBLIC] Foo
-CONSTANT CONSTANT ? [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT ["1", "2", "3"] [PUBLIC] \Foo\UnpackClass
CONSTANT CONSTANT1 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT2 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT3 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT4 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT5 ? [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT2 [?] [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT3 [?, "4"] [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT4 ["0", ?, "4"] [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT5 ["0", ?, "4", ?] [PUBLIC] \Foo\UnpackClass
CONSTANT F_CONST "test" [PUBLIC] Foo
KEYWORD parent:: null
KEYWORD self:: null
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_01.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_01.completion
index feae9c8..a5b80d6 100644
--- a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_01.completion
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_01.completion
@@ -6,12 +6,12 @@ PACKAGE Foo [PUBLIC] null
CLASS BarUnpackClass [PUBLIC] Bar
CLASS UnpackChildClass [PUBLIC] Foo
CLASS UnpackClass [PUBLIC] Foo
-CONSTANT CONSTANT ? [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT ["1", "2", "3"] [PUBLIC] \Foo\UnpackClass
CONSTANT CONSTANT1 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT2 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT3 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT4 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT5 ? [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT2 [?] [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT3 [?, "4"] [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT4 ["0", ?, "4"] [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT5 ["0", ?, "4", ?] [PUBLIC] \Foo\UnpackClass
CONSTANT F_CONST "test" [PUBLIC] Foo
KEYWORD parent:: null
KEYWORD self:: null
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_02.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_02.completion
index edc0809..23b2a52 100644
--- a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_02.completion
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_02.completion
@@ -1,10 +1,10 @@
Code completion result for source line:
public const CONSTANT2 = [...self::|CONSTANT];
(QueryType=COMPLETION, prefixSearch=true, caseSensitive=true)
-CONSTANT CONSTANT ? [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT ["1", "2", "3"] [PUBLIC] \Foo\UnpackClass
CONSTANT CONSTANT1 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT2 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT3 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT4 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT5 ? [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT2 [?] [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT3 [?, "4"] [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT4 ["0", ?, "4"] [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT5 ["0", ?, "4", ?] [PUBLIC] \Foo\UnpackClass
CONSTANT class \Foo\UnpackClass [PUBLIC] Magic Constant
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_04.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_04.completion
index d452e36..fac2fc0 100644
--- a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_04.completion
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_04.completion
@@ -6,12 +6,12 @@ PACKAGE Foo [PUBLIC] null
CLASS BarUnpackClass [PUBLIC] Bar
CLASS UnpackChildClass [PUBLIC] Foo
CLASS UnpackClass [PUBLIC] Foo
-CONSTANT CONSTANT ? [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT ["1", "2", "3"] [PUBLIC] \Foo\UnpackClass
CONSTANT CONSTANT1 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT2 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT3 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT4 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT5 ? [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT2 [?] [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT3 [?, "4"] [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT4 ["0", ?, "4"] [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT5 ["0", ?, "4", ?] [PUBLIC] \Foo\UnpackClass
CONSTANT F_CONST "test" [PUBLIC] Foo
KEYWORD parent:: null
KEYWORD self:: null
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_06.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_06.completion
index 430aece..91c06b0 100644
--- a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_06.completion
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_06.completion
@@ -1,9 +1,9 @@
Code completion result for source line:
public const CONSTANT5 = ["0", ...self::CONSTANT, "4", self::CONSTA|NT1];
(QueryType=COMPLETION, prefixSearch=true, caseSensitive=true)
-CONSTANT CONSTANT ? [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT ["1", "2", "3"] [PUBLIC] \Foo\UnpackClass
CONSTANT CONSTANT1 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT2 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT3 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT4 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT5 ? [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT2 [?] [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT3 [?, "4"] [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT4 ["0", ?, "4"] [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT5 ["0", ?, "4", ?] [PUBLIC] \Foo\UnpackClass
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_07.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_07.completion
index cb5ea8c..aebefa9 100644
--- a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_07.completion
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_07.completion
@@ -6,13 +6,13 @@ PACKAGE Foo [PUBLIC] null
CLASS BarUnpackClass [PUBLIC] Bar
CLASS UnpackChildClass [PUBLIC] Foo
CLASS UnpackClass [PUBLIC] Foo
-CONSTANT CHILD_CONSTANT ? [PUBLIC] \Foo\UnpackChildClass
-CONSTANT CONSTANT ? [PUBLIC] \Foo\UnpackClass
+CONSTANT CHILD_CONSTANT ["0", ?] [PUBLIC] \Foo\UnpackChildClass
+CONSTANT CONSTANT ["1", "2", "3"] [PUBLIC] \Foo\UnpackClass
CONSTANT CONSTANT1 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT2 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT3 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT4 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT5 ? [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT2 [?] [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT3 [?, "4"] [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT4 ["0", ?, "4"] [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT5 ["0", ?, "4", ?] [PUBLIC] \Foo\UnpackClass
CONSTANT F_CONST "test" [PUBLIC] Foo
KEYWORD parent:: null
KEYWORD self:: null
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_08.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_08.completion
index f1fc184..73a922b 100644
--- a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_08.completion
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_08.completion
@@ -1,10 +1,10 @@
Code completion result for source line:
public const CHILD_CONSTANT = ["0", ...parent::C|ONSTANT, ];
(QueryType=COMPLETION, prefixSearch=true, caseSensitive=true)
-CONSTANT CONSTANT ? [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT ["1", "2", "3"] [PUBLIC] \Foo\UnpackClass
CONSTANT CONSTANT1 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT2 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT3 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT4 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT5 ? [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT2 [?] [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT3 [?, "4"] [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT4 ["0", ?, "4"] [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT5 ["0", ?, "4", ?] [PUBLIC] \Foo\UnpackClass
CONSTANT class \Foo\UnpackClass [PUBLIC] Magic Constant
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_10.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_10.completion
index 00b8f41..271026c 100644
--- a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_10.completion
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_10.completion
@@ -1,10 +1,10 @@
Code completion result for source line:
private const CONST1 = [...UnpackClass::|CONSTANT];
(QueryType=COMPLETION, prefixSearch=true, caseSensitive=true)
-CONSTANT CONSTANT ? [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT ["1", "2", "3"] [PUBLIC] \Foo\UnpackClass
CONSTANT CONSTANT1 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT2 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT3 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT4 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT5 ? [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT2 [?] [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT3 [?, "4"] [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT4 ["0", ?, "4"] [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT5 ["0", ?, "4", ?] [PUBLIC] \Foo\UnpackClass
CONSTANT class \Foo\UnpackClass [PUBLIC] Magic Constant
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_11.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_11.completion
index a8f2e9c..7114d06 100644
--- a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_11.completion
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_11.completion
@@ -6,10 +6,10 @@ PACKAGE Foo [PUBLIC] null
CLASS BarUnpackClass [PUBLIC] Bar
CLASS UnpackChildClass [PUBLIC] Foo
CLASS UnpackClass [PUBLIC] Foo
-CONSTANT CONST1 ? [PRIVATE] \Bar\BarUnpackClass
-CONSTANT CONST2 ? [PRIVATE] \Bar\BarUnpackClass
-CONSTANT CONST3 ? [PRIVATE] \Bar\BarUnpackClass
-CONSTANT CONST4 ? [PRIVATE] \Bar\BarUnpackClass
+CONSTANT CONST1 [?] [PRIVATE] \Bar\BarUnpackClass
+CONSTANT CONST2 [1, ?] [PRIVATE] \Bar\BarUnpackClass
+CONSTANT CONST3 [1, ?, 4] [PRIVATE] \Bar\BarUnpackClass
+CONSTANT CONST4 [?] [PRIVATE] \Bar\BarUnpackClass
CONSTANT F_CONST "test" [PUBLIC] Foo
KEYWORD parent:: null
KEYWORD self:: null
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_12.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_12.completion
index 7451276..1fefefd 100644
--- a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_12.completion
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_12.completion
@@ -1,10 +1,10 @@
Code completion result for source line:
private const CONST2 = [1, ...UnpackClass::C|ONSTANT];
(QueryType=COMPLETION, prefixSearch=true, caseSensitive=true)
-CONSTANT CONSTANT ? [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT ["1", "2", "3"] [PUBLIC] \Foo\UnpackClass
CONSTANT CONSTANT1 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT2 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT3 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT4 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT5 ? [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT2 [?] [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT3 [?, "4"] [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT4 ["0", ?, "4"] [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT5 ["0", ?, "4", ?] [PUBLIC] \Foo\UnpackClass
CONSTANT class \Foo\UnpackClass [PUBLIC] Magic Constant
diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_15.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_15.completion
index cdf202d..b190e26 100644
--- a/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_15.completion
+++ b/php/php.editor/test/unit/data/testfiles/completion/lib/php74/testSpreadOperatorInClassConst/spreadOperatorInClassConst.php.testSpreadOperatorInClassConst_15.completion
@@ -1,10 +1,10 @@
Code completion result for source line:
private const CONST3 = [1, ...\Foo\UnpackClass::|CONSTANT, 4];
(QueryType=COMPLETION, prefixSearch=true, caseSensitive=true)
-CONSTANT CONSTANT ? [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT ["1", "2", "3"] [PUBLIC] \Foo\UnpackClass
CONSTANT CONSTANT1 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT2 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT3 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT4 ? [PUBLIC] \Foo\UnpackClass
-CONSTANT CONSTANT5 ? [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT2 [?] [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT3 [?, "4"] [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT4 ["0", ?, "4"] [PUBLIC] \Foo\UnpackClass
+CONSTANT CONSTANT5 ["0", ?, "4", ?] [PUBLIC] \Foo\UnpackClass
CONSTANT class \Foo\UnpackClass [PUBLIC] Magic Constant
diff --git a/php/php.editor/test/unit/data/testfiles/index/testClassConstantVisibility/testClassConstantVisibility.php.indexed b/php/php.editor/test/unit/data/testfiles/index/testClassConstantVisibility/testClassConstantVisibility.php.indexed
index 944ba15..dcb9fad 100644
--- a/php/php.editor/test/unit/data/testfiles/index/testClassConstantVisibility/testClassConstantVisibility.php.indexed
+++ b/php/php.editor/test/unit/data/testfiles/index/testClassConstantVisibility/testClassConstantVisibility.php.indexed
@@ -10,7 +10,7 @@ Document 1
Searchable Keys:
clz : classconstantvisibility;ClassConstantVisibility;13;;;;1;;0;<TESTURL>/testClassConstantVisibility.php;;
clz.const : implicit_public_const;IMPLICIT_PUBLIC_CONST;50;0;0;<TESTURL>/testClassConstantVisibility.php;32;
- clz.const : private_bar;PRIVATE_BAR;225;?;0;<TESTURL>/testClassConstantVisibility.php;2;
+ clz.const : private_bar;PRIVATE_BAR;225;[1, 2];0;<TESTURL>/testClassConstantVisibility.php;2;
clz.const : private_const;PRIVATE_CONST;130;2;0;<TESTURL>/testClassConstantVisibility.php;2;
clz.const : private_foo;PRIVATE_FOO;208;1;0;<TESTURL>/testClassConstantVisibility.php;2;
clz.const : protected_const;PROTECTED_CONST;169;3;0;<TESTURL>/testClassConstantVisibility.php;4;
diff --git a/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/completion/PHP56CodeCompletionTest.java b/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/completion/PHP56CodeCompletionTest.java
index b2e597a..4dbe719 100644
--- a/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/completion/PHP56CodeCompletionTest.java
+++ b/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/completion/PHP56CodeCompletionTest.java
@@ -70,6 +70,62 @@ public class PHP56CodeCompletionTest extends PHPCodeCompletionTestBase {
checkCompletion("testfiles/completion/lib/php56/useFuncAndConst.php", "use function Name\\Space\\f^nc as fnc2;", false);
}
+ public void testClassConst_01() throws Exception {
+ checkCompletion("testfiles/completion/lib/php56/classConst.php", " echo self::INDEX^;", false);
+ }
+
+ public void testClassConst_02() throws Exception {
+ checkCompletion("testfiles/completion/lib/php56/classConst.php", " echo self::ALICE^;", false);
+ }
+
+ public void testClassConst_03() throws Exception {
+ checkCompletion("testfiles/completion/lib/php56/classConst.php", " echo self::PLANET^;", false);
+ }
+
+ public void testClassConst_04() throws Exception {
+ checkCompletion("testfiles/completion/lib/php56/classConst.php", " echo self::NO_KEYS^;", false);
+ }
+
+ public void testClassConst_05() throws Exception {
+ checkCompletion("testfiles/completion/lib/php56/classConst.php", " echo self::WITH_KEYS^;", false);
+ }
+
+ public void testClassConst_06() throws Exception {
+ checkCompletion("testfiles/completion/lib/php56/classConst.php", " echo self::LONG_ARRAY^;", false);
+ }
+
+ public void testClassConst_07() throws Exception {
+ checkCompletion("testfiles/completion/lib/php56/classConst.php", " echo self::CONST_REF^;", false);
+ }
+
+ public void testGlobalConst_01() throws Exception {
+ checkCompletion("testfiles/completion/lib/php56/globalConst.php", "echo INDEX^;", false);
+ }
+
+ public void testGlobalConst_02() throws Exception {
+ checkCompletion("testfiles/completion/lib/php56/globalConst.php", "echo ALICE^;", false);
+ }
+
+ public void testGlobalConst_03() throws Exception {
+ checkCompletion("testfiles/completion/lib/php56/globalConst.php", "echo PLANET^;", false);
+ }
+
+ public void testGlobalConst_04() throws Exception {
+ checkCompletion("testfiles/completion/lib/php56/globalConst.php", "echo NO_KEYS^;", false);
+ }
+
+ public void testGlobalConst_05() throws Exception {
+ checkCompletion("testfiles/completion/lib/php56/globalConst.php", "echo WITH_KEYS^;", false);
+ }
+
+ public void testGlobalConst_06() throws Exception {
+ checkCompletion("testfiles/completion/lib/php56/globalConst.php", "echo LONG_ARRAY^;", false);
+ }
+
+ public void testGlobalConst_07() throws Exception {
+ checkCompletion("testfiles/completion/lib/php56/globalConst.php", "echo CONST_REF^;", false);
+ }
+
@Override
protected Map<String, ClassPath> createClassPathsForTest() {
return Collections.singletonMap(
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists