[netbeans] branch master updated (296dc8c4d4 -> eba3855928)

2023-03-21 Thread junichi11
This is an automated email from the ASF dual-hosted git repository.

junichi11 pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


from 296dc8c4d4 Merge pull request #5686 from 
junichi11/php-gh-5100-cc-enum-this
 new 6928b96d3b fix navigator view for multiple default namespaces
 new 1bda109d68 FixUsesPerformer,ImportDataCreator and 
UsedNamespaceCollector logic update to fix imports in whole file, fix 
ModelUtils multiple default namespace detection
 new eba3855928 Merge pull request #5681 from 
rossluk/multiple_default_namespace_fixes

The 8295 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../modules/php/editor/actions/FixUsesAction.java  |   2 +-
 .../php/editor/actions/FixUsesPerformer.java   | 307 -
 .../php/editor/actions/ImportDataCreator.java  |  38 ++-
 .../php/editor/actions/UsedNamesCollector.java |  76 ++---
 .../php/editor/actions/UsedNamespaceName.java  |  12 +-
 .../modules/php/editor/model/ModelUtils.java   |  83 ++
 .../php/editor/model/impl/ModelBuilder.java|   2 +-
 ...keted_multiple_namespaces_with_default_one.pass |   5 +-
 ..._multiple_namespaces_with_multiple_default.pass |   9 +
 .../data/testfiles/actions/nb4978_08.php.usedNames |   5 +-
 .../01/testMultipleDefaultNSUse_01.php |  52 
 .../01/testMultipleDefaultNSUse_01.php.fixUses |  54 
 .../02/testMultipleDefaultNSUse_02.php |  52 
 .../02/testMultipleDefaultNSUse_02.php.fixUses |  54 
 .../data/testfiles/actions/testNB4978/01/Foo.php   |  23 ++
 .../data/testfiles/actions/testNB4978/02/Foo.php   |  23 ++
 .../testWholeFileUse/01/testWholeFileUse_01.php|  52 
 .../01/testWholeFileUse_01.php.fixUses |  55 
 .../testWholeFileUse/02/testWholeFileUse_02.php|  52 
 .../02/testWholeFileUse_02.php.fixUses |  55 
 ...d_multiple_namespaces_with_multiple_default.php |  33 +++
 .../php/editor/actions/FixUsesPerformerTest.java   |  47 +++-
 .../modules/php/editor/csl/NavigatorTest.java  |   4 +
 23 files changed, 823 insertions(+), 272 deletions(-)
 create mode 100644 
php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorTest/structure/php53/bracketed_multiple_namespaces_with_multiple_default.pass
 create mode 100644 
php/php.editor/test/unit/data/testfiles/actions/testMultipleDefaultNSUse/01/testMultipleDefaultNSUse_01.php
 create mode 100644 
php/php.editor/test/unit/data/testfiles/actions/testMultipleDefaultNSUse/01/testMultipleDefaultNSUse_01.php.fixUses
 create mode 100644 
php/php.editor/test/unit/data/testfiles/actions/testMultipleDefaultNSUse/02/testMultipleDefaultNSUse_02.php
 create mode 100644 
php/php.editor/test/unit/data/testfiles/actions/testMultipleDefaultNSUse/02/testMultipleDefaultNSUse_02.php.fixUses
 create mode 100644 
php/php.editor/test/unit/data/testfiles/actions/testNB4978/01/Foo.php
 create mode 100644 
php/php.editor/test/unit/data/testfiles/actions/testNB4978/02/Foo.php
 create mode 100644 
php/php.editor/test/unit/data/testfiles/actions/testWholeFileUse/01/testWholeFileUse_01.php
 create mode 100644 
php/php.editor/test/unit/data/testfiles/actions/testWholeFileUse/01/testWholeFileUse_01.php.fixUses
 create mode 100644 
php/php.editor/test/unit/data/testfiles/actions/testWholeFileUse/02/testWholeFileUse_02.php
 create mode 100644 
php/php.editor/test/unit/data/testfiles/actions/testWholeFileUse/02/testWholeFileUse_02.php.fixUses
 create mode 100644 
php/php.editor/test/unit/data/testfiles/structure/php53/bracketed_multiple_namespaces_with_multiple_default.php


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: Fix the code completion for instance context of Enum #5100

2023-03-21 Thread tmysik
This is an automated email from the ASF dual-hosted git repository.

tmysik 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 f432db94ac Fix the code completion for instance context of Enum #5100
 new 296dc8c4d4 Merge pull request #5686 from 
junichi11/php-gh-5100-cc-enum-this
f432db94ac is described below

commit f432db94ac3556780d0f256078286dd6d2e74938
Author: Junichi Yamamoto 
AuthorDate: Mon Mar 20 14:52:54 2023 +0900

Fix the code completion for instance context of Enum #5100

- https://github.com/apache/netbeans/issues/5100
- Add cc items to `$this->`
- Add special keywords(`$this->`, `static::` etc.) inside Enum
---
 .../php/editor/completion/PHPCodeCompletion.java   | 17 +++-
 .../php/editor/model/impl/IndexScopeImpl.java  |  5 ++
 .../php/editor/model/impl/VariousUtils.java|  3 +
 ...SpecialVariablesWithinInstanceContextGH5100.php | 95 ++
 ...iablesWithinInstanceContextGH5100_01.completion | 20 +
 ...iablesWithinInstanceContextGH5100_02.completion | 19 +
 ...iablesWithinInstanceContextGH5100_03.completion |  4 +
 ...iablesWithinInstanceContextGH5100_04.completion |  6 ++
 .../editor/completion/PHP81CodeCompletionTest.java | 17 
 9 files changed, 184 insertions(+), 2 deletions(-)

diff --git 
a/php/php.editor/src/org/netbeans/modules/php/editor/completion/PHPCodeCompletion.java
 
b/php/php.editor/src/org/netbeans/modules/php/editor/completion/PHPCodeCompletion.java
index 471285e46a..d01a10709c 100644
--- 
a/php/php.editor/src/org/netbeans/modules/php/editor/completion/PHPCodeCompletion.java
+++ 
b/php/php.editor/src/org/netbeans/modules/php/editor/completion/PHPCodeCompletion.java
@@ -119,6 +119,7 @@ import 
org.netbeans.modules.php.editor.parser.astnodes.ASTNode;
 import org.netbeans.modules.php.editor.parser.astnodes.Block;
 import org.netbeans.modules.php.editor.parser.astnodes.ClassDeclaration;
 import org.netbeans.modules.php.editor.parser.astnodes.ClassInstanceCreation;
+import org.netbeans.modules.php.editor.parser.astnodes.EnumDeclaration;
 import org.netbeans.modules.php.editor.parser.astnodes.Expression;
 import org.netbeans.modules.php.editor.parser.astnodes.TraitDeclaration;
 import org.netbeans.modules.php.editor.parser.astnodes.TypeDeclaration;
@@ -1999,10 +2000,10 @@ public class PHPCodeCompletion implements 
CodeCompletionHandler2 {
 final ElementFilter forCurrentFile = 
ElementFilter.forFiles(fileObject);
 completionResult.addAll(getVariableProposals(request, 
forCurrentFile.reverseFilter(globalVariables)));
 
-// Special keywords applicable only inside a class or trait
+// Special keywords applicable only inside a class, enum, or trait
 final EnclosingType enclosingType = findEnclosingType(request.info, 
lexerToASTOffset(request.result, request.anchor));
 if (enclosingType != null
-&& (enclosingType.isClassDeclaration() || 
enclosingType.isTraitDeclaration())) {
+&& (enclosingType.isClassDeclaration() || 
enclosingType.isTraitDeclaration() || enclosingType.isEnumDeclaration())) {
 final String typeName = enclosingType.extractTypeName();
 if (typeName != null) {
 for (final String keyword : PHP_CLASS_KEYWORDS) {
@@ -2530,6 +2531,8 @@ public class PHPCodeCompletion implements 
CodeCompletionHandler2 {
 
 boolean isTraitDeclaration();
 
+boolean isEnumDeclaration();
+
 String extractTypeName();
 
 //~ Factories
@@ -2546,6 +2549,11 @@ public class PHPCodeCompletion implements 
CodeCompletionHandler2 {
 return typeDeclaration instanceof TraitDeclaration;
 }
 
+@Override
+public boolean isEnumDeclaration() {
+return typeDeclaration instanceof EnumDeclaration;
+}
+
 @Override
 public String extractTypeName() {
 return CodeUtils.extractTypeName(typeDeclaration);
@@ -2566,6 +2574,11 @@ public class PHPCodeCompletion implements 
CodeCompletionHandler2 {
 return false;
 }
 
+@Override
+public boolean isEnumDeclaration() {
+return false;
+}
+
 @Override
 public String extractTypeName() {
 return CodeUtils.extractClassName(classInstanceCreation);
diff --git 
a/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/IndexScopeImpl.java
 
b/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/IndexScopeImpl.java
index 5432f4cd16..7309acd48d 100644
--- 
a/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/IndexScopeImpl.java
+++ 
b/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/IndexScopeImpl.java
@@ -128,6 

[netbeans] branch master updated: Fix an array formatting in a match arm #5186

2023-03-21 Thread tmysik
This is an automated email from the ASF dual-hosted git repository.

tmysik 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 c2a31881af Fix an array formatting in a match arm #5186
 new ddb1233e37 Merge pull request #5685 from 
junichi11/php-gh-5186-array-formatting-in-match-arm
c2a31881af is described below

commit c2a31881af703ae495bc332cdc823742d3e50b62
Author: Junichi Yamamoto 
AuthorDate: Mon Mar 20 10:47:51 2023 +0900

Fix an array formatting in a match arm #5186

- https://github.com/apache/netbeans/issues/5186

e.g.
```php
match(true){
'test' => [
'key' => 'value',
],
};
```

Before: An array is broken
```php
match (true) {
'test' => [
'key' => 'value',
],
};
```

After:
```php
match (true) {
'test' => [
'key' => 'value',
],
};
```
---
 .../modules/php/editor/indent/FormatVisitor.java   |  1 +
 .../php80/matchExpressionWithArray_01.php  | 37 ++
 .../matchExpressionWithArray_01.php.formatted  | 37 ++
 .../php/editor/indent/PHPFormatterTest.java|  6 
 4 files changed, 81 insertions(+)

diff --git 
a/php/php.editor/src/org/netbeans/modules/php/editor/indent/FormatVisitor.java 
b/php/php.editor/src/org/netbeans/modules/php/editor/indent/FormatVisitor.java
index b23284d349..22eb8745f9 100644
--- 
a/php/php.editor/src/org/netbeans/modules/php/editor/indent/FormatVisitor.java
+++ 
b/php/php.editor/src/org/netbeans/modules/php/editor/indent/FormatVisitor.java
@@ -300,6 +300,7 @@ public class FormatVisitor extends DefaultVisitor {
 if (formatTokens.get(formatTokens.size() - 1).getId() == 
FormatToken.Kind.WHITESPACE_INDENT
 || path.get(1) instanceof ArrayElement
 || path.get(1) instanceof FormalParameter
+|| path.get(1) instanceof MatchArm
 || path.get(1) instanceof CastExpression) {
 // when the array is on the beginning of the line, indent 
items in normal way
 delta = options.indentArrayItems;
diff --git 
a/php/php.editor/test/unit/data/testfiles/formatting/php80/matchExpressionWithArray_01.php
 
b/php/php.editor/test/unit/data/testfiles/formatting/php80/matchExpressionWithArray_01.php
new file mode 100644
index 00..4e7066e5c2
--- /dev/null
+++ 
b/php/php.editor/test/unit/data/testfiles/formatting/php80/matchExpressionWithArray_01.php
@@ -0,0 +1,37 @@
+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.
+ */
+
+// GH-5186
+match(true){
+   'test' => [
+   'key' => 'value',
+   ],
+};
+
+match (true) {
+'test1' => ['key' => 'value'],
+'test2' => [
+'key1' => 'value1',
+'nested' => [
+'key2' => 'value2',
+],
+],
+};
diff --git 
a/php/php.editor/test/unit/data/testfiles/formatting/php80/matchExpressionWithArray_01.php.formatted
 
b/php/php.editor/test/unit/data/testfiles/formatting/php80/matchExpressionWithArray_01.php.formatted
new file mode 100644
index 00..7b3e89b8d4
--- /dev/null
+++ 
b/php/php.editor/test/unit/data/testfiles/formatting/php80/matchExpressionWithArray_01.php.formatted
@@ -0,0 +1,37 @@
+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.
+ */
+
+// GH-5186
+match (true) {
+'test' => [
+'key' => 'value',
+],
+};
+
+match (true) {
+'test1' => ['key' => 'value'],
+'test2' => [
+'key1' => 'value1',
+'nested' => [
+'key2' => 'value2',
+],
+],
+};
diff --git 
a/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/indent/PHPFormatterTest.java
 
b/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/indent/PHPFormatterTest.java
index 0ec6786726..6feeccc9e8 100644
--- 
a/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/indent/PHPFormatterTest.java
+++ 
b/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/indent/PHPFormatterTest.java
@@ -943,6 +943,12 @@ public class PHPFormatterTest extends PHPFormatterTestBase 
{
 
reformatFileContents("testfiles/formatting/php80/matchExpression_SameLine_02.php",
 options);

[netbeans] branch master updated: Fix GotoDeclaration feature for `instanceof` interface #5371

2023-03-21 Thread tmysik
This is an automated email from the ASF dual-hosted git repository.

tmysik 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 83abd45982 Fix GotoDeclaration feature for `instanceof` interface #5371
 new 2b37e4c824 Merge pull request #5684 from 
junichi11/php-gh-5371-goto-instanceof-interface
83abd45982 is described below

commit 83abd45982bb3861ef148b51e0483df875547ec8
Author: Junichi Yamamoto 
AuthorDate: Mon Mar 20 09:02:34 2023 +0900

Fix GotoDeclaration feature for `instanceof` interface #5371

- https://github.com/apache/netbeans/issues/5371
- Also check interfaces
---
 .../php/editor/model/impl/OccurenceBuilder.java|  2 +-
 .../testIssueGH5371/testIssueGH5371.php| 42 ++
 .../testIssueGH5371/testIssueGH5371.php| 42 ++
 ...IssueGH5371.php.testIssueGH5371_01a.occurrences |  3 ++
 ...IssueGH5371.php.testIssueGH5371_01b.occurrences |  3 ++
 ...IssueGH5371.php.testIssueGH5371_01c.occurrences |  3 ++
 ...IssueGH5371.php.testIssueGH5371_02a.occurrences |  3 ++
 ...IssueGH5371.php.testIssueGH5371_02b.occurrences |  3 ++
 ...IssueGH5371.php.testIssueGH5371_02c.occurrences |  3 ++
 .../php/editor/csl/GotoDeclarationGH5371Test.java  | 43 ++
 .../csl/OccurrencesFinderImplGH5371Test.java   | 51 ++
 11 files changed, 197 insertions(+), 1 deletion(-)

diff --git 
a/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/OccurenceBuilder.java
 
b/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/OccurenceBuilder.java
index dde98e49a9..f971b45c14 100644
--- 
a/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/OccurenceBuilder.java
+++ 
b/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/OccurenceBuilder.java
@@ -296,7 +296,7 @@ class OccurenceBuilder {
 }
 
 void prepare(final NamespaceName namespaceName, final Scope scope) {
-Kind[] kinds = {Kind.CLASS, Kind.ENUM};
+Kind[] kinds = {Kind.CLASS, Kind.IFACE, Kind.ENUM};
 prepare(kinds, namespaceName, scope);
 }
 
diff --git 
a/php/php.editor/test/unit/data/testfiles/gotodeclaration/testIssueGH5371/testIssueGH5371.php
 
b/php/php.editor/test/unit/data/testfiles/gotodeclaration/testIssueGH5371/testIssueGH5371.php
new file mode 100644
index 00..37b678873d
--- /dev/null
+++ 
b/php/php.editor/test/unit/data/testfiles/gotodeclaration/testIssueGH5371/testIssueGH5371.php
@@ -0,0 +1,42 @@
+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.
+ */
+
+interface TestInterface {
+public function test();
+}
+
+class TestClass implements TestInterface {
+
+public function test() {
+echo 1;
+}
+
+}
+
+$a = new TestClass();
+
+if ($a instanceof TestClass) {
+$a->test();
+}
+
+if ($a instanceof TestInterface) {
+$a->test();
+}
diff --git 
a/php/php.editor/test/unit/data/testfiles/markoccurences/testIssueGH5371/testIssueGH5371.php
 
b/php/php.editor/test/unit/data/testfiles/markoccurences/testIssueGH5371/testIssueGH5371.php
new file mode 100644
index 00..37b678873d
--- /dev/null
+++ 
b/php/php.editor/test/unit/data/testfiles/markoccurences/testIssueGH5371/testIssueGH5371.php
@@ -0,0 +1,42 @@
+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.
+ */
+
+interface TestInterface {
+public function test();
+}
+
+class TestClass implements TestInterface {
+
+public function test() {
+echo 1;
+}
+
+}
+
+$a = new TestClass();
+
+if ($a instanceof TestClass) {
+$a->test();
+}
+
+if ($a instanceof TestInterface) {
+$a->test();
+}
diff --git 
a/php/php.editor/test/unit/data/testfiles/testIssueGH5371.php.testIssueGH5371_01a.occurrences
 
b/php/php.editor/test/unit/data/testfiles/testIssueGH5371.php.testIssueGH5371_01a.occurrences
new file mode 100644
index 00..f76f8bcd0c
--- /dev/null
+++ 
b/php/php.editor/test/unit/data/testfiles/testIssueGH5371.php.testIssueGH5371_01a.occurrences
@@ -0,0 +1,3 @@
+interface |>MARK_OCCURRENCES:TestInterfa^ce<| {
+class TestClass implements |>MARK_OCCURRENCES:TestInterface<| {
+if ($a instanceof |>MARK_OCCURRENCES:TestInterface<|) {
diff --git 

[netbeans] branch master updated: Add the formatting options for the null coalescing oprator (`??`)#5011

2023-03-21 Thread tmysik
This is an automated email from the ASF dual-hosted git repository.

tmysik 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 59c49072fe Add the formatting options for the null coalescing oprator 
(`??`)#5011
 new 944c70f14a Merge pull request #5689 from 
junichi11/php-gh-5011-coalescing-operator-formatting
59c49072fe is described below

commit 59c49072fe21063c5bfb403cb18cb02bde6e682b
Author: Junichi Yamamoto 
AuthorDate: Tue Mar 21 13:47:30 2023 +0900

Add the formatting options for the null coalescing oprator (`??`)#5011

- https://github.com/apache/netbeans/issues/5011
- Add options
- Add/Move unit tests
- Update the preview files
---
 .../modules/php/editor/indent/CodeStyle.java   |  9 +
 .../modules/php/editor/indent/FmtOptions.java  |  4 ++
 .../modules/php/editor/indent/FormatToken.java |  2 +
 .../modules/php/editor/indent/FormatVisitor.java   | 30 ++-
 .../modules/php/editor/indent/TokenFormatter.java  | 19 ++
 .../modules/php/editor/indent/ui/Bundle.properties |  4 ++
 .../modules/php/editor/indent/ui/FmtSpaces.java|  1 +
 .../modules/php/editor/indent/ui/FmtWrapping.form  | 40 
 .../modules/php/editor/indent/ui/FmtWrapping.java  | 23 ++-
 .../modules/php/editor/indent/ui/Spaces.php|  4 ++
 .../modules/php/editor/indent/ui/Wrapping.php  |  4 ++
 ...rnaryOp09.php => spaceAroundCoalescingOp01.php} |  0
 ...ted => spaceAroundCoalescingOp01.php.formatted} |  0
 ...rnaryOp10.php => spaceAroundCoalescingOp02.php} |  0
 ...ted => spaceAroundCoalescingOp02.php.formatted} |  0
 ...rnaryOp11.php => spaceAroundCoalescingOp03.php} |  0
 ...ted => spaceAroundCoalescingOp03.php.formatted} |  0
 ...rnaryOp12.php => spaceAroundCoalescingOp04.php} |  0
 ...ted => spaceAroundCoalescingOp04.php.formatted} |  0
 .../formatting/wrapping/coalescingOp01a.php| 21 +++
 .../wrapping/coalescingOp01a.php.formatted | 22 +++
 .../formatting/wrapping/coalescingOp01b.php| 21 +++
 .../wrapping/coalescingOp01b.php.formatted | 23 +++
 .../formatting/wrapping/coalescingOp02a.php| 22 +++
 .../wrapping/coalescingOp02a.php.formatted | 21 +++
 .../formatting/wrapping/coalescingOp02b.php| 22 +++
 .../wrapping/coalescingOp02b.php.formatted | 21 +++
 .../formatting/wrapping/coalescingOp03a.php| 21 +++
 .../wrapping/coalescingOp03a.php.formatted | 21 +++
 .../formatting/wrapping/coalescingOp03b.php| 21 +++
 .../wrapping/coalescingOp03b.php.formatted | 21 +++
 .../formatting/wrapping/coalescingOp04a.php| 20 ++
 .../wrapping/coalescingOp04a.php.formatted | 22 +++
 .../formatting/wrapping/coalescingOp04b.php| 21 +++
 .../wrapping/coalescingOp04b.php.formatted | 22 +++
 .../testfiles/formatting/wrapping/ternaryOp07.php  |  3 --
 .../formatting/wrapping/ternaryOp07.php.formatted  |  5 ---
 .../php/editor/indent/PHPFormatterSpacesTest.java  | 32 
 .../editor/indent/PHPFormatterWrappingTest.java| 44 --
 39 files changed, 534 insertions(+), 32 deletions(-)

diff --git 
a/php/php.editor/src/org/netbeans/modules/php/editor/indent/CodeStyle.java 
b/php/php.editor/src/org/netbeans/modules/php/editor/indent/CodeStyle.java
index 7d538b8d9a..b4b3f6d8f5 100644
--- a/php/php.editor/src/org/netbeans/modules/php/editor/indent/CodeStyle.java
+++ b/php/php.editor/src/org/netbeans/modules/php/editor/indent/CodeStyle.java
@@ -322,6 +322,10 @@ public final class CodeStyle {
 return preferences.getBoolean(SPACE_AROUND_TERNARY_OPS, 
getDefaultAsBoolean(SPACE_AROUND_TERNARY_OPS));
 }
 
+public boolean spaceAroundCoalescingOps() {
+return preferences.getBoolean(SPACE_AROUND_COALESCING_OPS, 
getDefaultAsBoolean(SPACE_AROUND_COALESCING_OPS));
+}
+
 public boolean spaceAroundKeyValueOps() {
 return preferences.getBoolean(SPACE_AROUND_KEY_VALUE_OPS, 
getDefaultAsBoolean(SPACE_AROUND_KEY_VALUE_OPS));
 }
@@ -685,6 +689,11 @@ public final class CodeStyle {
 return WrapStyle.valueOf(wrap);
 }
 
+public WrapStyle wrapCoalescingOps() {
+String wrap = preferences.get(WRAP_COALESCING_OPS, 
getDefaultAsString(WRAP_COALESCING_OPS));
+return WrapStyle.valueOf(wrap);
+}
+
 public WrapStyle wrapAssignOps() {
 String wrap = preferences.get(WRAP_ASSIGN_OPS, 
getDefaultAsString(WRAP_ASSIGN_OPS));
 return WrapStyle.valueOf(wrap);
diff --git 
a/php/php.editor/src/org/netbeans/modules/php/editor/indent/FmtOptions.java 
b/php/php.editor/src/org/netbeans/modules/php/editor/indent/FmtOptions.java
index fcfbd1b032..c02a5cb3ec 100644
--- 

[netbeans] branch master updated (9114b1069e -> a89f7f856a)

2023-03-21 Thread matthiasblaesing
This is an automated email from the ASF dual-hosted git repository.

matthiasblaesing pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


from 9114b1069e Avoid ConcurrentMod exception, tolerate broken project 
dependencies (#5660)
 new e4c2f2641a Fix html.lexer and reenable html.lexer and html.editor.lib 
tests in CI/CD
 new ad48f8fa64 Normalize html index (store multiple values as multiple 
entries, instead of joined value)
 new 155fd6798f Fix character entity completion (|mp; was completed to 
)
 new 34bb2ccad3 Support CSS special characters (colons) in class names
 new be093c3486 Ensure indention is handled in a predictable order
 new 6053c24962 Improve CSS escape/unescape routines and enhance/add 
unittests to validate results
 new a89f7f856a Merge pull request #5641 from 
matthiasblaesing/css_with_escape3

The 8284 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/workflows/main.yml | 7 +-
 .../modules/css/editor/csl/CssAnalyser.java| 2 +-
 .../modules/css/editor/csl/CssCompletion.java  |37 +-
 .../modules/css/editor/csl/CssNodeElement.java | 2 +-
 .../editor/module/main/CssRuleStructureItem.java   |10 +-
 .../editor/module/main/DefaultCssEditorModule.java |20 +-
 .../css/editor/module/spi/CssCompletionItem.java   |62 +-
 .../modules/css/indexing/CssFileModel.java | 6 +-
 .../modules/css/refactoring/Bundle.properties  | 6 +-
 .../CssActionsImplementationProvider.java  |   224 +-
 .../modules/css/refactoring/CssElementContext.java |   217 -
 .../refactoring/CssRefactoringPluginFactory.java   | 5 +-
 .../refactoring/CssRenameRefactoringPlugin.java|   159 +-
 .../css/refactoring/CssRenameRefactoringUI.java|25 +-
 .../css/refactoring/CssWhereUsedQueryPlugin.java   |54 +-
 .../modules/css/refactoring/WhereUsedElement.java  | 8 +-
 .../modules/css/refactoring/WhereUsedUI.java   |16 +-
 .../{ => api}/CssRefactoringExtraInfo.java | 6 +-
 .../CssRefactoringInfo.java}   |36 +-
 .../unit/data/testProject/public_html/test.html| 1 +
 .../testfiles/index/identifiers-with-colon.css |11 +
 .../index/identifiers-with-colon.css.indexed   |10 +
 .../netbeans/modules/css/editor/Css3UtilsTest.java | 6 +-
 .../editor/module/spi/CssCompletionItemTest.java   |40 +
 .../modules/css/indexing/CssIndexerTest.java   | 4 +
 .../modules/css/indexing/api/CssIndexTest.java | 2 +-
 .../src/org/netbeans/modules/css/lib/api/Node.java | 5 +-
 .../org/netbeans/modules/css/lib/api/NodeUtil.java |41 +
 .../netbeans/modules/css/lib/api/NodeUtilTest.java |18 +-
 .../modules/editor/indent/TaskHandler.java |25 +-
 .../test/unit/data/testfiles/huge.html | 46216 +++
 ide/html.editor/licenseinfo.xml| 1 +
 ide/html.editor/nbproject/project.xml  | 2 +-
 .../modules/html/editor/CssPreferences.java|78 +
 .../editor/api/completion/HtmlCompletionItem.java  |59 +-
 .../editor/completion/HtmlCompletionQuery.java |72 +-
 .../editor/embedding/CssEmbeddingProvider.java | 7 +-
 .../html/editor/embedding/CssHtmlTranslator.java   |86 +-
 .../html/editor/gsf/HtmlDeclarationFinder.java |   103 +-
 .../editor/indexing/HtmlCssIndexContributor.java   |   148 +
 .../html/editor/indexing/HtmlFileModel.java|89 +-
 .../modules/html/editor/indexing/HtmlIndexer.java  |32 +-
 .../html/editor/refactoring/Bundle.properties  |27 +-
 .../refactoring/CssRenameRefactoringPlugin.java|   228 +
 .../refactoring/CssRenameRefactoringUI.java|29 +-
 .../refactoring/CssWhereUsedQueryPlugin.java   |   201 +
 .../refactoring/ExtractInlinedStylePanel.form  | 2 +-
 .../refactoring/ExtractInlinedStylePanel.java  | 2 +-
 .../HtmlActionsImplementationProvider.java |   145 +-
 .../refactoring/HtmlRefactoringPluginFactory.java  |10 +-
 .../html/editor}/refactoring/RenamePanel.form  | 0
 .../html/editor/refactoring/RenamePanel.java   |   230 +
 .../html/editor}/refactoring/WhereUsedElement.java |17 +-
 .../html/editor}/refactoring/WhereUsedPanel.form   | 0
 .../html/editor/refactoring/WhereUsedPanel.java|   118 +
 .../html/editor}/refactoring/WhereUsedUI.java  |20 +-
 .../modules/html/editor/resources}/rule.png|   Bin
 .../unit/data/testfiles/embedding/issue215267.html | 9 -
 .../testfiles/embedding/issue215267.html.virtual   | 2 -
 .../data/testfiles/embedding/test1.html.virtual| 5 -
 .../unit/data/testfiles/simple07.html.formatted| 2 +-
 

[netbeans] branch master updated: Avoid ConcurrentMod exception, tolerate broken project dependencies (#5660)

2023-03-21 Thread sdedic
This is an automated email from the ASF dual-hosted git repository.

sdedic 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 9114b1069e Avoid ConcurrentMod exception, tolerate broken project 
dependencies (#5660)
9114b1069e is described below

commit 9114b1069e0e0cf7cdf188ba368d0e68a3ba5511
Author: Svatopluk Dedic 
AuthorDate: Tue Mar 21 12:22:45 2023 +0100

Avoid ConcurrentMod exception, tolerate broken project dependencies (#5660)

* Prevent NPE on broken dependencies with no artifacts.
* Make copy of task list before iterating - task map can mutate.
---
 .../modules/cloud/oracle/adm/VulnerabilityWorker.java | 15 ---
 .../modules/gradle/tooling/NbProjectInfoBuilder.java  |  6 --
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git 
a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/VulnerabilityWorker.java
 
b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/VulnerabilityWorker.java
index dea435f0a1..8546d792f0 100644
--- 
a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/VulnerabilityWorker.java
+++ 
b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/VulnerabilityWorker.java
@@ -168,7 +168,7 @@ public class VulnerabilityWorker implements ErrorProvider{
 
 private void buildDependecyMap(Dependency dependency, Map result) {
 String gav = createGAV(dependency.getArtifact());
-if (result.putIfAbsent(gav, dependency) == null) {
+if (gav != null && result.putIfAbsent(gav, dependency) == null) {
 dependency.getChildren().forEach((childDependency) -> {
 buildDependecyMap(childDependency, result);
 });
@@ -557,6 +557,9 @@ public class VulnerabilityWorker implements ErrorProvider{
 
 private int convert(Dependency dependency, Map gavIndex, 
List result) {
 String gav = createGAV(dependency.getArtifact());
+if (gav == null) {
+return -1;
+}
 Integer n = gavIndex.get(gav);
 if (n != null) {
 return n;
@@ -569,7 +572,9 @@ public class VulnerabilityWorker implements ErrorProvider{
 List childrenNodeIds = new 
ArrayList<>(dependency.getChildren().size());
 for (Dependency childDependency : dependency.getChildren()) {
 int cid = convert(childDependency, gavIndex, result);
-childrenNodeIds.add(Integer.toString(cid));
+if (cid != -1) {
+childrenNodeIds.add(Integer.toString(cid));
+}
 }
 builder.applicationDependencyNodeIds(childrenNodeIds);
 result.add(builder.build());
@@ -577,7 +582,11 @@ public class VulnerabilityWorker implements ErrorProvider{
 }
 
 private static String createGAV(ArtifactSpec artifact) {
-StringBuffer sb = new StringBuffer();
+if (artifact == null) {
+return null;
+}
+// use a random constant that could be sufficient to hold gav text 
(micronaut-core has max 86)
+StringBuilder sb = new StringBuilder(120); 
 sb.append(artifact.getGroupId()).append(':');
 sb.append(artifact.getArtifactId()).append(':');
 sb.append(artifact.getVersionSpec());
diff --git 
a/extide/gradle/netbeans-gradle-tooling/src/main/java/org/netbeans/modules/gradle/tooling/NbProjectInfoBuilder.java
 
b/extide/gradle/netbeans-gradle-tooling/src/main/java/org/netbeans/modules/gradle/tooling/NbProjectInfoBuilder.java
index ae319060ae..193f4a3cee 100644
--- 
a/extide/gradle/netbeans-gradle-tooling/src/main/java/org/netbeans/modules/gradle/tooling/NbProjectInfoBuilder.java
+++ 
b/extide/gradle/netbeans-gradle-tooling/src/main/java/org/netbeans/modules/gradle/tooling/NbProjectInfoBuilder.java
@@ -290,7 +290,8 @@ class NbProjectInfoBuilder {
 Map taskProperties = new HashMap<>();
 Map taskPropertyTypes = new HashMap<>();
 
-for (Task task : project.getTasks().getAsMap().values()) {
+// make a copy of the task map; may mutate.
+for (Task task : new 
ArrayList<>(project.getTasks().getAsMap().values())) {
 Class taskClass = task.getClass();
 Class nonDecorated = findNonDecoratedClass(taskClass);
 
@@ -305,7 +306,8 @@ class NbProjectInfoBuilder {
 private void detectTaskDependencies(NbProjectInfoModel model) {
 Map tasks = new HashMap<>();
 
-for (Task task : project.getTasks().getAsMap().values()) {
+// make a copy of the task map; may mutate.
+for (Task task : new 
ArrayList<>(project.getTasks().getAsMap().values())) {
 Map taskInfo = new HashMap<>();
 taskInfo.put("name", task.getPath()); // NOI18N
 taskInfo.put("enabled", Boolean.toString(task.getEnabled())); // 
NOI18N



[netbeans-native-installers] 01/01: Merge pull request #7 from apache/dependabot/maven/master/org.apache.netbeans-netbeans-parent-3

2023-03-21 Thread skygo
This is an automated email from the ASF dual-hosted git repository.

skygo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans-native-installers.git

commit 4c1ab69c1232e095308084b52075459a1e3fcc3e
Merge: 1d9c69f 2a972cb
Author: Eric Barboni 
AuthorDate: Tue Mar 21 11:30:49 2023 +0100

Merge pull request #7 from 
apache/dependabot/maven/master/org.apache.netbeans-netbeans-parent-3

Bump netbeans-parent from 2 to 3

 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans-native-installers] branch master updated (1d9c69f -> 4c1ab69)

2023-03-21 Thread skygo
This is an automated email from the ASF dual-hosted git repository.

skygo pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans-native-installers.git


from 1d9c69f  Merge pull request #6 from 
apache/dependabot/maven/master/org.codehaus.mojo-build-helper-maven-plugin-3.3.0
 add 2a972cb  Bump netbeans-parent from 2 to 3
 new 4c1ab69  Merge pull request #7 from 
apache/dependabot/maven/master/org.apache.netbeans-netbeans-parent-3

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans-native-installers] branch master updated (5cb81a2 -> 1d9c69f)

2023-03-21 Thread skygo
This is an automated email from the ASF dual-hosted git repository.

skygo pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans-native-installers.git


from 5cb81a2  Merge pull request #4 from pedro-w/issue-5060
 add 87b21e2  Bump build-helper-maven-plugin from 3.2.0 to 3.3.0
 add 1d9c69f  Merge pull request #6 from 
apache/dependabot/maven/master/org.codehaus.mojo-build-helper-maven-plugin-3.3.0

No new revisions were added by this update.

Summary of changes:
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[netbeans] branch master updated: LSP: Database icons clean-up: use VSCode codeicon-s where possible; unused branded icons removed (#5688)

2023-03-21 Thread jhorvath
This is an automated email from the ASF dual-hosted git repository.

jhorvath 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 ef9932e3f4 LSP: Database icons clean-up: use VSCode codeicon-s where 
possible; unused branded icons removed (#5688)
ef9932e3f4 is described below

commit ef9932e3f492ede1b15f750beccb32b20291d7a7
Author: Tomas Hurka 
AuthorDate: Tue Mar 21 10:26:24 2023 +0100

LSP: Database icons clean-up: use VSCode codeicon-s where possible; unused 
branded icons removed (#5688)
---
 .../modules/cloud/oracle/resources/compartment.svg | 133 
 .../modules/cloud/oracle/resources/database.svg| 134 -
 .../org/netbeans/modules/db/resources/column.svg   |  36 --
 .../modules/db/resources/columnPrimary.svg |  37 --
 .../netbeans/modules/db/resources/connection.svg   |  91 --
 .../db/resources/connectionDisconnected.svg| 129 
 .../org/netbeans/modules/db/resources/folder.svg   | 132 
 .../org/netbeans/modules/db/resources/index.svg|  29 -
 .../org/netbeans/modules/db/resources/schema.svg   |  28 -
 .../org/netbeans/modules/db/resources/table.svg|  34 --
 java/java.lsp.server/vscode/package.json   |  28 -
 11 files changed, 22 insertions(+), 789 deletions(-)

diff --git 
a/java/java.lsp.server/nbcode/branding/modules/org-netbeans-modules-cloud-oracle.jar/org/netbeans/modules/cloud/oracle/resources/compartment.svg
 
b/java/java.lsp.server/nbcode/branding/modules/org-netbeans-modules-cloud-oracle.jar/org/netbeans/modules/cloud/oracle/resources/compartment.svg
deleted file mode 100644
index 50f63c2884..00
--- 
a/java/java.lsp.server/nbcode/branding/modules/org-netbeans-modules-cloud-oracle.jar/org/netbeans/modules/cloud/oracle/resources/compartment.svg
+++ /dev/null
@@ -1,133 +0,0 @@
-
-
-
-http://www.inkscape.org/namespaces/inkscape;
-   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd;
-   xmlns="http://www.w3.org/2000/svg;
-   xmlns:svg="http://www.w3.org/2000/svg;>
-
-   .st0{fill:#FF;}
-   .st1{opacity:0.25;}
-   .st2{fill:#FAFAFA;}
-   .st3{opacity:0.33;}
-   .st4{fill:none;stroke:#474747;stroke-miterlimit:10;}
-   .st5{opacity:0.42;}
-   .st6{fill:#CAE3FF;}
-   .st7{opacity:0.2;}
-   .st8{opacity:0.03;}
-   .st9{opacity:0.1;}
-   .st10{opacity:0.15;}
-   .st11{opacity:0.45;}
-   .st12{fill:#FFE1B0;}
-   .st13{fill:#B3DBFF;}
-   .st14{fill:#FBDC7C;}
-   .st15{fill:#FFDB43;}
-   .st16{fill:#E79B00;}
-   .st17{fill:#3883CE;}
-   .st18{fill:none;stroke:#003399;stroke-width:1.375;stroke-miterlimit:10;}
-   .st19{fill:#E8513D;}
-   .st20{fill:#1E1E1E;}
-   .st21{fill:#FFC36D;}
-   .st22{fill:#9FCBFF;}
-   .st23{fill:#E9F7FF;}
-   .st24{fill:#62707C;}
-   .st25{fill:#7A8896;}
-   .st26{fill:#57BFFF;}
-   .st27{fill:#E69D35;}
-   .st28{fill:#9CFF73;}
-   .st29{fill:#4891CC;}
-   .st30{fill:#474747;}
-   .st31{fill:#CCA05E;}
-   .st32{opacity:0.67;}
-   .st33{opacity:0.3;}
-   .st34{fill:#EAEAEA;}
-   .st35{fill:#FFE945;}
-   .st36{fill:#FFCF8C;}
-   .st37{fill:#FF5252;}
-   .st38{opacity:0.12;}
-   .st39{fill:#45A5F4;}
-   .st40{fill:url(#SVGID_1_);}
-   .st41{fill:url(#SVGID_2_);}
-   .st42{opacity:0.05;}
-   .st43{fill:#3D81F5;}
-   .st44{fill:#CECECE;}
-   .st45{fill:#B5B5B5;}
-   .st46{opacity:0.4;}
-   .st47{fill:#595959;}
-   .st48{fill:#80FF80;}
-   .st49{fill:#C8FF80;}
-   .st50{fill:#FFEE80;}
-   .st51{fill:#FFA680;}
-   .st52{fill:#FF8080;}
-   .st53{fill:none;}
-   .st54{fill:#007AFF;}
-   .st55{fill:#EFFF78;}
-   .st56{fill:#FFDA00;}
-   .st57{fill:#3EADFF;}
-   .st58{opacity:0.67;fill:#FF;}
-   .st59{fill:#2E92FF;}
-   .st60{fill:#3AEA00;}
-   .st61{fill:#303030;}
-
-
-
-
diff --git 
a/java/java.lsp.server/nbcode/branding/modules/org-netbeans-modules-cloud-oracle.jar/org/netbeans/modules/cloud/oracle/resources/database.svg
 
b/java/java.lsp.server/nbcode/branding/modules/org-netbeans-modules-cloud-oracle.jar/org/netbeans/modules/cloud/oracle/resources/database.svg
deleted file mode 100644
index 711f2afbb6..00
--- 
a/java/java.lsp.server/nbcode/branding/modules/org-netbeans-modules-cloud-oracle.jar/org/netbeans/modules/cloud/oracle/resources/database.svg
+++ /dev/null
@@ -1,134 +0,0 @@
-
-
-
-http://www.inkscape.org/namespaces/inkscape;
-   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd;
-   xmlns="http://www.w3.org/2000/svg;
-   xmlns:svg="http://www.w3.org/2000/svg;>
-
-   .st0{fill:#FF;}
-   .st1{opacity:0.25;}
-   .st2{fill:#FAFAFA;}
-   .st3{opacity:0.33;}
-