(netbeans) branch master updated (f69aa60533 -> 66c7486382)
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 f69aa60533 Merge pull request #7392 from thurka/disable-externalcodeformatter add 9520e0439f Don't fold empty arrays #7187 new 66c7486382 Merge pull request #7398 from junichi11/php-gh-7187-empty-array-folding 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: .../modules/php/editor/csl/FoldingScanner.java | 4 ++ .../data/testfiles/foldingEmptyArrays.php.folds| 50 ++ .../data/testfiles/parser/foldingEmptyArrays.php | 49 + .../modules/php/editor/csl/FoldingTest.java| 5 +++ 4 files changed, 108 insertions(+) create mode 100644 php/php.editor/test/unit/data/testfiles/foldingEmptyArrays.php.folds create mode 100644 php/php.editor/test/unit/data/testfiles/parser/foldingEmptyArrays.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) 01/01: Merge pull request #7398 from junichi11/php-gh-7187-empty-array-folding
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 commit 66c748638254126aef3aaa91d0b1f48422be8235 Merge: f69aa60533 9520e0439f Author: Junichi Yamamoto AuthorDate: Fri May 24 13:44:40 2024 +0900 Merge pull request #7398 from junichi11/php-gh-7187-empty-array-folding Don't fold empty arrays #7187 .../modules/php/editor/csl/FoldingScanner.java | 4 ++ .../data/testfiles/foldingEmptyArrays.php.folds| 50 ++ .../data/testfiles/parser/foldingEmptyArrays.php | 49 + .../modules/php/editor/csl/FoldingTest.java| 5 +++ 4 files changed, 108 insertions(+) - 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) 01/01: Merge pull request #7273 from troizet/improve_validation_php_rename_refactoring
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 commit 0090cf959e52e236fbba307f4b75e3cd4e91d0be Merge: 88d93955c7 07a57de986 Author: Junichi Yamamoto AuthorDate: Wed Apr 17 17:32:45 2024 +0900 Merge pull request #7273 from troizet/improve_validation_php_rename_refactoring PHP: Improved validation of rename refactoring .../src/org/netbeans/modules/refactoring/php/rename/RenamePanel.java| 2 ++ 1 file changed, 2 insertions(+) - 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 (88d93955c7 -> 0090cf959e)
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 88d93955c7 Merge pull request #7268 from sdedic/sdedic/update_truffle_240 add 07a57de986 PHP: Improved validation of rename refactoring new 0090cf959e Merge pull request #7273 from troizet/improve_validation_php_rename_refactoring 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: .../src/org/netbeans/modules/refactoring/php/rename/RenamePanel.java| 2 ++ 1 file changed, 2 insertions(+) - 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 (e7545a9284 -> 06077a3d8f)
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 e7545a9284 Better Gradle Project Creation Wizard add 6f388803ff - Fix bug where phpdoc for a function or method is generated in the wrong block. - Fix bug where phpdoc from another block is used to display documentation for a function or method. new 06077a3d8f Merge pull request #7264 from troizet/fix_phpdoc_generation_in_wrong_block 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: .../modules/php/editor/parser/api/Utils.java | 13 ++- .../phpDocAndFunctionInDifferentBlocks.php | 63 +++ testPhpDocAndFunctionInDifferentBlocks_01.html | 13 +++ testPhpDocAndFunctionInDifferentBlocks_02.html | 13 +++ ...s.php.testPhpDocAndMethodInDifferentBlocks.html | 13 +++ .../editor/completion/PHPCCDocumentationTest.java | 12 +++ .../typinghooks/PhpCommentGeneratorTest.java | 118 + 7 files changed, 243 insertions(+), 2 deletions(-) create mode 100644 php/php.editor/test/unit/data/testfiles/completion/documentation/phpDocAndFunctionInDifferentBlocks.php create mode 100644 php/php.editor/test/unit/data/testfiles/completion/documentation/phpDocAndFunctionInDifferentBlocks.php.testPhpDocAndFunctionInDifferentBlocks_01.html create mode 100644 php/php.editor/test/unit/data/testfiles/completion/documentation/phpDocAndFunctionInDifferentBlocks.php.testPhpDocAndFunctionInDifferentBlocks_02.html create mode 100644 php/php.editor/test/unit/data/testfiles/completion/documentation/phpDocAndFunctionInDifferentBlocks.php.testPhpDocAndMethodInDifferentBlocks.html - 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) 01/01: Merge pull request #7264 from troizet/fix_phpdoc_generation_in_wrong_block
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 commit 06077a3d8fd2f26a1e8fd6265beeab8a7a6b0730 Merge: e7545a9284 6f388803ff Author: Junichi Yamamoto AuthorDate: Sun Apr 14 15:38:34 2024 +0900 Merge pull request #7264 from troizet/fix_phpdoc_generation_in_wrong_block PHP: Fixing a few bugs with phpDoc .../modules/php/editor/parser/api/Utils.java | 13 ++- .../phpDocAndFunctionInDifferentBlocks.php | 63 +++ testPhpDocAndFunctionInDifferentBlocks_01.html | 13 +++ testPhpDocAndFunctionInDifferentBlocks_02.html | 13 +++ ...s.php.testPhpDocAndMethodInDifferentBlocks.html | 13 +++ .../editor/completion/PHPCCDocumentationTest.java | 12 +++ .../typinghooks/PhpCommentGeneratorTest.java | 118 + 7 files changed, 243 insertions(+), 2 deletions(-) - 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) 01/01: Merge pull request #7094 from junichi11/regenerate-php-sigfiles-1.7
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 commit 5c511aa07bb498cf8c00d2080e0ae64864523410 Merge: b5ce4412c5 1a48239042 Author: Junichi Yamamoto AuthorDate: Thu Feb 22 18:16:56 2024 +0900 Merge pull request #7094 from junichi11/regenerate-php-sigfiles-1.7 Regenerate PHP signature files php/php.project/external/binaries-list | 2 +- .../{phpsigfiles-1.6-license.txt => phpsigfiles-1.7-license.txt}| 2 +- .../external/{phpsigfiles-1.6-notice.txt => phpsigfiles-1.7-notice.txt} | 2 +- php/php.project/nbproject/project.properties| 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) - 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 (b5ce4412c5 -> 5c511aa07b)
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 b5ce4412c5 Merge pull request #7032 from pepness/glassfish-7.0.12 add 1a48239042 Regenerate PHP signature files new 5c511aa07b Merge pull request #7094 from junichi11/regenerate-php-sigfiles-1.7 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: php/php.project/external/binaries-list | 2 +- .../{phpsigfiles-1.6-license.txt => phpsigfiles-1.7-license.txt}| 2 +- .../external/{phpsigfiles-1.6-notice.txt => phpsigfiles-1.7-notice.txt} | 2 +- php/php.project/nbproject/project.properties| 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename php/php.project/external/{phpsigfiles-1.6-license.txt => phpsigfiles-1.7-license.txt} (99%) rename php/php.project/external/{phpsigfiles-1.6-notice.txt => phpsigfiles-1.7-notice.txt} (88%) - 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 php-nb22-features deleted (was ffd958e6d8)
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a change to branch php-nb22-features in repository https://gitbox.apache.org/repos/asf/netbeans.git was ffd958e6d8 Merge pull request #7054 from junichi11/php-gh-7041-formatting-use-function The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository. - 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) 01/01: Merge pull request #7056 from apache/php-nb22-features
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 commit 4a3f9bcfde0ffd8bb13a5874559783a8833533c9 Merge: f53aa038bb ffd958e6d8 Author: Junichi Yamamoto AuthorDate: Wed Feb 21 19:44:07 2024 +0900 Merge pull request #7056 from apache/php-nb22-features PHP features for NB22 .../php/dbgp/breakpoints/BreakpointModel.java | 44 +- .../php/dbgp/breakpoints/ExceptionBreakpoint.java | 40 + .../modules/php/dbgp/packets/RunResponse.java | 31 +- php/php.editor/nbproject/project.properties|2 +- .../org/netbeans/modules/php/editor/CodeUtils.java |1 + .../modules/php/editor/api/ElementQuery.java | 11 + .../modules/php/editor/codegen/AutoImport.java | 971 + .../editor/codegen/PHPCodeTemplateProcessor.java | 69 +- .../php/editor/completion/PHPCodeCompletion.java |4 +- .../php/editor/completion/PHPCompletionItem.java | 167 +- .../php/editor/elements/IndexQueryImpl.java| 20 + .../modules/php/editor/indent/TokenFormatter.java |8 + .../modules/php/editor/options/Bundle.properties | 15 + .../php/editor/options/CodeCompletionPanel.form| 285 +- .../php/editor/options/CodeCompletionPanel.java| 317 +- .../modules/php/editor/options/OptionsUtils.java | 89 + .../testGroupUsesC01/testGroupUsesC01.php} | 31 +- ...esC01.php.testGroupUsesC01_Const01a.autoimport} | 32 +- ...esC01.php.testGroupUsesC01_Const01b.autoimport} | 32 +- ...sesC01.php.testGroupUsesC01_Const02.autoimport} | 32 +- ...sesC01.php.testGroupUsesC01_Const03.autoimport} | 32 +- ...esC01.php.testGroupUsesC01_Const04a.autoimport} | 32 +- ...esC01.php.testGroupUsesC01_Const04b.autoimport} | 32 +- ...01.php.testGroupUsesC01_Function01a.autoimport} | 32 +- ...01.php.testGroupUsesC01_Function01b.autoimport} | 31 +- ...01.php.testGroupUsesC01_Function01c.autoimport} | 32 +- ...01.php.testGroupUsesC01_Function01d.autoimport} | 31 +- ...sesC01.php.testGroupUsesC01_Type01a.autoimport} | 32 +- ...sesC01.php.testGroupUsesC01_Type01b.autoimport} | 31 +- .../testGroupUsesF01/testGroupUsesF01.php} | 31 +- ...esF01.php.testGroupUsesF01_Const01a.autoimport} | 32 +- ...esF01.php.testGroupUsesF01_Const01b.autoimport} | 31 +- ...esF01.php.testGroupUsesF01_Const01c.autoimport} | 32 +- ...esF01.php.testGroupUsesF01_Const01d.autoimport} | 31 +- ...F01.php.testGroupUsesF01_Function01.autoimport} | 31 +- ...01.php.testGroupUsesF01_Function02a.autoimport} | 32 +- ...01.php.testGroupUsesF01_Function02b.autoimport} | 32 +- ...01.php.testGroupUsesF01_Function02c.autoimport} | 32 +- ...01.php.testGroupUsesF01_Function02d.autoimport} | 32 +- ...01.php.testGroupUsesF01_Function03a.autoimport} | 32 +- ...01.php.testGroupUsesF01_Function03b.autoimport} | 32 +- ...sesF01.php.testGroupUsesF01_Type01a.autoimport} | 32 +- ...sesF01.php.testGroupUsesF01_Type01b.autoimport} | 31 +- .../testGroupUsesT01/testGroupUsesT01.php} | 30 +- ...esT01.php.testGroupUsesT01_Const01a.autoimport} | 31 +- ...esT01.php.testGroupUsesT01_Const01b.autoimport} | 30 +- ...01.php.testGroupUsesT01_Function01a.autoimport} | 31 +- ...01.php.testGroupUsesT01_Function01b.autoimport} | 30 +- ...UsesT01.php.testGroupUsesT01_Type01.autoimport} | 30 +- ...sesT01.php.testGroupUsesT01_Type02a.autoimport} | 31 +- ...sesT01.php.testGroupUsesT01_Type02b.autoimport} | 31 +- ...sesT01.php.testGroupUsesT01_Type03a.autoimport} | 31 +- ...sesT01.php.testGroupUsesT01_Type03b.autoimport} | 31 +- ...UsesT01.php.testGroupUsesT01_Type04.autoimport} | 31 +- ...UsesT01.php.testGroupUsesT01_Type05.autoimport} | 31 +- ...sesT01.php.testGroupUsesT01_Type06a.autoimport} | 31 +- ...sesT01.php.testGroupUsesT01_Type06b.autoimport} | 31 +- .../testGroupUsesT02/testGroupUsesT02.php} | 32 +- ...esT02.php.testGroupUsesT02_Const01a.autoimport} | 33 +- ...esT02.php.testGroupUsesT02_Const01b.autoimport} | 32 +- ...02.php.testGroupUsesT02_Function01a.autoimport} | 33 +- ...02.php.testGroupUsesT02_Function01b.autoimport} | 32 +- ...UsesT02.php.testGroupUsesT02_Type01.autoimport} | 33 +- ...UsesT02.php.testGroupUsesT02_Type02.autoimport} | 33 +- ...UsesT02.php.testGroupUsesT02_Type03.autoimport} | 33 +- ...UsesT02.php.testGroupUsesT02_Type04.autoimport} | 33 +- ...UsesT02.php.testGroupUsesT02_Type05.autoimport} | 33 +- ...sesT02.php.testGroupUsesT02_Type06a.autoimport} | 33 +- ...sesT02.php.testGroupUsesT02_Type06b.autoimport} | 33 +- .../testGroupUsesT03/testGroupUsesT03.php} | 37 +- ...esT03.php.testGroupUsesT03_Const01a.autoimport} | 38 +- ...esT03.php.testGroupUsesT03_Const01b.autoimport} | 37 +- ...03.php.testGroupUsesT03_Function01a.autoimport} | 38 +- ...03.php.testGroupUsesT03_Function01b.autoimport} | 37
(netbeans) 01/01: Merge pull request #7054 from junichi11/php-gh-7041-formatting-use-function
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a commit to branch php-nb22-features in repository https://gitbox.apache.org/repos/asf/netbeans.git commit ffd958e6d8c50dca70fc8f346a3bfe152da30bd2 Merge: 3eae17f0d1 e6cbcb2d2c Author: Junichi Yamamoto AuthorDate: Sun Feb 11 21:23:02 2024 +0900 Merge pull request #7054 from junichi11/php-gh-7041-formatting-use-function Fix incorrect code completion for use function #7041 .../php/editor/completion/PHPCompletionItem.java | 10 + .../testGroupUseFunction01.php | 29 + ...nction01.php.testGroupUseFunction01.cccustomtpl | 5 +++ .../gh7041/testUseFunction01/testUseFunction01.php | 28 + ...UseFunction01.php.testUseFunction01.cccustomtpl | 5 +++ .../editor/completion/PHP71CodeCompletionTest.java | 9 .../editor/completion/PHP72CodeCompletionTest.java | 9 .../editor/completion/PHP74CodeCompletionTest.java | 9 .../editor/completion/PHP80CodeCompletionTest.java | 9 .../editor/completion/PHP81CodeCompletionTest.java | 9 .../editor/completion/PHP82CodeCompletionTest.java | 9 .../editor/completion/PHP83CodeCompletionTest.java | 9 .../PHPCodeCompletionAutoImportTest.java | 9 .../completion/PHPCodeCompletionGH7041Test.java| 48 ++ .../PHPCodeCompletionMagicMethodTest.java | 9 .../completion/PHPCodeCompletionTestBase.java | 9 16 files changed, 134 insertions(+), 81 deletions(-) - 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 php-nb22-features updated (3eae17f0d1 -> ffd958e6d8)
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a change to branch php-nb22-features in repository https://gitbox.apache.org/repos/asf/netbeans.git from 3eae17f0d1 Merge pull request #7027 from junichi11/php-auto-import add e6cbcb2d2c Fix incorrect code completion for use function #7041 new ffd958e6d8 Merge pull request #7054 from junichi11/php-gh-7041-formatting-use-function 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: .../php/editor/completion/PHPCompletionItem.java | 10 + .../testGroupUseFunction01.php | 29 + ...nction01.php.testGroupUseFunction01.cccustomtpl | 5 +++ .../gh7041/testUseFunction01/testUseFunction01.php | 28 + ...UseFunction01.php.testUseFunction01.cccustomtpl | 5 +++ .../editor/completion/PHP71CodeCompletionTest.java | 9 .../editor/completion/PHP72CodeCompletionTest.java | 9 .../editor/completion/PHP74CodeCompletionTest.java | 9 .../editor/completion/PHP80CodeCompletionTest.java | 9 .../editor/completion/PHP81CodeCompletionTest.java | 9 .../editor/completion/PHP82CodeCompletionTest.java | 9 .../editor/completion/PHP83CodeCompletionTest.java | 9 .../PHPCodeCompletionAutoImportTest.java | 9 .../completion/PHPCodeCompletionGH7041Test.java| 48 ++ .../PHPCodeCompletionMagicMethodTest.java | 9 .../completion/PHPCodeCompletionTestBase.java | 9 16 files changed, 134 insertions(+), 81 deletions(-) create mode 100644 php/php.editor/test/unit/data/testfiles/completion/lib/gh7041/testGroupUseFunction01/testGroupUseFunction01.php create mode 100644 php/php.editor/test/unit/data/testfiles/completion/lib/gh7041/testGroupUseFunction01/testGroupUseFunction01.php.testGroupUseFunction01.cccustomtpl create mode 100644 php/php.editor/test/unit/data/testfiles/completion/lib/gh7041/testUseFunction01/testUseFunction01.php create mode 100644 php/php.editor/test/unit/data/testfiles/completion/lib/gh7041/testUseFunction01/testUseFunction01.php.testUseFunction01.cccustomtpl create mode 100644 php/php.editor/test/unit/src/org/netbeans/modules/php/editor/completion/PHPCodeCompletionGH7041Test.java - 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) 01/01: Merge pull request #7027 from junichi11/php-auto-import
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a commit to branch php-nb22-features in repository https://gitbox.apache.org/repos/asf/netbeans.git commit 3eae17f0d1649bb72ffba876f2783ce00e77a683 Merge: b33890d1b1 c470ae1e38 Author: Junichi Yamamoto AuthorDate: Sun Feb 11 12:22:21 2024 +0900 Merge pull request #7027 from junichi11/php-auto-import Add the Auto Import feature for Code Completion php/php.editor/nbproject/project.properties|2 +- .../org/netbeans/modules/php/editor/CodeUtils.java |1 + .../modules/php/editor/api/ElementQuery.java | 11 + .../modules/php/editor/codegen/AutoImport.java | 971 + .../editor/codegen/PHPCodeTemplateProcessor.java | 69 +- .../php/editor/completion/PHPCodeCompletion.java |4 +- .../php/editor/completion/PHPCompletionItem.java | 157 +- .../php/editor/elements/IndexQueryImpl.java| 20 + .../modules/php/editor/options/Bundle.properties | 15 + .../php/editor/options/CodeCompletionPanel.form| 285 +- .../php/editor/options/CodeCompletionPanel.java| 317 +- .../modules/php/editor/options/OptionsUtils.java | 89 + .../testGroupUsesC01/testGroupUsesC01.php | 29 + ...sesC01.php.testGroupUsesC01_Const01a.autoimport | 30 + ...sesC01.php.testGroupUsesC01_Const01b.autoimport | 30 + ...UsesC01.php.testGroupUsesC01_Const02.autoimport | 30 + ...UsesC01.php.testGroupUsesC01_Const03.autoimport | 30 + ...sesC01.php.testGroupUsesC01_Const04a.autoimport | 30 + ...sesC01.php.testGroupUsesC01_Const04b.autoimport | 30 + ...C01.php.testGroupUsesC01_Function01a.autoimport | 30 + ...C01.php.testGroupUsesC01_Function01b.autoimport | 31 + ...C01.php.testGroupUsesC01_Function01c.autoimport | 30 + ...C01.php.testGroupUsesC01_Function01d.autoimport | 31 + ...UsesC01.php.testGroupUsesC01_Type01a.autoimport | 30 + ...UsesC01.php.testGroupUsesC01_Type01b.autoimport | 31 + .../testGroupUsesF01/testGroupUsesF01.php | 29 + ...sesF01.php.testGroupUsesF01_Const01a.autoimport | 30 + ...sesF01.php.testGroupUsesF01_Const01b.autoimport | 31 + ...sesF01.php.testGroupUsesF01_Const01c.autoimport | 30 + ...sesF01.php.testGroupUsesF01_Const01d.autoimport | 31 + ...sF01.php.testGroupUsesF01_Function01.autoimport | 29 + ...F01.php.testGroupUsesF01_Function02a.autoimport | 30 + ...F01.php.testGroupUsesF01_Function02b.autoimport | 30 + ...F01.php.testGroupUsesF01_Function02c.autoimport | 30 + ...F01.php.testGroupUsesF01_Function02d.autoimport | 30 + ...F01.php.testGroupUsesF01_Function03a.autoimport | 30 + ...F01.php.testGroupUsesF01_Function03b.autoimport | 30 + ...UsesF01.php.testGroupUsesF01_Type01a.autoimport | 30 + ...UsesF01.php.testGroupUsesF01_Type01b.autoimport | 31 + .../testGroupUsesT01/testGroupUsesT01.php | 28 + ...sesT01.php.testGroupUsesT01_Const01a.autoimport | 29 + ...sesT01.php.testGroupUsesT01_Const01b.autoimport | 30 + ...T01.php.testGroupUsesT01_Function01a.autoimport | 29 + ...T01.php.testGroupUsesT01_Function01b.autoimport | 30 + ...pUsesT01.php.testGroupUsesT01_Type01.autoimport | 28 + ...UsesT01.php.testGroupUsesT01_Type02a.autoimport | 29 + ...UsesT01.php.testGroupUsesT01_Type02b.autoimport | 29 + ...UsesT01.php.testGroupUsesT01_Type03a.autoimport | 29 + ...UsesT01.php.testGroupUsesT01_Type03b.autoimport | 29 + ...pUsesT01.php.testGroupUsesT01_Type04.autoimport | 29 + ...pUsesT01.php.testGroupUsesT01_Type05.autoimport | 29 + ...UsesT01.php.testGroupUsesT01_Type06a.autoimport | 29 + ...UsesT01.php.testGroupUsesT01_Type06b.autoimport | 29 + .../testGroupUsesT02/testGroupUsesT02.php | 30 + ...sesT02.php.testGroupUsesT02_Const01a.autoimport | 31 + ...sesT02.php.testGroupUsesT02_Const01b.autoimport | 32 + ...T02.php.testGroupUsesT02_Function01a.autoimport | 31 + ...T02.php.testGroupUsesT02_Function01b.autoimport | 32 + ...pUsesT02.php.testGroupUsesT02_Type01.autoimport | 31 + ...pUsesT02.php.testGroupUsesT02_Type02.autoimport | 31 + ...pUsesT02.php.testGroupUsesT02_Type03.autoimport | 31 + ...pUsesT02.php.testGroupUsesT02_Type04.autoimport | 31 + ...pUsesT02.php.testGroupUsesT02_Type05.autoimport | 31 + ...UsesT02.php.testGroupUsesT02_Type06a.autoimport | 31 + ...UsesT02.php.testGroupUsesT02_Type06b.autoimport | 31 + .../testGroupUsesT03/testGroupUsesT03.php | 35 + ...sesT03.php.testGroupUsesT03_Const01a.autoimport | 36 + ...sesT03.php.testGroupUsesT03_Const01b.autoimport | 37 + ...T03.php.testGroupUsesT03_Function01a.autoimport | 36 + ...T03.php.testGroupUsesT03_Function01b.autoimport | 37 + ...pUsesT03.php.testGroupUsesT03_Type01.autoimport | 36 + ...pUsesT03.php.testGroupUsesT03_Type02.autoimport | 36 + ...pUsesT03.php.testGroupUsesT03_Type03.autoimport | 36 + ...pUsesT03.php.testGroupUsesT03_Type04.autoimport | 36 + ...pUsesT03
(netbeans) branch php-nb22-features updated (35a83e09a5 -> b33890d1b1)
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a change to branch php-nb22-features in repository https://gitbox.apache.org/repos/asf/netbeans.git from 35a83e09a5 Merge pull request #6981 from junichi11/php-gh-6980-incorrect-formatting add da5a813ffa PHP: Implemented display of exception message when exception breakpoints are hit new b33890d1b1 Merge pull request #6992 from troizet/php_exception_breakpoint_show_message 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: .../php/dbgp/breakpoints/BreakpointModel.java | 44 -- .../php/dbgp/breakpoints/ExceptionBreakpoint.java | 40 .../modules/php/dbgp/packets/RunResponse.java | 31 ++- 3 files changed, 109 insertions(+), 6 deletions(-) - 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) 01/01: Merge pull request #6992 from troizet/php_exception_breakpoint_show_message
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a commit to branch php-nb22-features in repository https://gitbox.apache.org/repos/asf/netbeans.git commit b33890d1b102b0548db5063512df22c4601579f8 Merge: 35a83e09a5 da5a813ffa Author: Junichi Yamamoto AuthorDate: Mon Feb 5 08:31:47 2024 +0900 Merge pull request #6992 from troizet/php_exception_breakpoint_show_message PHP: Implemented display of exception message when exception breakpoints are hit .../php/dbgp/breakpoints/BreakpointModel.java | 44 -- .../php/dbgp/breakpoints/ExceptionBreakpoint.java | 40 .../modules/php/dbgp/packets/RunResponse.java | 31 ++- 3 files changed, 109 insertions(+), 6 deletions(-) - 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) 01/01: Merge pull request #6981 from junichi11/php-gh-6980-incorrect-formatting
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a commit to branch php-nb22-features in repository https://gitbox.apache.org/repos/asf/netbeans.git commit 35a83e09a5926dd4e54725927a7941429f9e091c Merge: 2100f39631 452a636fe8 Author: Junichi Yamamoto AuthorDate: Sun Jan 21 18:56:46 2024 +0900 Merge pull request #6981 from junichi11/php-gh-6980-incorrect-formatting Fix incorrect formatting after use statements #6980 .../modules/php/editor/indent/TokenFormatter.java | 8 + .../formatting/blankLines/issueGH6980_01.php | 22 + .../issueGH6980_01.php.testGH6980_01.formatted | 24 +++ .../formatting/blankLines/issueGH6980_02.php | 24 +++ .../issueGH6980_02.php.testGH6980_02.formatted | 26 .../formatting/blankLines/issueGH6980_03.php | 25 +++ .../issueGH6980_03.php.testGH6980_03.formatted | 27 .../blankLines/issueGH6980_NSWithBlock01.php | 24 +++ ...hBlock01.php.testGH6980_NSWithBlock01.formatted | 27 .../blankLines/issueGH6980_NSWithBlock02.php | 26 ...hBlock02.php.testGH6980_NSWithBlock02.formatted | 30 ++ .../blankLines/issueGH6980_NSWithBlock03.php | 27 ...hBlock03.php.testGH6980_NSWithBlock03.formatted | 30 ++ .../editor/indent/PHPFormatterBlankLinesTest.java | 36 ++ 14 files changed, 356 insertions(+) - 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 php-nb22-features updated (2100f39631 -> 35a83e09a5)
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a change to branch php-nb22-features in repository https://gitbox.apache.org/repos/asf/netbeans.git from 2100f39631 Update issue report template for NB21 release candidates add 452a636fe8 Fix incorrect formatting after use statements #6980 new 35a83e09a5 Merge pull request #6981 from junichi11/php-gh-6980-incorrect-formatting 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: .../modules/php/editor/indent/TokenFormatter.java | 8 + .../formatting/blankLines/issueGH6980_01.php | 22 + .../issueGH6980_01.php.testGH6980_01.formatted | 24 +++ .../formatting/blankLines/issueGH6980_02.php | 24 +++ .../issueGH6980_02.php.testGH6980_02.formatted | 26 .../formatting/blankLines/issueGH6980_03.php | 25 +++ .../issueGH6980_03.php.testGH6980_03.formatted | 27 .../blankLines/issueGH6980_NSWithBlock01.php | 24 +++ ...hBlock01.php.testGH6980_NSWithBlock01.formatted | 27 .../blankLines/issueGH6980_NSWithBlock02.php | 26 ...hBlock02.php.testGH6980_NSWithBlock02.formatted | 30 ++ .../blankLines/issueGH6980_NSWithBlock03.php | 27 ...hBlock03.php.testGH6980_NSWithBlock03.formatted | 30 ++ .../editor/indent/PHPFormatterBlankLinesTest.java | 36 ++ 14 files changed, 356 insertions(+) create mode 100644 php/php.editor/test/unit/data/testfiles/formatting/blankLines/issueGH6980_01.php create mode 100644 php/php.editor/test/unit/data/testfiles/formatting/blankLines/issueGH6980_01.php.testGH6980_01.formatted create mode 100644 php/php.editor/test/unit/data/testfiles/formatting/blankLines/issueGH6980_02.php create mode 100644 php/php.editor/test/unit/data/testfiles/formatting/blankLines/issueGH6980_02.php.testGH6980_02.formatted create mode 100644 php/php.editor/test/unit/data/testfiles/formatting/blankLines/issueGH6980_03.php create mode 100644 php/php.editor/test/unit/data/testfiles/formatting/blankLines/issueGH6980_03.php.testGH6980_03.formatted create mode 100644 php/php.editor/test/unit/data/testfiles/formatting/blankLines/issueGH6980_NSWithBlock01.php create mode 100644 php/php.editor/test/unit/data/testfiles/formatting/blankLines/issueGH6980_NSWithBlock01.php.testGH6980_NSWithBlock01.formatted create mode 100644 php/php.editor/test/unit/data/testfiles/formatting/blankLines/issueGH6980_NSWithBlock02.php create mode 100644 php/php.editor/test/unit/data/testfiles/formatting/blankLines/issueGH6980_NSWithBlock02.php.testGH6980_NSWithBlock02.formatted create mode 100644 php/php.editor/test/unit/data/testfiles/formatting/blankLines/issueGH6980_NSWithBlock03.php create mode 100644 php/php.editor/test/unit/data/testfiles/formatting/blankLines/issueGH6980_NSWithBlock03.php.testGH6980_NSWithBlock03.formatted - 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 php-nb22-features created (now 2100f39631)
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a change to branch php-nb22-features in repository https://gitbox.apache.org/repos/asf/netbeans.git at 2100f39631 Update issue report template for NB21 release candidates No new revisions were added by this update. - 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 (1a24df8422 -> 2a616c3e15)
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 1a24df8422 Merge pull request #6948 from DevCharly/flatlaf-3.3 new 84931f4f95 Fix the code completion for predefined attributes new e79431d3a4 Use `PredefinedSymbols.Attributes.OVERRIDE` instead of `CodeUtils.OVERRIDE*` new 2a616c3e15 Merge pull request #6951 from junichi11/php-fix-cc-for-predefined-attributes The 9624 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: .../org/netbeans/modules/php/editor/CodeUtils.java | 5 --- .../modules/php/editor/PredefinedSymbols.java | 45 ++ .../codegen/SinglePropertyMethodCreator.java | 3 +- .../php/editor/completion/PHPCompletionItem.java | 3 +- .../php/editor/model/impl/ClassScopeImpl.java | 25 +++- .../verification/AddOverrideAttributeHint.java | 13 --- .../ImplementAbstractMethodsHintError.java | 3 +- .../testAttributesPredefined.php | 32 +++ ...ined.php.testAttributesPredefined_01.completion | 16 .../editor/completion/PHP80CodeCompletionTest.java | 4 ++ 10 files changed, 126 insertions(+), 23 deletions(-) create mode 100644 php/php.editor/test/unit/data/testfiles/completion/lib/php80/testAttributesPredefined/testAttributesPredefined.php create mode 100644 php/php.editor/test/unit/data/testfiles/completion/lib/php80/testAttributesPredefined/testAttributesPredefined.php.testAttributesPredefined_01.completion - 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: Regenerate PHP signature files
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 240b12743d Regenerate PHP signature files new de9d3da24f Merge pull request #6950 from junichi11/php-sigfiles-1.6 240b12743d is described below commit 240b12743d3edf390fdf01c49eee814bdf646dd8 Author: Junichi Yamamoto AuthorDate: Fri Jan 12 14:08:35 2024 +0900 Regenerate PHP signature files PHP Documentation: Date: 11 Jan 2024 --- php/php.project/external/binaries-list | 2 +- .../{phpsigfiles-1.5-license.txt => phpsigfiles-1.6-license.txt}| 2 +- .../external/{phpsigfiles-1.5-notice.txt => phpsigfiles-1.6-notice.txt} | 0 php/php.project/nbproject/project.properties| 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/php/php.project/external/binaries-list b/php/php.project/external/binaries-list index 23bd43969e..3e727a7d1b 100644 --- a/php/php.project/external/binaries-list +++ b/php/php.project/external/binaries-list @@ -14,4 +14,4 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -85671C8F8F936E1E66FC46D463ED290105A46EAC phpsigfiles-1.5.zip +D1E3E08A0EC214BABC45383CE4238AAA9FAAE507 phpsigfiles-1.6.zip diff --git a/php/php.project/external/phpsigfiles-1.5-license.txt b/php/php.project/external/phpsigfiles-1.6-license.txt similarity index 99% rename from php/php.project/external/phpsigfiles-1.5-license.txt rename to php/php.project/external/phpsigfiles-1.6-license.txt index 73c37552a1..b644d57d16 100644 --- a/php/php.project/external/phpsigfiles-1.5-license.txt +++ b/php/php.project/external/phpsigfiles-1.6-license.txt @@ -1,5 +1,5 @@ Name: phpsigfiles -Version: 1.5 +Version: 1.6 Description: Signature files for PHP runtime and PHP runtime extensions for use from code completion etc. The file is build from the PHP manual. License: CC-BY-3.0 Origin: http://www.php.net/docs.php diff --git a/php/php.project/external/phpsigfiles-1.5-notice.txt b/php/php.project/external/phpsigfiles-1.6-notice.txt similarity index 100% rename from php/php.project/external/phpsigfiles-1.5-notice.txt rename to php/php.project/external/phpsigfiles-1.6-notice.txt diff --git a/php/php.project/nbproject/project.properties b/php/php.project/nbproject/project.properties index 985907d8e6..c227db8acf 100644 --- a/php/php.project/nbproject/project.properties +++ b/php/php.project/nbproject/project.properties @@ -20,7 +20,7 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.8 javadoc.arch=${basedir}/arch.xml -release.external/phpsigfiles-1.5.zip=docs/phpsigfiles.zip +release.external/phpsigfiles-1.6.zip=docs/phpsigfiles.zip extra.module.files=docs/phpsigfiles.zip test.config.stableBTD.includes=**/*Test.class - 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 problem that inccorect indentation is added after an attribute(e.g. `#[Attr(1, 2)]`)
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 e941825dec Fix the problem that inccorect indentation is added after an attribute(e.g. `#[Attr(1, 2)]`) new cf2cfda11d Merge pull request #6940 from junichi11/php-attribute-new-line-indent e941825dec is described below commit e941825dec55682523b248763a0b3eb95e6a39cd Author: Junichi Yamamoto AuthorDate: Wed Jan 10 15:25:42 2024 +0900 Fix the problem that inccorect indentation is added after an attribute(e.g. `#[Attr(1, 2)]`) Example: ```php #[Attr1(1, 2)] #[Attr2("test", "test")]^ // type enter key here class AttributedClass { #[Attr1(1, 2)] #[Attr2("test", "test")]^ // type enter key here public function method(): void { } } ``` Before: ```php #[Attr1(1, 2)] #[Attr2("test", "test")] ^// incorrect indent class AttributedClass { #[Attr1(1, 2)] #[Attr2("test", "test")] ^// incorrect indent public function method(): void { } } ``` After: ```php #[Attr1(1, 2)] #[Attr2("test", "test")] ^// correct indent class AttributedClass { #[Attr1(1, 2)] #[Attr2("test", "test")] ^// correct indent public function method(): void { } } ``` --- .../php/editor/indent/IndentationCounter.java | 5 ++-- .../testfiles/indent/php80/attributeSyntax_09.php | 21 ++ .../indent/php80/attributeSyntax_09.php.indented | 22 +++ .../testfiles/indent/php80/attributeSyntax_10.php | 21 ++ .../indent/php80/attributeSyntax_10.php.indented | 22 +++ .../testfiles/indent/php80/attributeSyntax_11.php | 21 ++ .../indent/php80/attributeSyntax_11.php.indented | 22 +++ .../testfiles/indent/php80/attributeSyntax_12.php | 21 ++ .../indent/php80/attributeSyntax_12.php.indented | 22 +++ .../testfiles/indent/php80/attributeSyntax_13.php | 21 ++ .../indent/php80/attributeSyntax_13.php.indented | 22 +++ .../testfiles/indent/php80/attributeSyntax_14.php | 22 +++ .../indent/php80/attributeSyntax_14.php.indented | 23 .../testfiles/indent/php80/attributeSyntax_15.php | 25 + .../indent/php80/attributeSyntax_15.php.indented | 26 ++ .../testfiles/indent/php80/attributeSyntax_16.php | 29 .../indent/php80/attributeSyntax_16.php.indented | 30 .../php/editor/indent/PHPNewLineIndenterTest.java | 32 ++ 18 files changed, 405 insertions(+), 2 deletions(-) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/indent/IndentationCounter.java b/php/php.editor/src/org/netbeans/modules/php/editor/indent/IndentationCounter.java index 2b11dea818..18295da010 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/indent/IndentationCounter.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/indent/IndentationCounter.java @@ -766,8 +766,9 @@ public class IndentationCounter { } } if (result) { -// check whether there is tokens other than whitespace for parameters, anonymous function/class -int lineStart = LineDocumentUtils.getLineStart(doc, LineDocumentUtils.getLineStart(doc, ts.offset()) - 1); +// check for non-whitespace tokens before an attribute of parameters, anonymous function/class +// not `ts.offset() - 1` but `ts.offset()` to avoid getting the start position of the previous line +int lineStart = LineDocumentUtils.getLineStart(doc, LineDocumentUtils.getLineStart(doc, ts.offset())); while (ts.movePrevious() && ts.offset() >= lineStart) { if (ts.token().id() != PHPTokenId.WHITESPACE) { result = false; diff --git a/php/php.editor/test/unit/data/testfiles/indent/php80/attributeSyntax_09.php b/php/php.editor/test/unit/data/testfiles/indent/php80/attributeSyntax_09.php new file mode 100644 index 00..e6899db128 --- /dev/null +++ b/php/php.editor/test/unit/data/testfiles/indent/php80/attributeSyntax_09.php @@ -0,0 +1,21 @@ +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 l
(netbeans) branch master updated: Fix incorrect code completion with the same member names as semi-type prefixes #6909
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 326cef41f4 Fix incorrect code completion with the same member names as semi-type prefixes #6909 new 1b73a19f71 Merge pull request #6915 from junichi11/php-gh-6909-incorrect-cc-with-type-method 326cef41f4 is described below commit 326cef41f4f82b3d6280dc80a4826dedec70750e Author: Junichi Yamamoto AuthorDate: Thu Jan 4 20:50:32 2024 +0900 Fix incorrect code completion with the same member names as semi-type prefixes #6909 - https://github.com/apache/netbeans/issues/6909 - To avoid conflicting with member names, add `-type` suffix to semi-type prefixes because "-" can not be contained to member names - Add unit tests Example: ```php class Example { public function Type(): int { return 0; } public function test(): void { $this->Type()-> // before: Example members(`Type()`, `test()`) are shown // after : no items } } ``` --- .../php/editor/model/impl/VariousUtils.java| 22 ++-- .../testfiles/completion/lib/gh6909/gh6909.php | 86 +++ .../gh6909.php.testGH6909_FieldType01.completion | 6 ++ .../gh6909.php.testGH6909_Instance01.completion| 3 + .../gh6909.php.testGH6909_Instance02.completion| 3 + .../gh6909.php.testGH6909_Instance03.completion| 3 + .../gh6909.php.testGH6909_Instance04.completion| 3 + .../gh6909.php.testGH6909_Instance05.completion| 3 + .../gh6909.php.testGH6909_Instance06.completion| 3 + .../gh6909.php.testGH6909_Instance07.completion| 3 + php.testGH6909_InstanceReturnType01.completion | 6 ++ php.testGH6909_InstanceReturnType02.completion | 6 ++ .../gh6909.php.testGH6909_Static01.completion | 3 + .../gh6909.php.testGH6909_Static02.completion | 3 + .../gh6909.php.testGH6909_Static03.completion | 3 + .../gh6909.php.testGH6909_Static04.completion | 3 + .../gh6909.php.testGH6909_Static05.completion | 3 + .../gh6909.php.testGH6909_Static06.completion | 3 + ...09.php.testGH6909_StaticReturnType01.completion | 6 ++ ...09.php.testGH6909_StaticReturnType02.completion | 6 ++ .../testPHP83TypedClassConstants.php.indexed | 2 +- .../completion/PHPCodeCompletionGH6909Test.java| 117 + 22 files changed, 285 insertions(+), 11 deletions(-) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/VariousUtils.java b/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/VariousUtils.java index bd26a248fc..ca7cd2c704 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/VariousUtils.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/VariousUtils.java @@ -116,16 +116,18 @@ public final class VariousUtils { public static final String PRE_OPERATION_TYPE_DELIMITER = "@"; //NOI18N public static final String POST_OPERATION_TYPE_DELIMITER = ":"; //NOI18N public static final String POST_OPERATION_TYPE_DELIMITER_SUBS = "_POTD_"; //NOI18N -public static final String CONSTRUCTOR_TYPE_PREFIX = "constuct" + POST_OPERATION_TYPE_DELIMITER; //NOI18N -public static final String FUNCTION_TYPE_PREFIX = "fn" + POST_OPERATION_TYPE_DELIMITER; //NOI18N -public static final String METHOD_TYPE_PREFIX = "mtd" + POST_OPERATION_TYPE_DELIMITER; //NOI18N -public static final String STATIC_METHOD_TYPE_PREFIX = "static.mtd" + POST_OPERATION_TYPE_DELIMITER; //NOI18N -public static final String FIELD_TYPE_PREFIX = "fld" + POST_OPERATION_TYPE_DELIMITER; //NOI18N -public static final String STATIC_FIELD_TYPE_PREFIX = "static.fld" + POST_OPERATION_TYPE_DELIMITER; //NOI18N -public static final String STATIC_CONSTANT_TYPE_PREFIX = "static.constant" + POST_OPERATION_TYPE_DELIMITER; //NOI18N -public static final String VAR_TYPE_PREFIX = "var" + POST_OPERATION_TYPE_DELIMITER; //NOI18N -public static final String ARRAY_TYPE_PREFIX = "array" + POST_OPERATION_TYPE_DELIMITER; //NOI18N -public static final String TYPE_TYPE_PREFIX = "type" + POST_OPERATION_TYPE_DELIMITER; //NOI18N +// GH-6909 To avoid conflicting with member names, add "-type" suffix +// because "-" can not be contained to member names +public static final String CONSTRUCTOR_TYPE_PREFIX = "constuct-type" + POST_OPERATION_TYPE_DELIMITER; //NOI18N +public static final String FUNCTION_TYPE_PREFIX = "fn-type" + POST_OPERATION_TYPE_DELIMITER; //NOI18N +public static final String
(netbeans) branch master updated: Fix the named argument code completion for constructors
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 24ba6df45f Fix the named argument code completion for constructors new d81235cc25 Merge pull request #6911 from junichi11/php-named-argument-cc-for-constructor 24ba6df45f is described below commit 24ba6df45f395f1cbec9459526befa6f48345de9 Author: Junichi Yamamoto AuthorDate: Wed Jan 3 16:33:13 2024 +0900 Fix the named argument code completion for constructors - Show argument names in consturctors - Don't add `:` if an existing name has `:` (an improvement) e.g. ^maxLength: (^: caret) We are unsure whether a user expects to add or override an item in this context. So, just add a name. (i.e. don't add ":") This behavior is useful when the consuming completion(Ctrl + Enter) is used. - Add unit tests --- .../editor/completion/CompletionContextFinder.java | 4 +- .../php/editor/completion/PHPCodeCompletion.java | 79 -- .../php/editor/completion/PHPCompletionItem.java | 37 - .../namedArgumentsConstructor01.php| 25 ++ php.testNamedArgumentsConstructor01.completion | 92 + .../namedArgumentsConstructor02.php| 26 ++ ...hp.testNamedArgumentsConstructor02_a.completion | 6 ++ ...hp.testNamedArgumentsConstructor02_b.completion | 92 + .../namedArgumentsConstructor03.php| 25 ++ php.testNamedArgumentsConstructor03.completion | 92 + .../namedArgumentsConstructor04.php| 25 ++ php.testNamedArgumentsConstructor04.completion | 6 ++ .../namedArgumentsConstructor05.php| 26 ++ ...edArgumentsConstructor05_Template01.cccustomtpl | 2 + ...edArgumentsConstructor05_Template02.cccustomtpl | 2 + ...hp.testNamedArgumentsConstructor05_a.completion | 92 + ...hp.testNamedArgumentsConstructor05_b.completion | 92 + ...hp.testNamedArgumentsConstructor05_c.completion | 6 ++ .../namedArgumentsConstructor06.php| 33 php.testNamedArgumentsConstructor06.completion | 96 ++ .../editor/completion/PHP80CodeCompletionTest.java | 46 +++ .../completion/PHPCodeCompletionTestBase.java | 13 +++ 22 files changed, 888 insertions(+), 29 deletions(-) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/completion/CompletionContextFinder.java b/php/php.editor/src/org/netbeans/modules/php/editor/completion/CompletionContextFinder.java index 8babca1a2d..81c2724532 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/completion/CompletionContextFinder.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/completion/CompletionContextFinder.java @@ -235,7 +235,7 @@ final class CompletionContextFinder { HTML, CLASS_NAME, INTERFACE_NAME, BACKING_TYPE, TYPE_NAME, RETURN_TYPE_NAME, RETURN_UNION_OR_INTERSECTION_TYPE_NAME, FIELD_TYPE_NAME, CONST_TYPE_NAME, VISIBILITY_MODIFIER_OR_TYPE_NAME, STRING, CLASS_MEMBER, STATIC_CLASS_MEMBER, PHPDOC, INHERITANCE, EXTENDS, IMPLEMENTS, METHOD_NAME, -CLASS_MEMBER_PARAMETER_NAME, STATIC_CLASS_MEMBER_PARAMETER_NAME, FUNCTION_PARAMETER_NAME, +CLASS_MEMBER_PARAMETER_NAME, STATIC_CLASS_MEMBER_PARAMETER_NAME, FUNCTION_PARAMETER_NAME, CONSTRUCTOR_PARAMETER_NAME, CLASS_CONTEXT_KEYWORDS, SERVER_ENTRY_CONSTANTS, NONE, NEW_CLASS, GLOBAL, NAMESPACE_KEYWORD, GROUP_USE_KEYWORD, GROUP_USE_CONST_KEYWORD, GROUP_USE_FUNCTION_KEYWORD, USE_KEYWORD, USE_CONST_KEYWORD, USE_FUNCTION_KEYWORD, DEFAULT_PARAMETER_VALUE, OPEN_TAG, THROW, THROW_NEW, CATCH, CLASS_MEMBER_IN_STRING, @@ -1608,6 +1608,8 @@ final class CompletionContextFinder { retval = CompletionContext.CLASS_MEMBER_PARAMETER_NAME; } else if (acceptTokenChains(ts, STATIC_CLASS_MEMBER_TOKENCHAINS, true)) { retval = CompletionContext.STATIC_CLASS_MEMBER_PARAMETER_NAME; +} else if (acceptTokenChains(ts, CLASS_NAME_TOKENCHAINS, true)) { +retval = CompletionContext.CONSTRUCTOR_PARAMETER_NAME; } else { retval = CompletionContext.FUNCTION_PARAMETER_NAME; } 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 cc1039a784..4df5313c8a 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 @@ -57,6 +57,7 @@ import org.netbeans.modules.csl.spi.support.CancelSuppor
(netbeans) branch master updated: Add the `IncorrectStaticContextHintError` as a new hint #6703
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 aa919a41f0 Add the `IncorrectStaticContextHintError` as a new hint #6703 new 7c39099393 Merge pull request #6899 from junichi11/php-gh-6703-this-in-static-context aa919a41f0 is described below commit aa919a41f0a8151ca90f25c88c706970a68fcbbf Author: Junichi Yamamoto AuthorDate: Sun Dec 31 20:18:01 2023 +0900 Add the `IncorrectStaticContextHintError` as a new hint #6703 - https://github.com/apache/netbeans/issues/6703 - Show errors when `$this` is used in static context(static methods, static closures, static arrow functions) - Add unit tests Note: Check only $this in TypeDeclarations because Frameworks may use `$this` in the global scope. e.g. CakePHP framework can use `$this`(e.g. `$this->Html->link()`) in the global scope of view files. (see: https://book.cakephp.org/5/en/views.html) Example: ```php class Example { private int $field = 1; public static function staticMethod(): void { $this->field; // error } public function method(): void { $staticClosure = static function() { var_dump($this); // error }; $staticArrow = static fn() => $this; // error echo $this->field; } } ``` --- .../org/netbeans/modules/php/editor/CodeUtils.java | 1 + .../modules/php/editor/resources/layer.xml | 1 + .../IncorrectStaticContextHintError.java | 274 + .../testStaticClosureAndArrowFunctionInClass.php | 156 testStaticClosureAndArrowFunctionInClass.hints | 72 ++ .../testStaticClosureAndArrowFunctionInEnum.php| 115 + ...p.testStaticClosureAndArrowFunctionInEnum.hints | 54 .../testStaticClosureAndArrowFunctionInTrait.php | 117 + testStaticClosureAndArrowFunctionInTrait.hints | 54 .../testThisVariables.php | 76 ++ .../testThisVariables.php.testThisVariables.hints | 15 ++ .../IncorrectStaticContextHintErrorTest.java | 51 12 files changed, 986 insertions(+) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java b/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java index cfdadb5f43..03184cd436 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java @@ -94,6 +94,7 @@ public final class CodeUtils { public static final String OVERRIDE_ATTRIBUTE = "#[" + OVERRIDE_ATTRIBUTE_FQ_NAME + "]"; // NOI18N public static final String EMPTY_STRING = ""; // NOI18N public static final String NEW_LINE = "\n"; // NOI18N +public static final String THIS_VARIABLE = "$this"; // NOI18N public static final Pattern WHITE_SPACES_PATTERN = Pattern.compile("\\s+"); // NOI18N public static final Pattern SPLIT_TYPES_PATTERN = Pattern.compile("[()|&]+"); // NOI18N diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/resources/layer.xml b/php/php.editor/src/org/netbeans/modules/php/editor/resources/layer.xml index b3aecee689..e907da2c56 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/resources/layer.xml +++ b/php/php.editor/src/org/netbeans/modules/php/editor/resources/layer.xml @@ -433,6 +433,7 @@ + diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/verification/IncorrectStaticContextHintError.java b/php/php.editor/src/org/netbeans/modules/php/editor/verification/IncorrectStaticContextHintError.java new file mode 100644 index 00..00409bea05 --- /dev/null +++ b/php/php.editor/src/org/netbeans/modules/php/editor/verification/IncorrectStaticContextHintError.java @@ -0,0 +1,274 @@ +/* + * 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 implie
(netbeans) branch master updated (f5719ec986 -> e458d63e89)
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 f5719ec986 Merge pull request #6887 from mbien/jgit680 new 89555d4016 Improve magic methods generation new 73b894c09a Generate `__toString()` magic method with all fields #6783 new e458d63e89 Merge pull request #6896 from junichi11/php-gh-6783-tostring-method The 9508 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: php/php.api.phpmodule/manifest.mf | 2 +- .../org/netbeans/modules/php/api/PhpVersion.java | 11 ++ php/php.editor/nbproject/project.properties| 2 +- php/php.editor/nbproject/project.xml | 2 +- .../php/editor/api/elements/ParameterElement.java | 2 + .../modules/php/editor/codegen/CGSInfo.java| 22 ++-- .../modules/php/editor/codegen/MethodProperty.java | 47 .../codegen/SinglePropertyMethodCreator.java | 6 + .../php/editor/completion/PHPCompletionItem.java | 21 +++- .../elements/BaseFunctionElementSupport.java | 32 +- .../modules/php/editor/elements/ElementUtils.java | 36 ++ .../php/editor/elements/MethodElementImpl.java | 97 +--- .../php/editor/elements/ParameterElementImpl.java | 128 - .../modules/php/editor/model/impl/Type.java| 33 ++ .../editor/verification/IntroduceSuggestion.java | 4 +- .../testMagicMethodToString01.php | 27 + ...g01.php.testMagicMethodToString01_PHP83.codegen | 7 ++ .../testMagicMethodToString02.php | 37 ++ ...g02.php.testMagicMethodToString02_PHP83.codegen | 7 ++ .../testMagicMethods01/testMagicMethods01.php | 23 ...cMethods01.php.testMagicMethods01_PHP56.codegen | 35 ++ ...cMethods01.php.testMagicMethods01_PHP70.codegen | 35 ++ ...cMethods01.php.testMagicMethods01_PHP71.codegen | 35 ++ ...cMethods01.php.testMagicMethods01_PHP72.codegen | 35 ++ ...cMethods01.php.testMagicMethods01_PHP73.codegen | 35 ++ ...cMethods01.php.testMagicMethods01_PHP74.codegen | 35 ++ ...cMethods01.php.testMagicMethods01_PHP80.codegen | 35 ++ ...cMethods01.php.testMagicMethods01_PHP81.codegen | 35 ++ ...cMethods01.php.testMagicMethods01_PHP82.codegen | 35 ++ ...cMethods01.php.testMagicMethods01_PHP83.codegen | 35 ++ ...eEnum01.php.testOverrideAttributeEnum01.codegen | 6 +- ...1.php.testOverrideAttributeEnum01_PHP82.codegen | 6 +- ...php.testSerializeUnserializeMagicMethod.codegen | 4 +- .../insideClass.php.testInsideClass_2.completion | 15 +-- .../magicMethods.php | 23 ...estMagicMethodsCustomTemplate_PHP56.cccustomtpl | 84 ++ ...estMagicMethodsCustomTemplate_PHP70.cccustomtpl | 84 ++ ...estMagicMethodsCustomTemplate_PHP71.cccustomtpl | 84 ++ ...estMagicMethodsCustomTemplate_PHP72.cccustomtpl | 84 ++ ...estMagicMethodsCustomTemplate_PHP73.cccustomtpl | 84 ++ ...estMagicMethodsCustomTemplate_PHP74.cccustomtpl | 84 ++ ...estMagicMethodsCustomTemplate_PHP80.cccustomtpl | 84 ++ ...estMagicMethodsCustomTemplate_PHP81.cccustomtpl | 84 ++ ...estMagicMethodsCustomTemplate_PHP82.cccustomtpl | 84 ++ ...estMagicMethodsCustomTemplate_PHP83.cccustomtpl | 84 ++ .../testToStringCustomTemplate/toString01.php | 29 + ...testToStringCustomTemplate_01_PHP83.cccustomtpl | 8 ++ .../testToStringCustomTemplate/toString02.php | 37 ++ ...testToStringCustomTemplate_02_PHP83.cccustomtpl | 8 ++ ...ousClass01.php.testAnonymousClass01h.completion | 15 +-- ...lize.php.testSerializeUnserialize_01.completion | 15 +-- ...1.php.testReadonlyPropertiesTyping01.completion | 15 +-- .../issue209117.php.testUseCase1.completion| 15 +-- .../issue233756.php.testUseCase1.completion| 15 +-- .../SelectedPropertyMethodsCreatorTest.java| 96 .../PHPCodeCompletionMagicMethodTest.java | 119 +++ 56 files changed, 2047 insertions(+), 115 deletions(-) create mode 100644 php/php.editor/test/unit/data/testfiles/codegen/testMagicMethodToString01/testMagicMethodToString01.php create mode 100644 php/php.editor/test/unit/data/testfiles/codegen/testMagicMethodToString01/testMagicMethodToString01.php.testMagicMethodToString01_PHP83.codegen create mode 100644 php/php.editor/test/unit/data/testfiles/codegen/testMagicMethodToString02/testMagicMethodToString02.php create mode 100644 php/php.editor/test/unit/data/testfiles/codegen/testMagicMethodToString02/testM
(netbeans) branch master updated: PHP: New way to set the current breakpoint
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 b006691903 PHP: New way to set the current breakpoint new a34e57050b Merge pull request #6891 from troizet/php_improve_set_current_breakpoint b006691903 is described below commit b006691903e5d6188a9a176861782e12a305efb2 Author: Alexey Borokhvostov AuthorDate: Thu Dec 28 00:36:44 2023 +0700 PHP: New way to set the current breakpoint --- .../php/dbgp/breakpoints/BreakpointModel.java | 53 +++ .../php/dbgp/packets/FeatureGetCommand.java| 5 ++ .../php/dbgp/packets/FeatureSetResponse.java | 19 +++ .../modules/php/dbgp/packets/InitMessage.java | 5 ++ .../modules/php/dbgp/packets/MessageBuilder.java | 5 +- .../modules/php/dbgp/packets/RunResponse.java | 60 ++ .../modules/php/dbgp/packets/StackGetResponse.java | 2 +- 7 files changed, 137 insertions(+), 12 deletions(-) diff --git a/php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointModel.java b/php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointModel.java index e147d393f8..2125444d93 100644 --- a/php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointModel.java +++ b/php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointModel.java @@ -54,6 +54,7 @@ public class BreakpointModel extends ViewModelSupport implements NodeModel { private static final String EXCEPTION = "TXT_Exception"; // NOI18N private static final String PARENS = "()"; // NOI18N private final Map myCurrentBreakpoints; +private volatile boolean searchCurrentBreakpointById = false; public BreakpointModel() { myCurrentBreakpoints = new WeakHashMap<>(); @@ -179,21 +180,55 @@ public class BreakpointModel extends ViewModelSupport implements NodeModel { continue; } if (acceptor.accept(breakpoint)) { -AbstractBreakpoint abpnt = (AbstractBreakpoint) breakpoint; -synchronized (myCurrentBreakpoints) { -AbstractBreakpoint bpnt = myCurrentBreakpoints.get(session); -myCurrentBreakpoints.put(session, abpnt); -fireChangeEvents(new ModelEvent[]{ -new ModelEvent.NodeChanged(this, bpnt), -new ModelEvent.NodeChanged(this, abpnt) -}); -} +updateCurrentBreakpoint(session, breakpoint); return true; } } return false; } +public void setCurrentBreakpoint(DebugSession session, String id) { +Breakpoint[] breakpoints = DebuggerManager.getDebuggerManager().getBreakpoints(); +for (Breakpoint breakpoint : breakpoints) { +if (canSetCurrentBreakPoint(session, breakpoint, id)) { +updateCurrentBreakpoint(session, breakpoint); +break; +} +} +} + +private boolean canSetCurrentBreakPoint(DebugSession session, Breakpoint breakpoint, String id) { +if (Utils.isValid(breakpoint) && breakpoint instanceof AbstractBreakpoint) { +AbstractBreakpoint abstractBreakpoint = (AbstractBreakpoint) breakpoint; +if (abstractBreakpoint.isSessionRelated(session) +&& abstractBreakpoint.isEnabled() +&& abstractBreakpoint.getBreakpointId().equals(id)) { +return true; +} +} +return false; +} + +private void updateCurrentBreakpoint(DebugSession session, Breakpoint breakpoint) { +AbstractBreakpoint abpnt = (AbstractBreakpoint) breakpoint; +synchronized (myCurrentBreakpoints) { +AbstractBreakpoint bpnt = myCurrentBreakpoints.get(session); +myCurrentBreakpoints.put(session, abpnt); +fireChangeEvents(new ModelEvent[]{ +new ModelEvent.NodeChanged(this, bpnt), +new ModelEvent.NodeChanged(this, abpnt) +}); +} +} + +public void setSearchCurrentBreakpointById(boolean flag) { +searchCurrentBreakpointById = flag; +} + +public boolean isSearchCurrentBreakpointById() { +return searchCurrentBreakpointById; +} + private interface Acceptor { boolean accept(Breakpoint breakpoint); diff --git a/php/php.dbgp/src/org/netbeans/modules/php/dbgp/packets/FeatureGetCommand.java b/php/php.dbgp/src/org/netbeans/modules/php/dbgp/packets/FeatureGetCommand.java index a88c3f3daf..0fc28483c1 100644 --- a/php/php.dbgp/src/org/netbeans/modules/php/dbgp/packets/FeatureGetCommand.java +++ b/php/php.dbgp/src/org/netbeans/modules/php/
(netbeans) branch master updated: PHP: mark a breakpoint as broken when an error is received when breakpoint_set is executed to set a breakpoint
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 1cda8a74bf PHP: mark a breakpoint as broken when an error is received when breakpoint_set is executed to set a breakpoint new e8b206ef64 Merge pull request #6876 from troizet/php_mark_breakpoint_as_broken 1cda8a74bf is described below commit 1cda8a74bf464a16f4f3922c446d449eb120b211 Author: Alexey Borokhvostov AuthorDate: Sat Dec 23 17:50:08 2023 +0700 PHP: mark a breakpoint as broken when an error is received when breakpoint_set is executed to set a breakpoint --- .../modules/php/dbgp/annotations/BrkpntAnnotation.java | 4 ++-- .../modules/php/dbgp/breakpoints/AbstractBreakpoint.java | 4 .../modules/php/dbgp/breakpoints/BreakpointModel.java| 11 --- .../src/org/netbeans/modules/php/dbgp/breakpoints/Utils.java | 5 + .../netbeans/modules/php/dbgp/packets/BrkpntSetResponse.java | 12 5 files changed, 31 insertions(+), 5 deletions(-) diff --git a/php/php.dbgp/src/org/netbeans/modules/php/dbgp/annotations/BrkpntAnnotation.java b/php/php.dbgp/src/org/netbeans/modules/php/dbgp/annotations/BrkpntAnnotation.java index 4eadb8192a..6575796dae 100644 --- a/php/php.dbgp/src/org/netbeans/modules/php/dbgp/annotations/BrkpntAnnotation.java +++ b/php/php.dbgp/src/org/netbeans/modules/php/dbgp/annotations/BrkpntAnnotation.java @@ -20,6 +20,7 @@ package org.netbeans.modules.php.dbgp.annotations; import org.netbeans.api.debugger.Breakpoint; import org.netbeans.modules.php.dbgp.breakpoints.LineBreakpoint; +import org.netbeans.modules.php.dbgp.breakpoints.Utils; import org.netbeans.spi.debugger.ui.BreakpointAnnotation; import org.openide.text.Annotatable; import org.openide.util.NbBundle; @@ -41,8 +42,7 @@ public class BrkpntAnnotation extends BreakpointAnnotation { @Override public String getAnnotationType() { -Breakpoint.VALIDITY validity = breakpoint.getValidity(); -return validity == Breakpoint.VALIDITY.VALID || validity == Breakpoint.VALIDITY.UNKNOWN +return Utils.isValid(breakpoint) ? BREAKPOINT_ANNOTATION_TYPE : BREAKPOINT_ANNOTATION_TYPE + "_broken"; //NOI18N } diff --git a/php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/AbstractBreakpoint.java b/php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/AbstractBreakpoint.java index ba60765454..832dd66a4b 100644 --- a/php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/AbstractBreakpoint.java +++ b/php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/AbstractBreakpoint.java @@ -84,6 +84,10 @@ public abstract class AbstractBreakpoint extends Breakpoint { setValidity(VALIDITY.INVALID, null); } +public void setInvalid(String reason) { +setValidity(VALIDITY.INVALID, reason); +} + public void reset() { setValidity(VALIDITY.UNKNOWN, null); myId = null; diff --git a/php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointModel.java b/php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointModel.java index aea90c8684..e147d393f8 100644 --- a/php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointModel.java +++ b/php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointModel.java @@ -49,6 +49,7 @@ public class BreakpointModel extends ViewModelSupport implements NodeModel { public static final String CURRENT_LINE_CONDITIONAL_BREAKPOINT = "org/netbeans/modules/debugger/resources/breakpointsView/ConditionalBreakpointHit"; // NOI18N public static final String DISABLED_LINE_CONDITIONAL_BREAKPOINT = "org/netbeans/modules/debugger/resources/breakpointsView/DisabledConditionalBreakpoint"; // NOI18N public static final String BROKEN_LINE_BREAKPOINT = "org/netbeans/modules/debugger/resources/breakpointsView/Breakpoint_broken"; // NOI18N +public static final String BROKEN_BREAKPOINT = "org/netbeans/modules/debugger/resources/breakpointsView/NonLineBreakpoint_broken"; // NOI18N private static final String METHOD = "TXT_Method"; // NOI18N private static final String EXCEPTION = "TXT_Exception"; // NOI18N private static final String PARENS = "()"; // NOI18N @@ -99,8 +100,7 @@ public class BreakpointModel extends ViewModelSupport implements NodeModel { if (!breakpoint.isEnabled()) { return DISABLED_LINE_BREAKPOINT; } else { -VALIDITY validity = breakpoint.getValidity(); -if (validity.equals(VALIDITY.VALID) || validity.equals(VALIDITY.UNKNOWN)) { +if (Utils.isValid(breakpoint)) { return LINE_BREAKPOINT;
(netbeans) branch master updated: Fix the formatting for the method call arguments alignment option #6714
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 5f687eb28c Fix the formatting for the method call arguments alignment option #6714 new f4da2b4df3 Merge pull request #6877 from junichi11/php-gh-6714-formatting-for-alignment 5f687eb28c is described below commit 5f687eb28c5b46baf961bc0e6c33718c6cbfc400 Author: Junichi Yamamoto AuthorDate: Sun Dec 24 19:00:22 2023 +0900 Fix the formatting for the method call arguments alignment option #6714 - https://github.com/apache/netbeans/issues/6714 - Consider the TAB size when a column size is got Example: ```php array_merge( $x, $y, ); ``` Before: ```php array_merge( $x, $y, ); ``` After: ```php array_merge( $x, $y, ); ``` - Keep the last anchor to a stack when a method calls are nested Example: ```php nestedCall( something( $arg1, $arg2, C::something( $x, $y, $z, ) ), $y, $z, ); ``` Before: ```php nestedCall( something( $arg1, $arg2, C::something( $x, $y, $z, ) ), $y, $z, ); ``` After: ```php nestedCall( something( $arg1, $arg2, C::something( $x, $y, $z, ) ), $y, $z, ); ``` - Add unit tests --- .../modules/php/editor/indent/TokenFormatter.java | 29 -- .../testfiles/formatting/alignment/gh6714_01.php | 84 + ...h6714_01.php.testGH6714WithSpaces_01a.formatted | 84 + ...h6714_01.php.testGH6714WithSpaces_01b.formatted | 84 + .../gh6714_01.php.testGH6714WithTab_01a.formatted | 84 + .../gh6714_01.php.testGH6714WithTab_01b.formatted | 84 + .../testfiles/formatting/alignment/gh6714_02.php | 84 + ...h6714_02.php.testGH6714WithSpaces_02a.formatted | 84 + ...h6714_02.php.testGH6714WithSpaces_02b.formatted | 84 + .../gh6714_02.php.testGH6714WithTab_02a.formatted | 84 + .../gh6714_02.php.testGH6714WithTab_02b.formatted | 84 + .../editor/indent/PHPFormatterAlignmentTest.java | 102 + 12 files changed, 965 insertions(+), 6 deletions(-) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/indent/TokenFormatter.java b/php/php.editor/src/org/netbeans/modules/php/editor/indent/TokenFormatter.java index 4764316575..f834010651 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/indent/TokenFormatter.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/indent/TokenFormatter.java @@ -36,6 +36,7 @@ import org.netbeans.editor.Utilities; import org.netbeans.modules.csl.spi.GsfUtilities; import org.netbeans.modules.csl.spi.ParserResult; import org.netbeans.modules.editor.indent.spi.Context; +import org.netbeans.modules.php.editor.CodeUtils; import org.netbeans.modules.php.editor.lexer.LexUtilities; import org.netbeans.modules.php.editor.lexer.PHPTokenId; import org.netbeans.modules.php.editor.parser.PHPParseResult; @@ -455,7 +456,9 @@ public class TokenFormatter { int extraLines; int column = 0; int indentOfOpenTag = 0; +int methodCallParenBalance = 0; // GH-6714 for nested arguments final Deque lastBracedBlockIndent = new ArrayDeque<>(); +final Deque lastAnchorTokenStack = new ArrayDeque<>(); // GH-6714 for nested arguments FormatToken formatToken; String newText = null; @@ -1455,12 +1458,17 @@ public class TokenFormatter { } // NETBEANS-3391 if (isLeftParen(formatTokens.get(index - 1))) { +methodCallParenBalance++; if (hasNewLineWithinParensForward(index, formatTokens, forma
(netbeans) branch master updated (a9f577647c -> 2141d37d04)
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 a9f577647c Merge pull request #6870 from apache/emptyDatasourceName new 560777b21a Fix the Overriding Methods feature new 0a6df1e093 PHP 8.3 Support: Marking overridden methods (#[\Override]) (Part 1) new fd64377bed PHP 8.3 Support: Marking overridden methods (#[\Override]) (Part 2) new af05cd8aa6 Add the `getInterfaces()` method to the `TypeDeclaration` instead of the `getInterfaes()` new 2141d37d04 Merge pull request #6873 from junichi11/php83-marking-overridden-methods The 9488 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: php/php.api.phpmodule/manifest.mf | 2 +- .../org/netbeans/modules/php/api/PhpVersion.java | 11 + php/php.editor/nbproject/project.properties| 2 +- php/php.editor/nbproject/project.xml | 2 +- .../org/netbeans/modules/php/editor/CodeUtils.java | 5 + .../modules/php/editor/codegen/CGSInfo.java| 71 +- .../editor/codegen/InvocationContextResolver.java | 10 +- .../modules/php/editor/codegen/SemiAttribute.java | 6 +- .../codegen/SinglePropertyMethodCreator.java | 23 +- .../php/editor/completion/PHPCodeCompletion.java | 58 +- .../php/editor/completion/PHPCompletionItem.java | 23 +- .../php/editor/csl/OverridingMethodsImpl.java | 12 +- .../modules/php/editor/csl/SemanticAnalysis.java | 4 +- .../modules/php/editor/elements/ElementUtils.java | 46 ++ .../php/editor/elements/IndexQueryImpl.java| 10 +- .../php/editor/elements/MethodElementImpl.java | 34 +- .../php/editor/elements/TypeElementImpl.java | 4 +- .../modules/php/editor/indent/FormatVisitor.java | 12 +- .../php/editor/model/impl/OccurenceBuilder.java| 6 +- .../editor/model/nodes/ClassDeclarationInfo.java | 4 +- .../model/nodes/ClassInstanceCreationInfo.java | 9 +- .../editor/model/nodes/EnumDeclarationInfo.java| 4 +- .../model/nodes/InterfaceDeclarationInfo.java | 4 +- .../editor/parser/astnodes/ClassDeclaration.java | 4 +- .../editor/parser/astnodes/EnumDeclaration.java| 4 +- .../parser/astnodes/InterfaceDeclaration.java | 2 +- .../editor/parser/astnodes/TypeDeclaration.java| 16 +- .../parser/astnodes/visitors/DefaultVisitor.java | 6 +- .../modules/php/editor/resources/layer.xml | 1 + .../verification/AddOverrideAttributeHint.java | 730 + .../ImplementAbstractMethodsHintError.java | 5 +- .../verification/IncorrectEnumHintError.java | 4 +- .../structure/anonymousClassInClassScope.pass | 8 +- .../structure/anonymousClassInNamespaceScope.pass | 6 +- .../structure/anonymousClassInTraitScope.pass | 8 +- .../php80ConstructorPropertyPromotion.pass | 2 +- .../overriding/overridden/overridden_01.pass | 18 - .../overridden/testClass_01/testClass_01.pass | 17 + .../testInterface_01/testInterface_01.pass | 6 + .../overriding/overriding/overriding_01.pass | 16 - .../overriding/testClass_01/testClass_01.pass | 15 + .../testInterface_01/testInterface_01.pass | 15 + .../testOverrideAttribute01.php| 48 ++ ...Attribute01.php.testOverrideAttribute01.codegen | 38 ++ ...ute01.php.testOverrideAttribute01_PHP82.codegen | 26 + .../testOverrideAttributeAnonClass01.php | 48 ++ ...01.php.testOverrideAttributeAnonClass01.codegen | 38 ++ testOverrideAttributeAnonClass01_PHP82.codegen | 26 + .../testOverrideAttributeEnum01.php| 40 ++ ...eEnum01.php.testOverrideAttributeEnum01.codegen | 29 + ...1.php.testOverrideAttributeEnum01_PHP82.codegen | 22 + .../testOverrideAttribute01.php| 49 ++ ...ibute01.php.testOverrideAttribute01.cccustomtpl | 76 +++ ...1.php.testOverrideAttribute01_PHP82.cccustomtpl | 64 ++ .../testOverrideAttributeAnonClass01.php | 49 ++ ...hp.testOverrideAttributeAnonClass01.cccustomtpl | 76 +++ ...tOverrideAttributeAnonClass01_PHP82.cccustomtpl | 64 ++ .../testOverrideAttributeEnum01.php| 41 ++ ...m01.php.testOverrideAttributeEnum01.cccustomtpl | 46 ++ ...p.testOverrideAttributeEnum01_PHP82.cccustomtpl | 39 ++ ...stPHP80ConstructorPropertyPromotion.php.indexed | 2 +- .../overridden/{ => testClass_01}/ChildClass1.php | 0 .../overridden/{ => testClass_01}/ChildClass2.php | 7 + .../testClass_01.php} | 0 .../testInterface_01/ImplementingClass.php | 53 ++ .../testInterface_01/ImplementingEnum.php |
(netbeans) branch master updated: PHP: Fixing cancelability bugs by reverting from a for each loop to a normal loop
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 01ae879656 PHP: Fixing cancelability bugs by reverting from a for each loop to a normal loop new 589218b13c Merge pull request #6853 from troizet/php_cancelability_bug_hints 01ae879656 is described below commit 01ae879656b3b07a33ad00e68066faaf67fdb29b Author: Alexey Borokhvostov AuthorDate: Fri Dec 15 23:48:27 2023 +0700 PHP: Fixing cancelability bugs by reverting from a for each loop to a normal loop --- .../php/editor/verification/IncorrectNonAbstractMethodHintError.java | 4 ++-- .../netbeans/modules/php/editor/verification/PHP72UnhandledError.java | 4 ++-- .../netbeans/modules/php/editor/verification/PHP73UnhandledError.java | 4 ++-- .../netbeans/modules/php/editor/verification/PHP80UnhandledError.java | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/verification/IncorrectNonAbstractMethodHintError.java b/php/php.editor/src/org/netbeans/modules/php/editor/verification/IncorrectNonAbstractMethodHintError.java index a0441a979a..33dd250aa6 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/verification/IncorrectNonAbstractMethodHintError.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/verification/IncorrectNonAbstractMethodHintError.java @@ -85,13 +85,13 @@ public class IncorrectNonAbstractMethodHintError extends HintErrorRule { "IncorrectNonAbstractMethodHintErrorHintDesc=Non-abstract method \"{0}\" must contain body" }) private void addIcorrectNonAbstractMethodHints(Set methodDeclarations, List hints, BaseDocument doc) { -methodDeclarations.forEach((methodDeclaration) -> { +for (MethodDeclaration methodDeclaration: methodDeclarations) { if (CancelSupport.getDefault().isCancelled()) { return; } List fixes = Collections.singletonList(new AddBodyFix(doc, methodDeclaration)); addHint(methodDeclaration, Bundle.IncorrectNonAbstractMethodHintErrorHintDesc(CodeUtils.extractMethodName(methodDeclaration)), hints, fixes); -}); +} } private void addHint(ASTNode node, String description, List hints, List fixes) { diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP72UnhandledError.java b/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP72UnhandledError.java index ef7ee8936a..4187ed0e09 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP72UnhandledError.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP72UnhandledError.java @@ -115,7 +115,7 @@ public class PHP72UnhandledError extends UnhandledErrorRule { if (ts == null) { return; } -lastUseStatementParts.forEach((lastUseStatementPart) -> { +for (SingleUseStatementPart lastUseStatementPart: lastUseStatementParts) { if (CancelSupport.getDefault().isCancelled()) { return; } @@ -129,7 +129,7 @@ public class PHP72UnhandledError extends UnhandledErrorRule { createError(lastUseStatementPart); } } -}); +} } finally { document.readUnlock(); lastUseStatementParts.clear(); diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP73UnhandledError.java b/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP73UnhandledError.java index 0812932106..74a2fcb2bd 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP73UnhandledError.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP73UnhandledError.java @@ -161,7 +161,7 @@ public class PHP73UnhandledError extends UnhandledErrorRule { } private void checkFunctionCallTrailingCommas(TokenSequence ts) { -nodes.forEach((node) -> { +for (ASTNode node: nodes) { if (CancelSupport.getDefault().isCancelled()) { return; } @@ -183,7 +183,7 @@ public class PHP73UnhandledError extends UnhandledErrorRule { if (!parameters.isEmpty()) { createError(parameters.get(parameters.size() - 1)); } -}); +} } @CheckForNull diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP80UnhandledError.java b/php/php.editor/src/or
(netbeans) branch master updated (894d91bf68 -> 8d3e459b91)
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 894d91bf68 Merge pull request #6746 from jhorvath/vault-to-configmap new 4ca2b05414 Add the enum case icon new 1bb69e8099 Improve the code completion documentation for enum cases new 0770e4d207 Check an initializer of an enum case new 52127d6cc7 Improve the code completion for enum cases new 8d3e459b91 Merge pull request #6825 from junichi11/php-improve-enum-cases The 9434 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: php/php.editor/licenseinfo.xml |1 + php/php.editor/nbproject/project.properties|2 +- .../modules/php/editor/actions/IconsUtils.java | 53 +- .../php/editor/api/elements/EnumCaseElement.java |9 + .../modules/php/editor/completion/DocRenderer.java |6 + .../php/editor/completion/PHPCompletionItem.java | 23 +- .../modules/php/editor/csl/NavigatorScanner.java | 23 +- .../php/editor/elements/CaseElementImpl.java | 31 +- .../modules/php/editor/index/PHPIndexer.java |2 +- .../modules/php/editor/model/CaseElement.java |8 + .../php/editor/model/impl/CaseElementImpl.java | 18 +- .../modules/php/editor/parser/ASTPHP5Parser.java | 2751 +++ .../modules/php/editor/parser/ASTPHP5Symbols.java |2 +- .../php/editor/parser/EncodedActionTable1.java | 2568 +++--- .../php/editor/parser/EncodedActionTable10.java| 2684 +++ .../php/editor/parser/EncodedActionTable11.java| 2572 +++--- .../php/editor/parser/EncodedActionTable12.java| 1246 +++ .../php/editor/parser/EncodedActionTable13.java| 576 ++-- .../php/editor/parser/EncodedActionTable14.java| 1496 .../php/editor/parser/EncodedActionTable15.java| 488 +-- .../php/editor/parser/EncodedActionTable16.java| 934 ++--- .../php/editor/parser/EncodedActionTable17.java| 1784 +- .../php/editor/parser/EncodedActionTable18.java| 274 +- .../php/editor/parser/EncodedActionTable19.java| 420 +-- .../php/editor/parser/EncodedActionTable2.java | 1692 +- .../php/editor/parser/EncodedActionTable20.java| 538 +-- .../php/editor/parser/EncodedActionTable3.java | 1086 +++--- .../php/editor/parser/EncodedActionTable4.java | 3562 ++-- .../php/editor/parser/EncodedActionTable5.java | 3192 +- .../php/editor/parser/EncodedActionTable6.java | 1774 +- .../php/editor/parser/EncodedActionTable7.java | 2326 ++--- .../php/editor/parser/EncodedActionTable8.java | 1038 +++--- .../php/editor/parser/EncodedActionTable9.java | 1042 +++--- .../modules/php/editor/resources/enumCase.png | Bin 0 -> 1389 bytes .../verification/IncorrectEnumHintError.java | 137 +- .../structure/enumCasesWithError01.pass|4 + .../structure/enumCasesWithError02.pass|5 + .../parser/php81/enumCasesWithError.pass | 143 + .../completion/documentation/php81/enumCases.php} | 29 +- .../enumCases.php.testBackedEnumCaseInt_01.html|7 + .../enumCases.php.testBackedEnumCaseInt_02.html|7 + .../enumCases.php.testBackedEnumCaseInt_03.html|7 + .../enumCases.php.testBackedEnumCaseString_01.html |7 + .../enumCases.php.testBackedEnumCaseString_02.html |7 + .../enumCases.php.testBackedEnumCaseString_03.html |7 + .../php81/enumCases.php.testEnumCase_01.html |7 + .../php81/enumCases.php.testEnumCase_02.html |7 + .../testEnumCasesTyping01/enumCasesTyping01.php} | 15 +- ...esTyping01.php.testEnumCasesTyping01.completion |7 + .../testEnumCasesTyping02/enumCasesTyping02.php} | 15 +- ...esTyping02.php.testEnumCasesTyping02.completion |4 + .../testEnumCasesTyping03/enumCasesTyping03.php} | 15 +- ...esTyping03.php.testEnumCasesTyping03.completion |8 + .../testEnums/enums.php.testEnums_01.completion|4 +- .../testEnums/enums.php.testEnums_02.completion|4 +- .../testEnums/enums.php.testEnums_03.completion|4 +- .../testEnums/enums.php.testEnums_04.completion|4 +- .../testEnums/enums.php.testEnums_05.completion|4 +- .../testEnums/enums.php.testEnums_10.completion|4 +- .../testEnums/enums.php.testEnums_12.completion|4 +- .../testEnums/enums.php.testEnums_13.completion|4 +- .../testEnums/enums.php.testEnums_15.completion|4 +- .../testEnums/enums.php.testEnums_17.completion|2 +- .../testEnums/enums.php.testEnums_22.completion|4 +- .../testEnums/enums.php.
(netbeans) 01/01: Merge pull request #6819 from apache/php-nb21-features
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 commit 120f2129a8dbc25b7a52542c359fe5a7a2569c60 Merge: a450a2f24b 480ad74e9b Author: Junichi Yamamoto AuthorDate: Sat Dec 9 08:32:26 2023 +0900 Merge pull request #6819 from apache/php-nb21-features PHP features for NB21 php/php.api.phpmodule/manifest.mf |2 +- .../org/netbeans/modules/php/api/PhpVersion.java | 18 + php/php.editor/nbproject/project.properties|2 +- php/php.editor/nbproject/project.xml |2 +- .../org/netbeans/modules/php/editor/CodeUtils.java | 98 +- .../modules/php/editor/api/QualifiedName.java | 10 +- .../php/editor/api/elements/AliasedFunction.java |5 + .../editor/api/elements/BaseFunctionElement.java |6 + .../php/editor/api/elements/FieldElement.java |1 + .../php/editor/api/elements/ParameterElement.java |4 + .../editor/api/elements/TypeConstantElement.java | 13 +- .../editor/completion/CompletionContextFinder.java | 175 +- .../modules/php/editor/completion/DocRenderer.java | 120 +- .../php/editor/completion/PHPCodeCompletion.java | 137 +- .../php/editor/completion/PHPCompletionItem.java | 11 +- .../php/editor/csl/DeclarationFinderImpl.java | 48 +- .../modules/php/editor/csl/NavigatorScanner.java | 107 +- .../modules/php/editor/csl/SemanticAnalysis.java | 14 +- .../elements/BaseFunctionElementSupport.java | 101 +- .../php/editor/elements/ClassElementImpl.java | 48 +- .../php/editor/elements/FieldElementImpl.java | 32 +- .../php/editor/elements/FunctionElementImpl.java | 20 + .../php/editor/elements/IndexQueryImpl.java|6 +- .../php/editor/elements/MethodElementImpl.java | 44 +- .../php/editor/elements/ParameterElementImpl.java | 75 +- .../php/editor/elements/TraitElementImpl.java | 15 +- .../editor/elements/TypeConstantElementImpl.java | 47 +- .../php/editor/elements/TypeResolverImpl.java |4 +- .../modules/php/editor/indent/CodeStyle.java |4 + .../modules/php/editor/indent/FmtOptions.java |2 + .../modules/php/editor/indent/FormatToken.java |3 + .../modules/php/editor/indent/FormatVisitor.java | 63 +- .../modules/php/editor/indent/TokenFormatter.java | 13 + .../modules/php/editor/indent/ui/Bundle.properties |5 +- .../modules/php/editor/indent/ui/FmtSpaces.java|1 + .../modules/php/editor/index/PHPIndexer.java |2 +- .../modules/php/editor/lexer/LexUtilities.java | 13 +- .../php/editor/lexer/PHP5ColoringLexer.java| 2692 +++ .../php/editor/model/ClassConstantElement.java | 12 +- .../modules/php/editor/model/FunctionScope.java|1 + .../modules/php/editor/model/Parameter.java|6 + .../model/impl/ClassConstantElementImpl.java | 15 +- .../php/editor/model/impl/ClassScopeImpl.java | 22 +- .../php/editor/model/impl/FieldElementImpl.java| 13 +- .../php/editor/model/impl/FunctionScopeImpl.java | 93 +- .../php/editor/model/impl/MethodScopeImpl.java |7 + .../php/editor/model/impl/ModelVisitor.java| 134 +- .../php/editor/model/impl/OccurenceBuilder.java|9 +- .../php/editor/model/impl/ParameterImpl.java | 33 +- .../modules/php/editor/model/impl/Type.java| 52 +- .../php/editor/model/impl/VariousUtils.java| 77 +- .../model/nodes/ClassConstantDeclarationInfo.java |6 + .../editor/model/nodes/FormalParameterInfo.java| 19 +- .../model/nodes/FunctionDeclarationInfo.java |3 +- .../model/nodes/LambdaFunctionDeclarationInfo.java |2 +- .../model/nodes/MagicMethodDeclarationInfo.java| 25 +- .../editor/model/nodes/MethodDeclarationInfo.java |3 +- .../model/nodes/SingleFieldDeclarationInfo.java| 21 +- .../modules/php/editor/parser/ASTPHP5Parser.java | 3815 +- .../modules/php/editor/parser/ASTPHP5Scanner.java | 316 +- .../modules/php/editor/parser/ASTPHP5Symbols.java |2 +- .../php/editor/parser/EncodedActionTable1.java | 6076 .../php/editor/parser/EncodedActionTable10.java| 6626 +- .../php/editor/parser/EncodedActionTable11.java| 6924 +- .../php/editor/parser/EncodedActionTable12.java| 6430 - .../php/editor/parser/EncodedActionTable13.java| 5046 ++--- .../php/editor/parser/EncodedActionTable14.java| 5530 +++ .../php/editor/parser/EncodedActionTable15.java| 5822 +++ .../php/editor/parser/EncodedActionTable16.java| 6160 .../php/editor/parser/EncodedActionTable17.java| 6726 +- .../php/editor/parser/EncodedActionTable18.java| 4944 ++--- .../php/editor/parser/EncodedActionTable19
(netbeans) branch php-nb21-features updated (16b9fc1287 -> 480ad74e9b)
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a change to branch php-nb21-features in repository https://gitbox.apache.org/repos/asf/netbeans.git from 16b9fc1287 Merge pull request #6752 from junichi11/php83-dynamic-class-constant-fetch new 80e1feed1f PHP 8.3 Support: Typed class constants (Part 1) new 0da18dbb94 PHP 8.3 Support: Typed class constants (Part 2) new 04b0434004 PHP 8.3 Support: Typed class constants (Part 3) new 43b8cebc75 PHP 8.3 Support: Typed class constants (Part 4) new be57ef0ad6 PHP 8.3 Support: Typed class constants (Part 5) new 450cb2075a PHP 8.3 Support: Typed class constants (Part 6) new 480ad74e9b Merge pull request #6793 from junichi11/php83-typed-class-constants The 9317 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: php/php.editor/nbproject/project.properties|2 +- .../editor/api/elements/TypeConstantElement.java | 13 +- .../editor/completion/CompletionContextFinder.java | 139 +- .../php/editor/completion/PHPCodeCompletion.java | 134 +- .../php/editor/completion/PHPCompletionItem.java |5 +- .../modules/php/editor/csl/NavigatorScanner.java | 10 +- .../editor/elements/TypeConstantElementImpl.java | 47 +- .../modules/php/editor/indent/FormatToken.java |1 + .../modules/php/editor/indent/FormatVisitor.java | 21 +- .../modules/php/editor/indent/TokenFormatter.java |4 + .../modules/php/editor/index/PHPIndexer.java |2 +- .../php/editor/lexer/PHP5ColoringLexer.java| 2692 .../php/editor/model/ClassConstantElement.java | 12 +- .../model/impl/ClassConstantElementImpl.java | 15 +- .../php/editor/model/impl/ModelVisitor.java| 38 +- .../modules/php/editor/model/impl/Type.java| 10 + .../php/editor/model/impl/VariousUtils.java| 18 + .../model/nodes/ClassConstantDeclarationInfo.java |6 + .../model/nodes/SingleFieldDeclarationInfo.java| 21 +- .../modules/php/editor/parser/ASTPHP5Parser.java | 1850 ++--- .../modules/php/editor/parser/ASTPHP5Symbols.java |2 +- .../php/editor/parser/EncodedActionTable1.java | 5764 .../php/editor/parser/EncodedActionTable10.java| 5716 .../php/editor/parser/EncodedActionTable11.java| 6640 +- .../php/editor/parser/EncodedActionTable12.java| 6272 - .../php/editor/parser/EncodedActionTable13.java| 5836 .../php/editor/parser/EncodedActionTable14.java| 5980 .../php/editor/parser/EncodedActionTable15.java| 5474 +++ .../php/editor/parser/EncodedActionTable16.java| 6430 +- .../php/editor/parser/EncodedActionTable17.java| 7050 +-- .../php/editor/parser/EncodedActionTable18.java| 4938 +++--- .../php/editor/parser/EncodedActionTable19.java| 4909 +++-- .../php/editor/parser/EncodedActionTable2.java | 5356 +++ ...ctionTable19.java => EncodedActionTable20.java} | 769 ++- .../php/editor/parser/EncodedActionTable3.java | 7186 ++-- .../php/editor/parser/EncodedActionTable4.java | 4680 ++--- .../php/editor/parser/EncodedActionTable5.java | 5952 .../php/editor/parser/EncodedActionTable6.java | 4614 ++--- .../php/editor/parser/EncodedActionTable7.java | 5406 +++ .../php/editor/parser/EncodedActionTable8.java | 3950 +-- .../php/editor/parser/EncodedActionTable9.java | 6064 - .../parser/astnodes/ConstantDeclaration.java | 60 +- .../parser/astnodes/visitors/DefaultVisitor.java |1 + .../php/editor/resources/code-templates.xml| 12 + .../editor/verification/PHP83UnhandledError.java | 13 + .../verification/UnusableTypesHintError.java | 25 +- .../structure/php83/typedClassConstants.pass | 43 + .../context_sensitive_lexer_typed_const_class.pass | 1358 .../context_sensitive_lexer_typed_const_enum.pass | 1358 ...text_sensitive_lexer_typed_const_interface.pass | 1358 .../context_sensitive_lexer_typed_const_trait.pass | 1358 .../parser/php83/typedClassConstants_01.pass | 1953 ++ ...ss.php.testTypedProperties20Class_08.completion |9 - testTypedProperties20Class_08_php73.completion | 11 - ...ss.php.testTypedProperties20Class_18.completion | 26 +- ...it.php.testTypedProperties20Trait_08.completion |9 - testTypedProperties20Trait_08_php73.completion | 11 - ...it.php.testTypedProperties20Trait_19.completion | 25 +- testConstructorPropertyPromoti
(netbeans) branch php-nb21-features updated (0b3757be9b -> 16b9fc1287)
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a change to branch php-nb21-features in repository https://gitbox.apache.org/repos/asf/netbeans.git from 0b3757be9b Merge pull request #6712 from junichi11/php-gh-3933-6634-improve-gotodecl new bbbe151af8 PHP 8.3 Support: Add PHP 8.3 to the PhpVersion new ad66f6e0a8 PHP 8.3 Support: Dynamic class constant fetch (Part 1) new 9e9672a272 PHP 8.3 Support: Dynamic class constant fetch (Part 2) new 9635c49673 PHP 8.3 Support: Dynamic class constant fetch (Part 3) new 1571f5c055 PHP 8.3 Support: Dynamic class constant fetch (Part 4) new 7e705639b1 PHP 8.3 Support: Dynamic class constant fetch (Part 5) new 16b9fc1287 Merge pull request #6752 from junichi11/php83-dynamic-class-constant-fetch The 9310 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: php/php.api.phpmodule/manifest.mf |2 +- .../org/netbeans/modules/php/api/PhpVersion.java |7 + php/php.editor/nbproject/project.properties|2 +- php/php.editor/nbproject/project.xml |2 +- .../editor/completion/CompletionContextFinder.java | 36 +- .../php/editor/completion/PHPCodeCompletion.java |3 +- .../modules/php/editor/csl/SemanticAnalysis.java | 14 +- .../modules/php/editor/indent/CodeStyle.java |4 + .../modules/php/editor/indent/FmtOptions.java |2 + .../modules/php/editor/indent/FormatToken.java |2 + .../modules/php/editor/indent/FormatVisitor.java | 26 + .../modules/php/editor/indent/TokenFormatter.java |9 + .../modules/php/editor/indent/ui/Bundle.properties |5 +- .../modules/php/editor/indent/ui/FmtSpaces.java|1 + .../php/editor/model/impl/ModelVisitor.java| 19 +- .../php/editor/model/impl/OccurenceBuilder.java|3 +- .../php/editor/model/impl/VariousUtils.java| 18 +- .../modules/php/editor/parser/ASTPHP5Parser.java | 3087 + .../modules/php/editor/parser/ASTPHP5Symbols.java |2 +- .../php/editor/parser/EncodedActionTable1.java | 3966 +-- .../php/editor/parser/EncodedActionTable10.java| 6158 - .../php/editor/parser/EncodedActionTable11.java| 6506 +- .../php/editor/parser/EncodedActionTable12.java| 5302 +++ .../php/editor/parser/EncodedActionTable13.java| 5988 - .../php/editor/parser/EncodedActionTable14.java| 5814 .../php/editor/parser/EncodedActionTable15.java| 5608 .../php/editor/parser/EncodedActionTable16.java| 6950 ++-- .../php/editor/parser/EncodedActionTable17.java| 4750 ++--- .../php/editor/parser/EncodedActionTable18.java| 5600 .../php/editor/parser/EncodedActionTable19.java| 2012 +- .../php/editor/parser/EncodedActionTable2.java | 1234 ++-- .../php/editor/parser/EncodedActionTable3.java | 3234 - .../php/editor/parser/EncodedActionTable4.java | 4402 ++--- .../php/editor/parser/EncodedActionTable5.java | 3736 +-- .../php/editor/parser/EncodedActionTable6.java | 5986 - .../php/editor/parser/EncodedActionTable7.java | 4454 ++--- .../php/editor/parser/EncodedActionTable8.java | 4100 ++-- .../php/editor/parser/EncodedActionTable9.java | 5704 .../editor/parser/astnodes/ReflectionVariable.java |6 +- .../parser/astnodes/StaticConstantAccess.java | 32 +- .../modules/php/editor/resources/layer.xml |1 + .../editor/verification/IntroduceSuggestion.java |5 +- .../editor/verification/PHP55UnhandledError.java | 15 +- ...nhandledError.java => PHP83UnhandledError.java} | 111 +- .../ASTPHP5ParserTest/parser/TrueFalseNull.pass|6 +- .../parser/constantArrayAccess_01.pass | 16 +- .../parser/constantScalarExpressions_01.pass |8 +- .../parser/ASTPHP5ParserTest/parser/gh4684.pass|6 +- .../ASTPHP5ParserTest/parser/heredoc_011.pass |2 +- .../ASTPHP5ParserTest/parser/issue258959.pass | 16 +- .../ASTPHP5ParserTest/parser/nowdoc_011.pass |2 +- .../parser/php74/arrowFunctions_01.pass|2 +- .../php74/spreadOperatorInArrayExpression_02.pass | 14 +- .../parser/php80/attributeSyntax_01.pass |2 +- .../parser/php80/attributeSyntax_03.pass |2 +- .../parser/php80/classNameLiteralOnObjects_01.pass | 18 +- .../parser/php80/matchExpression_04.pass |8 +- .../parser/php80/nullsafeOperator_01.pass |2 +- .../parser/php80/nullsafeOperator_02.pass |2 +- .../parser/php
(netbeans) branch php-nb21-features updated: Improve the performance for Go to Declaration
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a commit to branch php-nb21-features in repository https://gitbox.apache.org/repos/asf/netbeans.git The following commit(s) were added to refs/heads/php-nb21-features by this push: new de1f2ed5d5 Improve the performance for Go to Declaration new 0b3757be9b Merge pull request #6712 from junichi11/php-gh-3933-6634-improve-gotodecl de1f2ed5d5 is described below commit de1f2ed5d55c0db545d905ea98064585566726b6 Author: Junichi Yamamoto AuthorDate: Fri Nov 17 12:07:07 2023 +0900 Improve the performance for Go to Declaration - https://github.com/apache/netbeans/issues/3933 - https://github.com/apache/netbeans/issues/6634 - Don't add empty type names to avoid getting types from an index using them --- .../org/netbeans/modules/php/editor/CodeUtils.java | 1 + .../php/editor/elements/ClassElementImpl.java | 48 ++ .../php/editor/elements/IndexQueryImpl.java| 6 ++- .../php/editor/elements/TraitElementImpl.java | 15 --- .../php/editor/model/impl/ClassScopeImpl.java | 22 +++--- .../php/editor/model/impl/OccurenceBuilder.java| 6 ++- .../modules/php/editor/parser/api/Utils.java | 17 +--- 7 files changed, 91 insertions(+), 24 deletions(-) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java b/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java index 6d39d06511..cf6488e7e3 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java @@ -93,6 +93,7 @@ public final class CodeUtils { public static final Pattern WHITE_SPACES_PATTERN = Pattern.compile("\\s+"); // NOI18N public static final Pattern SPLIT_TYPES_PATTERN = Pattern.compile("[()|&]+"); // NOI18N public static final Pattern TYPE_NAMES_IN_TYPE_DECLARATION_PATTERN = Pattern.compile("[^?()|&]+"); // NOI18N +public static final Pattern COMMA_PATTERN = Pattern.compile(","); // NOI18N private static final Logger LOGGER = Logger.getLogger(CodeUtils.class.getName()); diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/elements/ClassElementImpl.java b/php/php.editor/src/org/netbeans/modules/php/editor/elements/ClassElementImpl.java index f2ea7fcf98..cc76f0c792 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/elements/ClassElementImpl.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/elements/ClassElementImpl.java @@ -25,6 +25,7 @@ import java.util.HashSet; import java.util.Set; import java.util.StringTokenizer; import org.netbeans.api.annotations.common.CheckForNull; +import org.netbeans.api.annotations.common.NullAllowed; import org.netbeans.modules.parsing.spi.indexing.support.IndexResult; import org.netbeans.modules.php.api.editor.PhpClass; import org.netbeans.modules.php.editor.CodeUtils; @@ -47,8 +48,10 @@ import org.openide.util.Parameters; * @author Radek Matous */ public final class ClassElementImpl extends TypeElementImpl implements ClassElement { + public static final String IDX_FIELD = PHPIndexer.FIELD_CLASS; +@NullAllowed private final QualifiedName superClass; private final Collection possibleFQSuperClassNames; private final Collection fqMixinClassNames; @@ -72,6 +75,28 @@ public final class ClassElementImpl extends TypeElementImpl implements ClassElem this.possibleFQSuperClassNames = possibleFQSuperClassNames; this.usedTraits = usedTraits; this.fqMixinClassNames = fqMixinClassNames; +checkTypeNames(); +} + +private void checkTypeNames() { +// GH-6634 +// avoid getting types from the index with an empty string +boolean checkEnabled = false; +assert checkEnabled = true; +if (checkEnabled) { +if (superClass != null) { +assert !superClass.getName().isEmpty(); +} +for (QualifiedName name : possibleFQSuperClassNames) { +assert !name.getName().isEmpty(); +} +for (QualifiedName usedTrait : usedTraits) { +assert !usedTrait.getName().isEmpty(); +} +for (QualifiedName className : fqMixinClassNames) { +assert !className.getName().isEmpty(); +} +} } public static Set fromSignature(final IndexQueryImpl indexScopeQuery, final IndexResult indexResult) { @@ -81,7 +106,7 @@ public final class ClassElementImpl extends TypeElementImpl implements ClassElem public static Set fromSignature(final NameKind query, final IndexQueryImpl indexScopeQuery, final IndexResult indexResult) { String[] values = indexResult.getValues(IDX_FIELD); -Set retval = values.length > 0 ? new HashSet() : Collections.emptyS
(netbeans) branch php-nb21-features updated: Fix incorrect indentation behavior #6731
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a commit to branch php-nb21-features in repository https://gitbox.apache.org/repos/asf/netbeans.git The following commit(s) were added to refs/heads/php-nb21-features by this push: new dd68f675ab Fix incorrect indentation behavior #6731 new e91ac6221d Merge pull request #6738 from junichi11/php-gh-6731-incorrect-indent dd68f675ab is described below commit dd68f675abe3be2950364f9bcb1f48a6a70b6237 Author: Junichi Yamamoto AuthorDate: Wed Nov 22 12:10:48 2023 +0900 Fix incorrect indentation behavior #6731 - https://github.com/apache/netbeans/issues/6731 - When a multi-line parameter of a function/method invocation has a string with a variable(e.g. `"example {$example}"`), ignore the variable within the string(i.e. {$example}) to avoid adding extra indentations Example: ```php $x = test( "test {$test}" );// enter key here ``` Before: ```php $x = test( "test {$test}" ); // one indentation is added ``` After: ```php $x = test( "test {$test}" ); // no indentation ``` --- .../modules/php/editor/lexer/LexUtilities.java | 13 -- .../test/unit/data/testfiles/indent/gh6731_01.php | 23 + .../data/testfiles/indent/gh6731_01.php.indented | 24 ++ .../test/unit/data/testfiles/indent/gh6731_02.php | 23 + .../data/testfiles/indent/gh6731_02.php.indented | 24 ++ .../test/unit/data/testfiles/indent/gh6731_03.php | 21 .../data/testfiles/indent/gh6731_03.php.indented | 22 .../test/unit/data/testfiles/indent/gh6731_04.php | 27 .../data/testfiles/indent/gh6731_04.php.indented | 28 + .../test/unit/data/testfiles/indent/gh6731_05.php | 28 + .../data/testfiles/indent/gh6731_05.php.indented | 29 ++ .../test/unit/data/testfiles/indent/gh6731_06.php | 28 + .../data/testfiles/indent/gh6731_06.php.indented | 29 ++ .../test/unit/data/testfiles/indent/gh6731_07.php | 28 + .../data/testfiles/indent/gh6731_07.php.indented | 29 ++ .../php/editor/indent/PHPNewLineIndenterTest.java | 28 + 16 files changed, 402 insertions(+), 2 deletions(-) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/lexer/LexUtilities.java b/php/php.editor/src/org/netbeans/modules/php/editor/lexer/LexUtilities.java index 009abedf4f..c00a2999eb 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/lexer/LexUtilities.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/lexer/LexUtilities.java @@ -507,6 +507,7 @@ public final class LexUtilities { Token token; int balance = 0; int curlyBalance = 0; +boolean isInQuotes = false; // GH-6731 for checking a variable in string do { token = ts.token(); if (token.id() == PHPTokenId.PHP_TOKEN) { @@ -520,6 +521,14 @@ public final class LexUtilities { default: //no-op } +} else if (token.id() == PHPTokenId.PHP_CONSTANT_ENCAPSED_STRING) { +// GH-6731 for checking a variable in string +// e.g. "example {$example}" +if ((token.text().length() == 1 && TokenUtilities.textEquals(token.text(), "\"")) // NOI18N +|| (!TokenUtilities.startsWith(token.text(), "\"") && TokenUtilities.endsWith(token.text(), "\"")) // NOI18N +|| (TokenUtilities.startsWith(token.text(), "\"") && !TokenUtilities.endsWith(token.text(), "\""))) { // NOI18N +isInQuotes = !isInQuotes; +} } else if ((token.id() == PHPTokenId.PHP_SEMICOLON || token.id() == PHPTokenId.PHP_OPENTAG) && ts.moveNext()) { // we found previous end of expression => find begin of the current. @@ -584,7 +593,7 @@ public final class LexUtilities { break; } else if (token.id() == PHPTokenId.PHP_CURLY_CLOSE) { curlyBalance--; -if (curlyBalance == -1 && ts.moveNext()) { +if (!isInQuotes && curlyBalance == -1 && ts.moveNext()) { // we are after previous blog close LexUtilities.findNext(ts, Arrays.asList( PHPTokenId.WHITESPACE, @@ -600,7 +609,7 @@ public final class LexUtilities { } } else if (token.id() == PHPTo
(netbeans) branch php-nb21-features updated: Fix the formatting for a method invocation with a ternary or null-coalescing operator #5380
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a commit to branch php-nb21-features in repository https://gitbox.apache.org/repos/asf/netbeans.git The following commit(s) were added to refs/heads/php-nb21-features by this push: new 76d2feab8a Fix the formatting for a method invocation with a ternary or null-coalescing operator #5380 new d3ebc8be92 Merge pull request #6724 from junichi11/php-gh-5380-ternary-formatting 76d2feab8a is described below commit 76d2feab8adca311184866f81723d7e1b8566576 Author: Junichi Yamamoto AuthorDate: Sun Nov 19 11:12:45 2023 +0900 Fix the formatting for a method invocation with a ternary or null-coalescing operator #5380 - https://github.com/apache/netbeans/issues/5380 - Add whitespaces after `UNBREAKABLE_SEQUENCE_END` token - Check whether there is a whitespace token before an indent token - Add unit tests --- .../modules/php/editor/indent/FormatVisitor.java | 11 ++ .../formatting/broken/issue197074_04.php.formatted | 6 +++--- .../data/testfiles/formatting/spaces/gh5380_01.php | 23 + .../spaces/gh5380_01.php.testGH5380_01a.formatted | 24 ++ .../spaces/gh5380_01.php.testGH5380_01b.formatted | 24 ++ .../data/testfiles/formatting/spaces/gh5380_02.php | 23 + .../spaces/gh5380_02.php.testGH5380_02a.formatted | 24 ++ .../spaces/gh5380_02.php.testGH5380_02b.formatted | 24 ++ .../php/editor/indent/PHPFormatterSpacesTest.java | 23 + 9 files changed, 179 insertions(+), 3 deletions(-) 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 2913ec7a66..caa0d307c9 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 @@ -3133,6 +3133,17 @@ public class FormatVisitor extends DefaultVisitor { removedWS = formatTokens.remove(formatTokens.size() - 1); index--; lastToken = formatTokens.get(index); +} else if (lastToken.getId() == FormatToken.Kind.INDENT) { +// GH-5380 there are whitespaces before ")" in the method invocation with ternary or null-coalescing operator +// e.g. var_dump($a ? 1 : 2 ); var_dump($a ?? null); +if (index - 1 > 0) { +FormatToken possibleWSToken = formatTokens.get(index -1); +if (possibleWSToken.isWhitespace()) { +removedWS = formatTokens.remove(index - 1); +index -= 2; +lastToken = formatTokens.get(index); +} +} } if (lastToken.getId() == FormatToken.Kind.WHITESPACE_AFTER_COMMA) { diff --git a/php/php.editor/test/unit/data/testfiles/formatting/broken/issue197074_04.php.formatted b/php/php.editor/test/unit/data/testfiles/formatting/broken/issue197074_04.php.formatted index 49243bbd16..85edae3adc 100644 --- a/php/php.editor/test/unit/data/testfiles/formatting/broken/issue197074_04.php.formatted +++ b/php/php.editor/test/unit/data/testfiles/formatting/broken/issue197074_04.php.formatted @@ -72,10 +72,10 @@ if ($request->isMethod('post') && $form->bindAndValid($request)) { $module_action = $this->getPage()->getModuleAction(); if ($module_action == 'main/editCompanyAddress') -$ -this->redirect ($this->getHelper()->link('main/editMyCompany')->getHref()); +$t +his->redirect ($this->getHelper()->link('main/editMyCompany')->getHref()); } -$this->forms['CompanyAddresses '] = $form; +$this->forms['CompanyAddresses '] = $form; } diff --git a/php/php.editor/test/unit/data/testfiles/formatting/spaces/gh5380_01.php b/php/php.editor/test/unit/data/testfiles/formatting/spaces/gh5380_01.php new file mode 100644 index 00..5961bc2eb3 --- /dev/null +++ b/php/php.editor/test/unit/data/testfiles/formatting/spaces/gh5380_01.php @@ -0,0 +1,23 @@ +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. + */ + +var_dump( $test ); +var_dump( $test ? 1 : 2 ); +var_dump( $test ?? null ); diff --git a/php/php.editor/test/unit/data/testfiles/formatting/spaces/gh5380_01.php.testGH5380_01a.formatted b/php/php.editor/test/unit/data/testfiles/formatting/spaces/gh5380_01.php.testGH5380_01a.formatted new file mod
(netbeans) branch php-nb21-features updated: Handle brackets other than string correctly when "]" is typed #6706
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a commit to branch php-nb21-features in repository https://gitbox.apache.org/repos/asf/netbeans.git The following commit(s) were added to refs/heads/php-nb21-features by this push: new 8ab9fe8146 Handle brackets other than string correctly when "]" is typed #6706 new 58f611c7ee Merge pull request #6720 from junichi11/php-gh-6706-typing-closing-bracket 8ab9fe8146 is described below commit 8ab9fe8146560208fb3b8b90a0c6112b495ce2ef Author: Junichi Yamamoto AuthorDate: Sat Nov 18 15:11:34 2023 +0900 Handle brackets other than string correctly when "]" is typed #6706 - https://github.com/apache/netbeans/issues/6706 - We can get "[" as PHP_ENCAPSED_AND_WHITESPACE token e.g. `$x = "[$y example]";` - So, check also token ids - Add unit tests --- .../typinghooks/PhpTypedTextInterceptor.java | 23 - .../typinghooks/PhpTypedTextInterceptorTest.java | 30 ++ 2 files changed, 41 insertions(+), 12 deletions(-) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/typinghooks/PhpTypedTextInterceptor.java b/php/php.editor/src/org/netbeans/modules/php/editor/typinghooks/PhpTypedTextInterceptor.java index d6d92c3ee0..c99621066d 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/typinghooks/PhpTypedTextInterceptor.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/typinghooks/PhpTypedTextInterceptor.java @@ -539,13 +539,16 @@ public class PhpTypedTextInterceptor implements TypedTextInterceptor { } token = ts.token(); while (token != null) { -if ((LexUtilities.textEquals(token.text(), '(')) || (LexUtilities.textEquals(token.text(), '['))) { -if (LexUtilities.textEquals(token.text(), leftBracket)) { -bracketBalanceWithNewBracket++; -} -} else if ((LexUtilities.textEquals(token.text(), ')')) || (LexUtilities.textEquals(token.text(), ']'))) { -if (LexUtilities.textEquals(token.text(), bracket)) { -bracketBalanceWithNewBracket--; +// GH-6706 we can get "[" as PHP_ENCAPSED_AND_WHITESPACE token e.g. $x = "[$y example]" +if (token.id() == PHPTokenId.PHP_TOKEN) { +if ((LexUtilities.textEquals(token.text(), '(')) || (LexUtilities.textEquals(token.text(), '['))) { +if (LexUtilities.textEquals(token.text(), leftBracket)) { +bracketBalanceWithNewBracket++; +} +} else if ((LexUtilities.textEquals(token.text(), ')')) || (LexUtilities.textEquals(token.text(), ']'))) { +if (LexUtilities.textEquals(token.text(), bracket)) { +bracketBalanceWithNewBracket--; +} } } if (!ts.moveNext()) { @@ -553,11 +556,7 @@ public class PhpTypedTextInterceptor implements TypedTextInterceptor { } token = ts.token(); } -if (bracketBalanceWithNewBracket == 0) { -skipClosingBracket = false; -} else { -skipClosingBracket = true; -} +skipClosingBracket = bracketBalanceWithNewBracket != 0; } return skipClosingBracket; diff --git a/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/typinghooks/PhpTypedTextInterceptorTest.java b/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/typinghooks/PhpTypedTextInterceptorTest.java index 4f64215ea0..a27b7d66f3 100644 --- a/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/typinghooks/PhpTypedTextInterceptorTest.java +++ b/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/typinghooks/PhpTypedTextInterceptorTest.java @@ -698,6 +698,36 @@ public class PhpTypedTextInterceptorTest extends PhpTypinghooksTestBase { insertChar(original, ' ', expected); } +public void testIssueGH6706_01() throws Exception { +String original = "" ++ "$test = \"[$variable test]\";\n" ++ "$array['key'^];"; +String expected = "" ++ "$test = \"[$variable test]\";\n" ++ "$array['key']^;"; +insertChar(original, ']', expected); +} + +public void testIssueGH6706_02() throws Exception { +String original = "" ++ "$test = \"[test $variable]\";\n" ++ "$array['key'^];"; +String expected = "" ++ "$test = \"[test $variable]\";\n&q
(netbeans) branch php-nb21-features updated: PHP: Implemented correct return type guessing for a function that returns an array
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a commit to branch php-nb21-features in repository https://gitbox.apache.org/repos/asf/netbeans.git The following commit(s) were added to refs/heads/php-nb21-features by this push: new bfc5ccd144 PHP: Implemented correct return type guessing for a function that returns an array new 81162ffa6a Merge pull request #6697 from troizet/php_function_guessing_array_return_type bfc5ccd144 is described below commit bfc5ccd1446d0b646b84d59142358706b69213d7 Author: Alexey Borokhvostov AuthorDate: Tue Nov 14 23:15:02 2023 +0700 PHP: Implemented correct return type guessing for a function that returns an array --- .../php/editor/model/impl/ModelVisitor.java| 2 +- .../structure/functionGuessingArrayReturnType.pass | 2 ++ ...InstanceOverrideMethodWithGuessingArrayType.php | 29 +++ ...eOverrideMethodWithGuessingArrayType_01.codegen | 4 +++ ...eOverrideMethodWithGuessingArrayType_02.codegen | 4 +++ .../functionGuessingArrayReturnType.php| 37 +++ ...php.testFunctionGuessingArrayReturnType_01.html | 10 ++ ...php.testFunctionGuessingArrayReturnType_02.html | 10 ++ .../structure/functionGuessingArrayReturnType.php | 34 ++ .../SelectedPropertyMethodsCreatorTest.java| 16 +++-- .../editor/completion/PHPCCDocumentationTest.java | 8 + .../modules/php/editor/csl/NavigatorTest.java | 4 +++ .../typinghooks/PhpCommentGeneratorTest.java | 42 ++ 13 files changed, 199 insertions(+), 3 deletions(-) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/ModelVisitor.java b/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/ModelVisitor.java index 76cde49e4f..e3350332d7 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/ModelVisitor.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/ModelVisitor.java @@ -311,7 +311,7 @@ public final class ModelVisitor extends DefaultTreePathVisitor { } } } -} else if (expression instanceof Scalar) { +} else if (expression instanceof Scalar || expression instanceof ArrayCreation) { typeName = VariousUtils.extractVariableTypeFromExpression(expression, null); } if (!StringUtils.isEmpty(typeName)) { diff --git a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorTest/structure/functionGuessingArrayReturnType.pass b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorTest/structure/functionGuessingArrayReturnType.pass new file mode 100644 index 00..f7b60379c0 --- /dev/null +++ b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorTest/structure/functionGuessingArrayReturnType.pass @@ -0,0 +1,2 @@ +|-testArrayReturnType [824, 868] : ESCAPED{testArrayReturnType}ESCAPED{(}ESCAPED{)}:ESCAPED{array} +|-testArrayReturnTypeWithUnionType [880, 984] : ESCAPED{testArrayReturnTypeWithUnionType}ESCAPED{(}ESCAPED{)}:ESCAPED{string}ESCAPED{|}ESCAPED{array} diff --git a/php/php.editor/test/unit/data/testfiles/codegen/testInstanceOverrideMethodWithGuessingArrayType/testInstanceOverrideMethodWithGuessingArrayType.php b/php/php.editor/test/unit/data/testfiles/codegen/testInstanceOverrideMethodWithGuessingArrayType/testInstanceOverrideMethodWithGuessingArrayType.php new file mode 100644 index 00..30f7413244 --- /dev/null +++ b/php/php.editor/test/unit/data/testfiles/codegen/testInstanceOverrideMethodWithGuessingArrayType/testInstanceOverrideMethodWithGuessingArrayType.php @@ -0,0 +1,29 @@ +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 Foo { +public function myFoo(){ +return [1, 2]; +} +} + +class Bar extends Foo { + +} diff --git a/php/php.editor/test/unit/data/testfiles/codegen/testInstanceOverrideMethodWithGuessingArrayType/testInstanceOverrideMethodWithGuessingArrayType.php.testInstanceOverrideMethodWithGuessingArrayType_01.codegen b/php/php.editor/test/unit/data/testfiles/codegen/testInstanceOverrideMethodWithGuessingArrayType/testInstanceOverrideMethodWithGuessingArrayType.php.testInstanceOverrideMethodWithGuessingArrayType_01.codegen new file mode 100644 index 00..0a1842adff --- /dev/null +++ b/php/php.editor/test/unit/data/testfiles/codegen/testInstanceOverrideMethodWithGuessin
(netbeans) branch php-nb21-features updated (758c92a42a -> 269de6453a)
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a change to branch php-nb21-features in repository https://gitbox.apache.org/repos/asf/netbeans.git from 758c92a42a Merge pull request #6675 from junichi11/php82-dnf-types new e3dae462af PHP 8.2 Support: Constants in Traits (Part 6) new 3a906350c7 Encode parameter types for PhpDoc new 269de6453a Merge pull request #6700 from junichi11/php82-constants-in-traits The 9293 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: php/php.api.phpmodule/manifest.mf | 2 +- .../org/netbeans/modules/php/api/PhpVersion.java | 11 ++ php/php.editor/nbproject/project.properties| 2 +- php/php.editor/nbproject/project.xml | 2 +- .../php/editor/elements/ParameterElementImpl.java | 8 ++-- .../ConstantRedeclarationHintError.java| 12 +- .../editor/verification/IntroduceSuggestion.java | 22 +-- .../testIssue240824/testIssue240824.php.indexed| 2 +- .../testPHP82DNFParameterTypes.php.indexed | 20 +- .../testPhpDocParameterTypes.php} | 34 .../testPhpDocParameterTypes.php.indexed | 41 +++ .../ConstantRedeclarationHint/testTraits.php} | 34 +++- .../testTraits.php.testTraits.hints| 6 +++ .../testConstantsInTraits01.php} | 23 ++- ...raits01.php.testConstantsInTraits01_PHP81.hints | 0 ...raits01.php.testConstantsInTraits01_PHP82.hints | 4 ++ ...s01.php.testConstantsInTraits01_PHP82Fix.fixed} | 22 +++ .../testConstantsInTraits02.php} | 24 +++ ...raits02.php.testConstantsInTraits02_PHP82.hints | 0 .../testConstantsInTraits03.php} | 26 ...raits03.php.testConstantsInTraits03_PHP82.hints | 0 .../modules/php/editor/index/PHPIndexTest.java | 4 ++ .../ConstantRedeclarationHintTest.java | 4 ++ .../verification/IntroduceSuggestionTest.java | 46 +- 24 files changed, 215 insertions(+), 134 deletions(-) copy php/php.editor/test/unit/{src/org/netbeans/modules/php/editor/verification/ConstantRedeclarationHintTest.java => data/testfiles/index/testPhpDocParameterTypes/testPhpDocParameterTypes.php} (56%) create mode 100644 php/php.editor/test/unit/data/testfiles/index/testPhpDocParameterTypes/testPhpDocParameterTypes.php.indexed copy php/php.editor/test/unit/{src/org/netbeans/modules/php/editor/verification/ConstantRedeclarationHintTest.java => data/testfiles/verification/ConstantRedeclarationHint/testTraits.php} (55%) create mode 100644 php/php.editor/test/unit/data/testfiles/verification/ConstantRedeclarationHint/testTraits.php.testTraits.hints copy php/php.editor/test/unit/{src/org/netbeans/modules/php/editor/verification/ConstantRedeclarationHintTest.java => data/testfiles/verification/IntroduceSuggestion/testConstantsInTraits01/testConstantsInTraits01.php} (55%) copy enterprise/web.jspparser/test/unit/data/jspparser-data/wmroot/subdir/Page1.jsp => php/php.editor/test/unit/data/testfiles/verification/IntroduceSuggestion/testConstantsInTraits01/testConstantsInTraits01.php.testConstantsInTraits01_PHP81.hints (100%) create mode 100644 php/php.editor/test/unit/data/testfiles/verification/IntroduceSuggestion/testConstantsInTraits01/testConstantsInTraits01.php.testConstantsInTraits01_PHP82.hints copy php/php.editor/test/unit/{src/org/netbeans/modules/php/editor/verification/ConstantRedeclarationHintTest.java => data/testfiles/verification/IntroduceSuggestion/testConstantsInTraits01/testConstantsInTraits01.php.testConstantsInTraits01_PHP82Fix.fixed} (56%) copy php/php.editor/test/unit/{src/org/netbeans/modules/php/editor/verification/ConstantRedeclarationHintTest.java => data/testfiles/verification/IntroduceSuggestion/testConstantsInTraits02/testConstantsInTraits02.php} (55%) copy enterprise/web.jspparser/test/unit/data/jspparser-data/wmroot/subdir/Page1.jsp => php/php.editor/test/unit/data/testfiles/verification/IntroduceSuggestion/testConstantsInTraits02/testConstantsInTraits02.php.testConstantsInTraits02_PHP82.hints (100%) copy php/php.editor/test/unit/{src/org/netbeans/modules/php/editor/verification/ConstantRedeclarationHintTest.java => data/testfiles/verification/IntroduceSuggestion/testConstantsInTraits03/testConstantsInTraits03.php} (56%) copy enterprise/web.jspparser/test/unit/data/jspparser-data/wmroot/subdir/Page1.jsp => php/php.editor/test/unit/data/testfiles/verification/IntroduceSuggestion/testConstantsInTraits03/testConstantsInTraits0
(netbeans) branch php-nb21-features updated (ef46b15be8 -> 758c92a42a)
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a change to branch php-nb21-features in repository https://gitbox.apache.org/repos/asf/netbeans.git discard ef46b15be8 Merge pull request #6675 from junichi11/php82-dnf-types discard 9523012c56 PHP 8.2 Support: Disjunctive Normal Form Types (Part 11) discard 544093de4f PHP 8.2 Support: Disjunctive Normal Form Types (Part 10) discard 95ecb7e0c1 PHP 8.2 Support: Disjunctive Normal Form Types (Part 9) discard 69feae54c1 Merge pull request #6569 from junichi11/php82-dnf-types new dca223ab08 - Add Wildfly version 29 and 30 - Add Java 21 support for Wildfly 30+ - Prefer ConcurrentMap to synchronizedMap - Prefer ConcurrentHashMap.newKeySet to synchronizedSet - Remove synchronized blocks when using atomic and concurrent operations with ConcurrentHashMap - Set initial capacity for profile sets - Use try-with-resources when possible new 5e2a225f7f Merge pull request #6602 from pepness/wildfly-30 new b68146ac67 Update ASM from 9.5 to 9.6 new a5c96b738d Merge pull request #6597 from pepness/asm-9.6 new 0c437f1411 Micronaut Template for Data repository - add support for Pageable new 4c6ab9ac54 Merge pull request #6591 from thurka/GCN-3261 new 29b88adab0 make sure that there is database connection - getDialect() needs it new 2fde2b4fd6 Merge pull request #6609 from thurka/GCN-3613 new 774ff952a6 use clusters.config.release.list instead of clusters.config.full.list new cc0d88c3cd Merge pull request #6583 from thurka/vsix_build new b6dc0d4cd9 Prefixing all code names of commands with 'nbls'. new e0e448f436 Merge pull request #6218 from lahodaj/lsp-server-generic-commands-settings-try2 new aa5755a61c Fix Gradle version change in wrapper.properties new 5e712c89f2 Merge pull request #6589 from lkishalmi/fix-gradle-version-change-in-wrapper new e75a76521f JDK Downloader: fix current GA/EA values new 9eb9def620 Merge pull request #6590 from mbien/jdk-downloader-current-version-fix_delivery new c9c2ebf309 Fix Git show history regression. new 85b63563d6 Merge pull request #6594 from mbien/fix-git-history-regression new 49fac41e03 Try to close Gradle Daemons on exit. new db3c20eb85 Merge pull request #6598 from lkishalmi/gradle-disconnect-on-exit new a0e9284b89 Update FlatLaf from 3.2.1 to 3.2.5 new a2fe03e25e Merge pull request #6605 from DevCharly/flatlaf-3.2.4 new 23df8c64bf Fix unnamed main method detection code. new 40a9bb695c Merge pull request #6593 from mbien/fix-unnamed-main-detection new 409740b82f Priming build and reload improvements. new 9f51a38243 Include add-opens flags for tests/JDK9+ new b12970d271 Merge pull request #6514 from sdedic/maven/priming-and-reloads new 8ecaee2fd2 Naming panel should be set to its preferred size. new ec555891e4 Merge pull request #6619 from mbien/ui-fix-naming-panel-layout new e6ea7501e7 Be more friendly on 'runSingle' when 'run' task is missing. new 5ec24679f1 Merge pull request #6618 from lkishalmi/gradle-better-handle-runSingle new 2b20e6b270 Merge pull request #6608 from apache/delivery new a64cc72f02 CI: Add build-from-src-zip job new 20ee034c8a Merge pull request #6579 from mbien/ci-build-from-src-zip new 39ef2327ae Enable previously disabled tests for the java.hints module. new 1893738c5d Merge pull request #6554 from mbien/ci-java-hints-enable-more-tests new 6881b98d62 Fix openide.awt tests (annotation processor err msg changed) new cb439a0b9e Fix openide.filesystems, options.api and core.multiview tests. new 8295f4ed7e Fix platform/favorites tests, input does influence favorites order. new 03af07e74a Move platform jobs to JDK 11. new fb0835512d Merge pull request #6617 from mbien/platform-to-11 new 29773a3fc1 Adding priorities to SQLCompletionItem new 4a89c2b57a Merge pull request #6620 from jhorvath/sql_cc_priority new 32a9ff7702 Navigate to Scala classes in Analyze Stack Window new aa95958ec9 Navigate to Scala classes in Analyze Stack Window new e18f55e696 Ask for DB password when creating OCI Vault new c3bd066dab Merge pull request #6645 from jhorvath/db_vault_empty_password new 36a9b160de [NETBEANS-6599] Do not throw a CompletionFailure for empty java.lang package outside of java.base. new 8dd9867e1a Merge pull request #6629 from lahodaj/NETBEANS-6599 new 6468b24767 [JAVAVSCODE-53] Assignments to parameters to record compact constructors should not be marked as unused. new 68bb0e8e61 Merge pull request #6635 from lahodaj/javavscode-53 new 0136307ef3 [NETBEANS-6638]: Avoid adding a space after opening curly brace. new 7668ad1083 Merge pull request #6641 from lahodaj/NETBEANS-6638 new 7b478ba8ba PHP: Fix autocomplete for exception class when adding exception breakpoint. new 5bfd1a1eee
(netbeans) branch php-nb21-features updated (69feae54c1 -> ef46b15be8)
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a change to branch php-nb21-features in repository https://gitbox.apache.org/repos/asf/netbeans.git from 69feae54c1 Merge pull request #6569 from junichi11/php82-dnf-types new 95ecb7e0c1 PHP 8.2 Support: Disjunctive Normal Form Types (Part 9) new 544093de4f PHP 8.2 Support: Disjunctive Normal Form Types (Part 10) new 9523012c56 PHP 8.2 Support: Disjunctive Normal Form Types (Part 11) new ef46b15be8 Merge pull request #6675 from junichi11/php82-dnf-types The 9215 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: .../org/netbeans/modules/php/editor/CodeUtils.java | 1 + .../php/editor/csl/DeclarationFinderImpl.java | 48 +- .../elements/BaseFunctionElementSupport.java | 76 ++- .../php/editor/parser/PHPVarCommentParser.java | 13 +- .../testDNFTypesConstructor.php| 29 + ...Constructor.php.testDNFTypesConstructor.codegen | 7 + .../testDNFTypesGetter/testDNFTypesGetter.php | 29 + ...stDNFTypesGetter.php.testDNFTypesGetter.codegen | 24 + .../testDNFTypesImplementMethod01.php | 45 ++ ...hod01.php.testDNFTypesImplementMethod01.codegen | 4 + .../testDNFTypesImplementMethod02.php | 49 ++ ...hod02.php.testDNFTypesImplementMethod02.codegen | 2 + .../testDNFTypesImplementMethod03.php | 42 ++ ...hod03.php.testDNFTypesImplementMethod03.codegen | 2 + .../testDNFTypesImplementMethod04.php | 37 ++ ...hod04.php.testDNFTypesImplementMethod04.codegen | 2 + .../testDNFTypesOverrideMethod01.php | 39 ++ ...thod01.php.testDNFTypesOverrideMethod01.codegen | 3 + .../testDNFTypesOverrideMethod02.php | 51 ++ ...thod02.php.testDNFTypesOverrideMethod02.codegen | 3 + .../testDNFTypesOverrideMethod03.php | 45 ++ ...thod03.php.testDNFTypesOverrideMethod03.codegen | 3 + .../testDNFTypesSetter/testDNFTypesSetter.php | 29 + ...stDNFTypesSetter.php.testDNFTypesSetter.codegen | 24 + .../testDNFTypesImplementMethod01.php | 36 ++ ...1.php.testDNFTypesImplementMethod01.cccustomtpl | 4 + .../testDNFTypesImplementMethod02.php | 50 ++ ...2.php.testDNFTypesImplementMethod02.cccustomtpl | 4 + .../testDNFTypesImplementMethod03a.php | 44 ++ php.testDNFTypesImplementMethod03a.cccustomtpl | 4 + .../testDNFTypesImplementMethod03b.php | 47 ++ php.testDNFTypesImplementMethod03b.cccustomtpl | 4 + .../testDNFTypesImplementMethod04.php | 36 ++ ...4.php.testDNFTypesImplementMethod04.cccustomtpl | 4 + .../testDNFTypesOverrideMethod01.php | 38 ++ ...01.php.testDNFTypesOverrideMethod01.cccustomtpl | 4 + .../testDNFTypesOverrideMethod02.php | 52 ++ ...02.php.testDNFTypesOverrideMethod02.cccustomtpl | 4 + .../testDNFTypesOverrideMethod03.php | 46 ++ ...03.php.testDNFTypesOverrideMethod03.cccustomtpl | 4 + .../testDNFTypesOverrideMethodSpecialTypes01.php | 53 ++ ...NFTypesOverrideMethodSpecialTypes01.cccustomtpl | 9 + .../testDNFTypesOverrideMethodSpecialTypes02.php | 52 ++ ...NFTypesOverrideMethodSpecialTypes02.cccustomtpl | 9 + .../testDNFTypesOverrideMethodSpecialTypes03.php | 48 ++ ...NFTypesOverrideMethodSpecialTypes03.cccustomtpl | 9 + .../testDNFTypesOverrideMethodSpecialTypes04.php | 46 ++ ...NFTypesOverrideMethodSpecialTypes04.cccustomtpl | 9 + .../php82/testDNFType/testDNFType.php | 114 .../php82/testDNFType/testDNFType.php | 114 .../testDNFType.php.testDNFType_a01.occurrences| 38 ++ .../testDNFType.php.testDNFType_a02.occurrences| 38 ++ .../testDNFType.php.testDNFType_a03.occurrences| 38 ++ .../testDNFType.php.testDNFType_a04.occurrences| 38 ++ .../testDNFType.php.testDNFType_a05.occurrences| 38 ++ .../testDNFType.php.testDNFType_a06.occurrences| 38 ++ .../testDNFType.php.testDNFType_a07.occurrences| 38 ++ .../testDNFType.php.testDNFType_a08.occurrences| 38 ++ .../testDNFType.php.testDNFType_a09.occurrences| 38 ++ .../testDNFType.php.testDNFType_a10.occurrences| 38 ++ .../testDNFType.php.testDNFType_a11.occurrences| 38 ++ .../testDNFType.php.testDNFType_a12.occurrences| 38 ++ .../testDNFType.php.testDNFType_a13.occurrences| 38 ++ .../testDNFType.php.testDNFType_a14.occurrences| 38 ++ .../testDNFType.php.testDNFType_a15.occurrences| 38 ++ .../testDNFType.php.testDNFType_a16.occurrences| 38 ++ .../testDNFType.php.testDNFType_a17.occurrences| 38 ++ .../testDNFType.php.testDNFType_a18.occurrences| 38 ++ .../testDNFType
(netbeans) branch php-nb21-features updated (94ceb291d9 -> 69feae54c1)
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a change to branch php-nb21-features in repository https://gitbox.apache.org/repos/asf/netbeans.git discard 94ceb291d9 Merge pull request #6569 from junichi11/php82-dnf-types omit 73237de942 Merge pull request #6660 from mbien/output-options-ui-cleanup omit 1be2163379 Merge pull request #6684 from apache/delivery omit 6fb214311c Merge pull request #6673 from mbien/fix-lsp-micronaut-tests_delivery omit c0f09c927b Force TLS1.2 in MicronautGradleArtifactsImplTest and ProjectViewTest omit 1c3458d4d3 Update micronaut gradle tests omit 54b5d2a112 Merge pull request #6665 from mbien/stabilize-php-tag-folding-test omit 49cda01b0c Fix php tag fold test (attempt 2) omit 0c8313ebfd Merge pull request #5576 from tbw777/g2 omit 5cb5afea64 Installed some internal generics to fix some compiler warnings omit fb9b95d78c Terminal, Output and Syntax Coloring options UI cleanup. omit 27e53d96cd Merge pull request #6656 from neilcsmith-net/del-master-20rc3 omit 317bc96f9e Merge branch 'delivery' into del-master-20rc3 omit a385cb1a63 Merge pull request #6623 from mbien/revert-6514_delivery omit 7c99436d83 Merge pull request #6654 from neilcsmith-net/gh6448 omit 77185eab0f Enable JUnit output processing if the Maven goals include failsafe:integration-test omit efe5e1735d Merge pull request #6644 from neilcsmith-net/mouse-linux-horiz-scroll omit c3bd066dab Merge pull request #6645 from jhorvath/db_vault_empty_password omit 43693c87d7 Merge pull request #6646 from lahodaj/NETBEANS-5659 omit 5bfd1a1eee Merge pull request #6643 from troizet/php_fix_completion_exception_breakpoint omit 7668ad1083 Merge pull request #6641 from lahodaj/NETBEANS-6638 omit 0e0560d950 Drop horizontal scroll mouse button events on Linux to fix trackpad issues. omit 9e4a2603dd [NETBEANS-5659] Collection.forEach is always a read from the collection. omit e18f55e696 Ask for DB password when creating OCI Vault omit 7b478ba8ba PHP: Fix autocomplete for exception class when adding exception breakpoint. omit 68bb0e8e61 Merge pull request #6635 from lahodaj/javavscode-53 omit aa95958ec9 Navigate to Scala classes in Analyze Stack Window omit 0136307ef3 [NETBEANS-6638]: Avoid adding a space after opening curly brace. omit 32a9ff7702 Navigate to Scala classes in Analyze Stack Window omit 6468b24767 [JAVAVSCODE-53] Assignments to parameters to record compact constructors should not be marked as unused. omit 4a89c2b57a Merge pull request #6620 from jhorvath/sql_cc_priority omit 29773a3fc1 Adding priorities to SQLCompletionItem omit 8dd9867e1a Merge pull request #6629 from lahodaj/NETBEANS-6599 omit fb0835512d Merge pull request #6617 from mbien/platform-to-11 omit 36a9b160de [NETBEANS-6599] Do not throw a CompletionFailure for empty java.lang package outside of java.base. omit 1893738c5d Merge pull request #6554 from mbien/ci-java-hints-enable-more-tests omit 03af07e74a Move platform jobs to JDK 11. omit 8295f4ed7e Fix platform/favorites tests, input does influence favorites order. omit cb439a0b9e Fix openide.filesystems, options.api and core.multiview tests. omit 6881b98d62 Fix openide.awt tests (annotation processor err msg changed) omit 20ee034c8a Merge pull request #6579 from mbien/ci-build-from-src-zip omit 94aa2ddd90 Revert "Priming build and reload improvements." omit a64cc72f02 CI: Add build-from-src-zip job omit 2b20e6b270 Merge pull request #6608 from apache/delivery omit 5ec24679f1 Merge pull request #6618 from lkishalmi/gradle-better-handle-runSingle omit ec555891e4 Merge pull request #6619 from mbien/ui-fix-naming-panel-layout omit 8ecaee2fd2 Naming panel should be set to its preferred size. omit e6ea7501e7 Be more friendly on 'runSingle' when 'run' task is missing. omit 2fde2b4fd6 Merge pull request #6609 from thurka/GCN-3613 omit 4c6ab9ac54 Merge pull request #6591 from thurka/GCN-3261 omit b12970d271 Merge pull request #6514 from sdedic/maven/priming-and-reloads omit 40a9bb695c Merge pull request #6593 from mbien/fix-unnamed-main-detection omit 29b88adab0 make sure that there is database connection - getDialect() needs it omit a2fe03e25e Merge pull request #6605 from DevCharly/flatlaf-3.2.4 omit db3c20eb85 Merge pull request #6598 from lkishalmi/gradle-disconnect-on-exit omit 85b63563d6 Merge pull request #6594 from mbien/fix-git-history-regression omit 9eb9def620 Merge pull request #6590 from mbien/jdk-downloader-current-version-fix_delivery omit 5e712c89f2 Merge pull request #6589 from lkishalmi/fix-gradle-version-change-in-wrapper omit e0e448f436 Merge pull request #6218 from lahodaj/lsp-server-generic-commands-settings-try2 omit 9f51a38243 Include add-opens flags for tests/JDK9+ omit
(netbeans) branch php-nb21-features updated (b0a98ffdff -> 94ceb291d9)
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a change to branch php-nb21-features in repository https://gitbox.apache.org/repos/asf/netbeans.git discard b0a98ffdff PHP 8.2 Support: Disjunctive Normal Form Types (Part 8) discard ec679fe153 PHP 8.2 Support: Disjunctive Normal Form Types (Part 7) discard cefe6a1b81 PHP 8.2 Support: Disjunctive Normal Form Types (Part 6) discard 71d008672c PHP 8.2 Support: Disjunctive Normal Form Types (Part 5) discard ab297022ed PHP 8.2 Support: Disjunctive Normal Form Types (Part 4) discard d564b40f39 PHP 8.2 Support: Disjunctive Normal Form Types (Part 3) discard a32131e6ae PHP 8.2 Support: Disjunctive Normal Form Types (Part 2) new 505715ac92 PHP 8.2 Support: Disjunctive Normal Form Types (Part 2) new d686d1edf8 PHP 8.2 Support: Disjunctive Normal Form Types (Part 3) new 46f2330137 PHP 8.2 Support: Disjunctive Normal Form Types (Part 4) new 27829fa56d PHP 8.2 Support: Disjunctive Normal Form Types (Part 5) new 7832f690ec PHP 8.2 Support: Disjunctive Normal Form Types (Part 6) new b3b4694f47 PHP 8.2 Support: Disjunctive Normal Form Types (Part 7) new 3ffd6159f2 PHP 8.2 Support: Disjunctive Normal Form Types (Part 8) new 94ceb291d9 Merge pull request #6569 from junichi11/php82-dnf-types This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (b0a98ffdff) \ N -- N -- N refs/heads/php-nb21-features (94ceb291d9) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omit" are not gone; other references still refer to them. Any revisions marked "discard" are gone forever. The 9286 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: - 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) 01/07: PHP 8.2 Support: Disjunctive Normal Form Types (Part 2)
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a commit to branch php-nb21-features in repository https://gitbox.apache.org/repos/asf/netbeans.git commit a32131e6ae856fa87b0861572d05e9ffbffcb07d Author: Junichi Yamamoto AuthorDate: Fri Apr 28 11:01:36 2023 +0900 PHP 8.2 Support: Disjunctive Normal Form Types (Part 2) - https://github.com/apache/netbeans/issues/4725 - https://wiki.php.net/rfc/dnf_types - Fix DNF return types for the navigator --- .../org/netbeans/modules/php/editor/CodeUtils.java | 90 ++ .../modules/php/editor/api/QualifiedName.java | 10 +- .../php/editor/api/elements/AliasedFunction.java | 5 + .../editor/api/elements/BaseFunctionElement.java | 6 + .../modules/php/editor/csl/NavigatorScanner.java | 41 ++- .../elements/BaseFunctionElementSupport.java | 25 +++- .../php/editor/elements/FunctionElementImpl.java | 20 +++ .../php/editor/elements/MethodElementImpl.java | 42 +-- .../modules/php/editor/index/PHPIndexer.java | 2 +- .../modules/php/editor/model/FunctionScope.java| 1 + .../php/editor/model/impl/FunctionScopeImpl.java | 87 +++-- .../php/editor/model/impl/MethodScopeImpl.java | 7 ++ .../deprecatedTypesForNullableTypes_02.pass| 2 +- .../php82/deprecatedDnfReturnTypes_01.pass | 14 +++ .../NavigatorTest/structure/nullableTypes_02.pass | 2 +- .../structure/php82/dnfReturnTypes.pass| 14 +++ .../structure/pureIntersectionTypes.pass | 10 +- .../index/testGetEnums/testGetEnums.php.indexed| 8 +- .../testGetFunctions/testGetFunctions.php.indexed | 6 +- .../testGetMethods/testGetMethods.php.indexed | 2 +- .../testIssue240824/testIssue240824.php.indexed| 2 +- .../testNullableTypesForFunctions.php.indexed | 4 +- .../testNullableTypesForMethods.php.indexed| 8 +- ...stPHP80ConstructorPropertyPromotion.php.indexed | 20 +-- .../testPHP80MixedReturnType.php.indexed | 4 +- .../testPHP80UnionTypesFunctions.php.indexed | 12 +- .../testPHP80UnionTypesTypes.php.indexed | 16 +-- .../testPHP81PureIntersectionTypes.php.indexed | 24 ++-- .../testPHP82ConstantsInTraits.php.indexed | 2 +- .../testPHP82DNFReturnTypes.php} | 37 ++ .../testPHP82DNFReturnTypes.php.indexed| 136 + .../deprecatedDnfReturnTypes_01.php} | 43 +++ .../dnfReturnTypes.php}| 40 ++ .../testfiles/structure/pureIntersectionTypes.php | 2 +- .../php/editor/csl/NavigatorDeprecatedTest.java| 4 + .../modules/php/editor/csl/NavigatorTest.java | 4 + .../modules/php/editor/index/PHPIndexTest.java | 4 + 37 files changed, 530 insertions(+), 226 deletions(-) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java b/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java index d87712a333..e18311e208 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java @@ -254,15 +254,9 @@ public final class CodeUtils { } else if (typeName instanceof NullableType) { return NULLABLE_TYPE_PREFIX + extractUnqualifiedName(((NullableType) typeName).getType()); } else if (typeName instanceof UnionType) { -UnionType unionType = (UnionType) typeName; -StringBuilder sb = new StringBuilder(); -for (Expression type : unionType.getTypes()) { -if (sb.length() > 0) { -sb.append(Type.SEPARATOR); -} -sb.append(extractUnqualifiedName(type)); -} -return sb.toString(); +return extractUnqualifiedName((UnionType) typeName); +} else if (typeName instanceof IntersectionType) { +return extractUnqualifiedName((IntersectionType) typeName); } //TODO: php5.3 !!! @@ -270,6 +264,35 @@ public final class CodeUtils { return null; } +private static String extractUnqualifiedName(UnionType unionType) { +StringBuilder sb = new StringBuilder(); +for (Expression type : unionType.getTypes()) { +if (sb.length() > 0) { +sb.append(Type.SEPARATOR); +} +boolean isIntersectionType = type instanceof IntersectionType; +if (isIntersectionType) { +sb.append("("); // NOI18N +} +sb.append(extractUnqualifiedName(type)); +if (isIntersectionType) { +sb.append(")"); // NOI18N +} +} +return sb.toString(); +} + +private static String extractUnqualifiedName(IntersectionType intersectionType) { +StringBuil
(netbeans) 04/07: PHP 8.2 Support: Disjunctive Normal Form Types (Part 5)
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a commit to branch php-nb21-features in repository https://gitbox.apache.org/repos/asf/netbeans.git commit 71d008672cad41afc4fdc36920349683f16859c4 Author: Junichi Yamamoto AuthorDate: Thu Oct 12 11:53:17 2023 +0900 PHP 8.2 Support: Disjunctive Normal Form Types (Part 5) - https://github.com/apache/netbeans/issues/4725 - https://wiki.php.net/rfc/dnf_types - Fix code completion for return, field, `@method`, `@property`, and `@var` DNF types - Fix the lexer to recognize DNF types of vardoc (`/** @var X|(Y) $var */`) - Add unit tests --- .../org/netbeans/modules/php/editor/CodeUtils.java | 2 +- .../php/editor/api/elements/FieldElement.java | 1 + .../php/editor/completion/PHPCompletionItem.java | 4 + .../php/editor/elements/FieldElementImpl.java | 32 ++- .../php/editor/model/impl/FieldElementImpl.java| 2 +- .../php/editor/model/impl/FunctionScopeImpl.java | 4 +- .../modules/php/editor/model/impl/Type.java| 26 +- .../modules/php/editor/parser/ASTPHP5Scanner.java | 316 - .../php/editor/parser/PHPVarCommentParser.java | 3 +- .../completion/lib/php82/testDNFTypes/dnfTypes.php | 215 ++ ...nfTypes.php.testDNFTypes_FieldType01.completion | 12 + ...fTypes.php.testDNFTypes_FieldType02a.completion | 12 + ...fTypes.php.testDNFTypes_FieldType02b.completion | 5 + ...nfTypes.php.testDNFTypes_FieldType03.completion | 18 ++ ...nfTypes.php.testDNFTypes_FieldType04.completion | 9 + ...nfTypes.php.testDNFTypes_FieldType05.completion | 13 + ...nfTypes.php.testDNFTypes_FieldType06.completion | 9 + ...nfTypes.php.testDNFTypes_FieldType07.completion | 9 + ...nfTypes.php.testDNFTypes_FieldType08.completion | 9 + ...nfTypes.php.testDNFTypes_FieldType09.completion | 13 + ...fTypes.php.testDNFTypes_FieldType10a.completion | 9 + ...fTypes.php.testDNFTypes_FieldType10b.completion | 4 + ...nfTypes.php.testDNFTypes_FieldType11.completion | 18 ++ ...nfTypes.php.testDNFTypes_FieldType12.completion | 12 + ...nfTypes.php.testDNFTypes_FieldType13.completion | 9 + ...hp.testDNFTypes_FunctionReturnType01.completion | 12 + ...hp.testDNFTypes_FunctionReturnType02.completion | 18 ++ ...hp.testDNFTypes_FunctionReturnType03.completion | 12 + ...p.testDNFTypes_FunctionReturnType04a.completion | 18 ++ ...p.testDNFTypes_FunctionReturnType04b.completion | 4 + php.testDNFTypes_MethodReturnType01.completion | 12 + ...php.testDNFTypes_MethodReturnType02a.completion | 12 + ...php.testDNFTypes_MethodReturnType02b.completion | 5 + php.testDNFTypes_MethodReturnType03.completion | 9 + php.testDNFTypes_MethodReturnType04.completion | 12 + php.testDNFTypes_MethodReturnType05.completion | 9 + php.testDNFTypes_MethodReturnType06.completion | 12 + php.testDNFTypes_MethodReturnType07.completion | 18 ++ php.testDNFTypes_MethodReturnType08.completion | 18 ++ ...php.testDNFTypes_MethodReturnType09a.completion | 12 + ...php.testDNFTypes_MethodReturnType09b.completion | 4 + php.testDNFTypes_MethodReturnType10.completion | 18 ++ php.testDNFTypes_MethodReturnType11.completion | 9 + php.testDNFTypes_MethodReturnType12.completion | 18 ++ ...php.testDNFTypes_MethodReturnType13a.completion | 18 ++ ...php.testDNFTypes_MethodReturnType13b.completion | 4 + php.testDNFTypes_MethodReturnType14.completion | 12 + php.testDNFTypes_MethodReturnType15.completion | 12 + php.testDNFTypes_MethodReturnType16.completion | 18 ++ php.testDNFTypes_MethodReturnType17.completion | 12 + php.testDNFTypes_MethodReturnType18.completion | 12 + ...Types.php.testDNFTypes_VarDocType01a.completion | 9 + ...Types.php.testDNFTypes_VarDocType01b.completion | 13 + ...Types.php.testDNFTypes_VarDocType02a.completion | 12 + ...Types.php.testDNFTypes_VarDocType02b.completion | 18 ++ ...Types.php.testDNFTypes_VarDocType03a.completion | 12 + ...Types.php.testDNFTypes_VarDocType03b.completion | 18 ++ ...Types.php.testDNFTypes_VarDocType04a.completion | 9 + ...Types.php.testDNFTypes_VarDocType04b.completion | 13 + ...Types.php.testDNFTypes_VarDocType05a.completion | 12 + ...Types.php.testDNFTypes_VarDocType05b.completion | 18 ++ ...Types.php.testDNFTypes_VarDocType06a.completion | 12 + ...Types.php.testDNFTypes_VarDocType06b.completion | 18 ++ .../editor/completion/PHP82CodeCompletionTest.java | 212 ++ .../modules/php/editor/model/impl/TypeTest.java| 101 +++ php/php.editor/tools/ASTPHP5Scanner.flex | 4 +- 66 files changed, 1411 insertions(+), 156 deletions(-) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java b/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java index 746fecc67a..fb2c27caaa 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor
(netbeans) branch php-nb21-features updated (69feae54c1 -> b0a98ffdff)
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a change to branch php-nb21-features in repository https://gitbox.apache.org/repos/asf/netbeans.git omit 69feae54c1 Merge pull request #6569 from junichi11/php82-dnf-types omit 3ffd6159f2 PHP 8.2 Support: Disjunctive Normal Form Types (Part 8) omit b3b4694f47 PHP 8.2 Support: Disjunctive Normal Form Types (Part 7) omit 7832f690ec PHP 8.2 Support: Disjunctive Normal Form Types (Part 6) omit 27829fa56d PHP 8.2 Support: Disjunctive Normal Form Types (Part 5) omit 46f2330137 PHP 8.2 Support: Disjunctive Normal Form Types (Part 4) omit d686d1edf8 PHP 8.2 Support: Disjunctive Normal Form Types (Part 3) omit 505715ac92 PHP 8.2 Support: Disjunctive Normal Form Types (Part 2) add dca223ab08 - Add Wildfly version 29 and 30 - Add Java 21 support for Wildfly 30+ - Prefer ConcurrentMap to synchronizedMap - Prefer ConcurrentHashMap.newKeySet to synchronizedSet - Remove synchronized blocks when using atomic and concurrent operations with ConcurrentHashMap - Set initial capacity for profile sets - Use try-with-resources when possible add 5e2a225f7f Merge pull request #6602 from pepness/wildfly-30 add b68146ac67 Update ASM from 9.5 to 9.6 add a5c96b738d Merge pull request #6597 from pepness/asm-9.6 add 0c437f1411 Micronaut Template for Data repository - add support for Pageable add 4c6ab9ac54 Merge pull request #6591 from thurka/GCN-3261 add 29b88adab0 make sure that there is database connection - getDialect() needs it add 2fde2b4fd6 Merge pull request #6609 from thurka/GCN-3613 add 774ff952a6 use clusters.config.release.list instead of clusters.config.full.list add cc0d88c3cd Merge pull request #6583 from thurka/vsix_build add b6dc0d4cd9 Prefixing all code names of commands with 'nbls'. add e0e448f436 Merge pull request #6218 from lahodaj/lsp-server-generic-commands-settings-try2 add aa5755a61c Fix Gradle version change in wrapper.properties add 5e712c89f2 Merge pull request #6589 from lkishalmi/fix-gradle-version-change-in-wrapper add e75a76521f JDK Downloader: fix current GA/EA values add 9eb9def620 Merge pull request #6590 from mbien/jdk-downloader-current-version-fix_delivery add c9c2ebf309 Fix Git show history regression. add 85b63563d6 Merge pull request #6594 from mbien/fix-git-history-regression add 49fac41e03 Try to close Gradle Daemons on exit. add db3c20eb85 Merge pull request #6598 from lkishalmi/gradle-disconnect-on-exit add a0e9284b89 Update FlatLaf from 3.2.1 to 3.2.5 add a2fe03e25e Merge pull request #6605 from DevCharly/flatlaf-3.2.4 add 23df8c64bf Fix unnamed main method detection code. add 40a9bb695c Merge pull request #6593 from mbien/fix-unnamed-main-detection add 409740b82f Priming build and reload improvements. add 9f51a38243 Include add-opens flags for tests/JDK9+ add b12970d271 Merge pull request #6514 from sdedic/maven/priming-and-reloads add 8ecaee2fd2 Naming panel should be set to its preferred size. add ec555891e4 Merge pull request #6619 from mbien/ui-fix-naming-panel-layout add e6ea7501e7 Be more friendly on 'runSingle' when 'run' task is missing. add 5ec24679f1 Merge pull request #6618 from lkishalmi/gradle-better-handle-runSingle add 2b20e6b270 Merge pull request #6608 from apache/delivery add a64cc72f02 CI: Add build-from-src-zip job add 20ee034c8a Merge pull request #6579 from mbien/ci-build-from-src-zip add 39ef2327ae Enable previously disabled tests for the java.hints module. add 1893738c5d Merge pull request #6554 from mbien/ci-java-hints-enable-more-tests add 6881b98d62 Fix openide.awt tests (annotation processor err msg changed) add cb439a0b9e Fix openide.filesystems, options.api and core.multiview tests. add 8295f4ed7e Fix platform/favorites tests, input does influence favorites order. add 03af07e74a Move platform jobs to JDK 11. add fb0835512d Merge pull request #6617 from mbien/platform-to-11 add 29773a3fc1 Adding priorities to SQLCompletionItem add 4a89c2b57a Merge pull request #6620 from jhorvath/sql_cc_priority add 32a9ff7702 Navigate to Scala classes in Analyze Stack Window add aa95958ec9 Navigate to Scala classes in Analyze Stack Window add e18f55e696 Ask for DB password when creating OCI Vault add c3bd066dab Merge pull request #6645 from jhorvath/db_vault_empty_password add 36a9b160de [NETBEANS-6599] Do not throw a CompletionFailure for empty java.lang package outside of java.base. add 8dd9867e1a Merge pull request #6629 from lahodaj/NETBEANS-6599 add 6468b24767 [JAVAVSCODE-53] Assignments to parameters to record compact constructors should not be marked as unused. add 68bb0e8e61 Merge pull request #6635 from lahodaj/javavscode-53 add 0136307ef3 [NETBEANS-6638]: Avoid adding
(netbeans) 05/07: PHP 8.2 Support: Disjunctive Normal Form Types (Part 6)
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a commit to branch php-nb21-features in repository https://gitbox.apache.org/repos/asf/netbeans.git commit cefe6a1b819c9138f88dc6afe48aedd5d611d12e Author: Junichi Yamamoto AuthorDate: Thu Oct 12 15:09:29 2023 +0900 PHP 8.2 Support: Disjunctive Normal Form Types (Part 6) - https://github.com/apache/netbeans/issues/4725 - https://wiki.php.net/rfc/dnf_types - Fix code completion for parameter DNF types - Add unit tests --- .../org/netbeans/modules/php/editor/CodeUtils.java | 1 + .../php/editor/elements/ParameterElementImpl.java | 34 ++ .../php/editor/elements/TypeResolverImpl.java | 4 +- .../modules/php/editor/model/impl/Type.java| 17 +++ .../php/editor/model/impl/VariousUtils.java| 7 +- .../completion/lib/php82/testDNFTypes/dnfTypes.php | 49 +++- ...pes.php.testDNFTypes_ParameterType01.completion | 9 ++ ...pes.php.testDNFTypes_ParameterType02.completion | 9 ++ ...pes.php.testDNFTypes_ParameterType03.completion | 13 +++ ...pes.php.testDNFTypes_ParameterType04.completion | 13 +++ ...pes.php.testDNFTypes_ParameterType05.completion | 12 ++ ...pes.php.testDNFTypes_ParameterType06.completion | 18 +++ ...pes.php.testDNFTypes_ParameterType07.completion | 9 ++ ...pes.php.testDNFTypes_ParameterType08.completion | 12 ++ ...pes.php.testDNFTypes_ParameterType09.completion | 12 ++ ...pes.php.testDNFTypes_ParameterType10.completion | 18 +++ ...pes.php.testDNFTypes_ParameterType11.completion | 12 ++ ...pes.php.testDNFTypes_ParameterType12.completion | 9 ++ ...pes.php.testDNFTypes_ParameterType13.completion | 18 +++ ...pes.php.testDNFTypes_ParameterType14.completion | 18 +++ ...pes.php.testDNFTypes_ParameterType15.completion | 18 +++ ...pes.php.testDNFTypes_ParameterType16.completion | 9 ++ ...pes.php.testDNFTypes_ParameterType17.completion | 13 +++ ...pes.php.testDNFTypes_ParameterType18.completion | 12 ++ ...pes.php.testDNFTypes_ParameterType19.completion | 18 +++ ...pes.php.testDNFTypes_ParameterType20.completion | 9 ++ ...pes.php.testDNFTypes_ParameterType21.completion | 13 +++ ...pes.php.testDNFTypes_ParameterType22.completion | 12 ++ ...es.php.testDNFTypes_ParameterType23a.completion | 18 +++ ...es.php.testDNFTypes_ParameterType23b.completion | 4 + ...pes.php.testDNFTypes_ParameterType24.completion | 12 ++ ...pes.php.testDNFTypes_ParameterType25.completion | 18 +++ ...pes.php.testDNFTypes_ParameterType26.completion | 9 ++ ...pes.php.testDNFTypes_ParameterType27.completion | 12 ++ ...pes.php.testDNFTypes_ParameterType28.completion | 9 ++ ...pes.php.testDNFTypes_ParameterType29.completion | 12 ++ ...testDNFTypes_ParameterTypeInCCList01.completion | 5 + .../testPHP82DNFParameterTypes.php.indexed | 14 +-- .../editor/completion/PHP82CodeCompletionTest.java | 124 + .../modules/php/editor/model/impl/TypeTest.java| 100 + 40 files changed, 696 insertions(+), 39 deletions(-) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java b/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java index fb2c27caaa..49731d9552 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java @@ -91,6 +91,7 @@ public final class CodeUtils { public static final Pattern WHITE_SPACES_PATTERN = Pattern.compile("\\s+"); // NOI18N public static final Pattern SPLIT_TYPES_PATTERN = Pattern.compile("[()|&]+"); // NOI18N +public static final Pattern TYPE_NAMES_IN_TYPE_DECLARATION_PATTERN = Pattern.compile("[^?()|&]+"); // NOI18N private static final Logger LOGGER = Logger.getLogger(CodeUtils.class.getName()); diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/elements/ParameterElementImpl.java b/php/php.editor/src/org/netbeans/modules/php/editor/elements/ParameterElementImpl.java index b8a69c0acf..69c27825f8 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/elements/ParameterElementImpl.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/elements/ParameterElementImpl.java @@ -26,7 +26,6 @@ import java.util.Set; import org.netbeans.api.annotations.common.CheckForNull; import org.netbeans.modules.csl.api.OffsetRange; import org.netbeans.modules.php.api.util.StringUtils; -import org.netbeans.modules.php.editor.CodeUtils; import org.netbeans.modules.php.editor.api.elements.ParameterElement; import org.netbeans.modules.php.editor.api.elements.TypeNameResolver; import org.netbeans.modules.php.editor.api.elements.TypeResolver; @@ -357,30 +356,17 @@ public final class ParameterElementImpl implements ParameterElement { } } if (forDeclaration && hasDeclaredType()) { -if (isUnionType || isIntersec
(netbeans) 06/07: PHP 8.2 Support: Disjunctive Normal Form Types (Part 7)
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a commit to branch php-nb21-features in repository https://gitbox.apache.org/repos/asf/netbeans.git commit ec679fe153f0826730f85a0fc94b9b58641db384 Author: Junichi Yamamoto AuthorDate: Sun Oct 15 14:36:50 2023 +0900 PHP 8.2 Support: Disjunctive Normal Form Types (Part 7) - https://github.com/apache/netbeans/issues/4725 - https://wiki.php.net/rfc/dnf_types - Fix documentation of code completion for parameter DNF types - Add unit tests - Increment the spec version to 2.27.0 --- .../modules/php/editor/completion/DocRenderer.java | 120 - .../editor/parser/astnodes/PHPDocMethodTag.java| 20 .../php/editor/parser/astnodes/PHPDocTypeTag.java | 34 +++--- .../completion/documentation/arrayReturnType.php | 14 ++- ...turnType.php.testArrayReturnTypeWithTab_01.html | 9 ++ ...turnType.php.testArrayReturnTypeWithTab_02.html | 9 ++ testFunctionIntersectionTypeWithoutPhpDoc.html | 2 +- ...tPhpDoc.php.testFunctionTypedWithoutPhpDoc.html | 2 +- ...Doc.php.testFunctionUnionTypeWithoutPhpDoc.html | 2 +- ...hp.testMethodIntersectionTypeWithoutPhpDoc.html | 2 +- ...oc.php.testMethodNullableTypeWithoutPhpDoc.html | 2 +- ...hpDoc.php.testMethodUnionTypeWithoutPhpDoc.html | 2 +- .../completion/documentation/php82/dnfTypes.php| 101 + .../php82/dnfTypes.php.testDNFTypesField.html | 9 ++ .../dnfTypes.php.testDNFTypesInheritdocMethod.html | 15 +++ .../php82/dnfTypes.php.testDNFTypesMethod.html | 14 +++ .../php82/dnfTypes.php.testDNFTypesMethodTag.html | 14 +++ .../dnfTypes.php.testDNFTypesPhpdocField.html | 9 ++ .../dnfTypes.php.testDNFTypesPhpdocMethod.html | 16 +++ ...dnfTypes.php.testDNFTypesPhpdocStaticField.html | 9 ++ ...nfTypes.php.testDNFTypesPhpdocStaticMethod.html | 16 +++ .../dnfTypes.php.testDNFTypesPropertyTag.html | 6 ++ .../dnfTypes.php.testDNFTypesStaticField.html | 9 ++ .../dnfTypes.php.testDNFTypesStaticMethod.html | 14 +++ .../dnfTypes.php.testDNFTypesStaticMethodTag.html | 14 +++ .../editor/completion/PHPCCDocumentationTest.java | 56 ++ 26 files changed, 419 insertions(+), 101 deletions(-) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/completion/DocRenderer.java b/php/php.editor/src/org/netbeans/modules/php/editor/completion/DocRenderer.java index c16340c68a..5bfc5d23da 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/completion/DocRenderer.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/completion/DocRenderer.java @@ -91,7 +91,6 @@ import org.netbeans.modules.php.editor.parser.astnodes.PHPDocBlock; import org.netbeans.modules.php.editor.parser.astnodes.PHPDocMethodTag; import org.netbeans.modules.php.editor.parser.astnodes.PHPDocNode; import org.netbeans.modules.php.editor.parser.astnodes.PHPDocTag; -import org.netbeans.modules.php.editor.parser.astnodes.PHPDocTypeNode; import org.netbeans.modules.php.editor.parser.astnodes.PHPDocTypeTag; import org.netbeans.modules.php.editor.parser.astnodes.PHPDocVarTypeTag; import org.netbeans.modules.php.editor.parser.astnodes.Program; @@ -366,7 +365,12 @@ final class DocRenderer { } else { if (node instanceof PHPDocVarTypeTag) { PHPDocVarTypeTag varTypeTag = (PHPDocVarTypeTag) node; -String type = composeType(varTypeTag.getTypes(), getTypeKind(varTypeTag)); +// e.g. @property (A)|C $property something +String[] values = CodeUtils.WHITE_SPACES_PATTERN.split(varTypeTag.getValue().trim(), 2); +String type = ""; // NOI18N +if (!values[0].startsWith("$")) { // NOI18N +type = putTypeSeparatorBetweenWhitespaces(values[0]); +} phpDoc.append(processPhpDoc(String.format("%sType:%s", // NOI18N varTypeTag.getDocumentation(), type))); @@ -388,14 +392,12 @@ final class DocRenderer { description = processPhpDoc(description); } -if (methodTag.getParameters() != null && methodTag.getParameters().size() > 0) { +if (methodTag.getParameters() != null && !methodTag.getParameters().isEmpty()) { for (PHPDocVarTypeTag tag : methodTag.getParameters()) { params.append(composeParameterLine(tag)); } } - - returnValue.append(composeTypesAndDescription(methodTag.getTypes(), null, methodTag)); - + returnValue.append(composeTypesAndDescription(putTypeSeparatorBetweenWhitespaces(methodTag.getReturnType()), null)); phpDoc.appen
(netbeans) 07/07: PHP 8.2 Support: Disjunctive Normal Form Types (Part 8)
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a commit to branch php-nb21-features in repository https://gitbox.apache.org/repos/asf/netbeans.git commit b0a98ffdffee5b331c39c91188a2a327b3e10dbb Author: Junichi Yamamoto AuthorDate: Mon Oct 16 11:57:08 2023 +0900 PHP 8.2 Support: Disjunctive Normal Form Types (Part 8) - https://github.com/apache/netbeans/issues/4725 - https://wiki.php.net/rfc/dnf_types - Fix the formatter(Prevent adding `WHITESPACE_BEFORE_METHOD_DEC_PAREN` twice) ```php // e.g. the following case has "((" function example((X)|Z $param): void {} ``` - Add a unit test --- .../modules/php/editor/indent/FormatVisitor.java | 5 +- .../testfiles/formatting/php82/dnfTypes_01.php | 190 ++ .../formatting/php82/dnfTypes_01.php.formatted | 281 + .../php/editor/indent/PHPFormatterTest.java| 5 + 4 files changed, 480 insertions(+), 1 deletion(-) 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 c03939e031..2913ec7a66 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 @@ -1465,13 +1465,16 @@ public class FormatVisitor extends DefaultVisitor { scan(node.getAttributes()); scan(node.getFunctionName()); +// e.g. function paramHasDNFType((X)|Z $test): void {} +boolean addedOpenParen = false; // #270903 add indent while (ts.moveNext() && (ts.token().id() == PHPTokenId.WHITESPACE || isComment(ts.token()) -|| isOpenParen(ts.token( { +|| (isOpenParen(ts.token()) && !addedOpenParen))) { addFormatToken(formatTokens); if (isOpenParen(ts.token())) { formatTokens.add(new FormatToken.IndentToken(ts.offset() + ts.token().length(), options.continualIndentSize)); +addedOpenParen = true; } } ts.movePrevious(); diff --git a/php/php.editor/test/unit/data/testfiles/formatting/php82/dnfTypes_01.php b/php/php.editor/test/unit/data/testfiles/formatting/php82/dnfTypes_01.php new file mode 100644 index 00..7fa34460fa --- /dev/null +++ b/php/php.editor/test/unit/data/testfiles/formatting/php82/dnfTypes_01.php @@ -0,0 +1,190 @@ +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 ClassX { +const IMPLICIT_X_CONSTANT = "implicit constant"; +public const PUBLIC_X_CONSTANT = "public constant"; +private const PRIVATE_X_CONSTANT = "private constant"; +protected const PROTECTED_X_CONSTANT = "protected constant"; +public (ClassY & ClassZ) | ClassX $publicXField; +private (ClassX)|(ClassY)|ClassX $privateXField; +protected ClassX|(ClassY)|ClassY $protectedXField; +public static (ClassY)|ClassX $publicStaticXField; +private static (ClassY)|ClassY $privateStaticXField; +protected static (ClassY) | ClassX|ClassY $protectedStaticXField; + +public function publicXMethod((ClassY)|ClassX $param1): ClassX|(ClassY) {} + private function privateMXethod(ClassZ|(ClassY)|ClassX $param1 = null): (ClassY)|ClassX {} + protected function protectedXMethod( (ClassY & ClassZ) |(ClassX ) $param1): (ClassY)|(ClassX) {} +public static function publicStaticXMethod(ClassX | (ClassY & ClassZ) $param1, int $param2): (ClassY)|ClassX {} + private static function privateStaticXMethod(int $param1, (ClassX)|ClassZ $param2): ClassX|(ClassY){} +protected static function protectedStaticXMethod(ClassX|null $param1, (ClassX)|null $param2 = null): (ClassY)|ClassX {} +} + +class ClassY { +const IMPLICIT_Y_CONSTANT = "implicit constant"; +public const PUBLIC_Y_CONSTANT = "public constant"; +private const PRIVATE_Y_CONSTANT = "private constant"; +protected const PROTECTED_Y_CONSTANT = "protected constant"; +public (ClassY)|ClassX $publicYField; + private (ClassX)|(ClassY)|ClassX $privateYField; +protected ClassX|(ClassY)|ClassY $protectedYField; +public static (ClassY& ClassZ)|ClassX $publicStaticYField; +private static (ClassY)|ClassY $privateStaticYField; +protected static (ClassY)|ClassX|ClassY $protectedStaticYField; + +public function publicYMethod((ClassY)| ClassX $param1, (ClassY)|ClassX|(ClassX) $param2): ClassX|(ClassY) {} +private
(netbeans) 03/07: PHP 8.2 Support: Disjunctive Normal Form Types (Part 4)
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a commit to branch php-nb21-features in repository https://gitbox.apache.org/repos/asf/netbeans.git commit ab297022ed085f8486337bc9803f650350a68caf Author: Junichi Yamamoto AuthorDate: Thu Sep 28 22:48:23 2023 +0900 PHP 8.2 Support: Disjunctive Normal Form Types (Part 4) - https://github.com/apache/netbeans/issues/4725 - https://wiki.php.net/rfc/dnf_types - Fix DNF field types for the navigator --- .../org/netbeans/modules/php/editor/CodeUtils.java | 1 + .../modules/php/editor/csl/NavigatorScanner.java | 19 ++ .../php/editor/model/impl/FieldElementImpl.java| 11 +--- .../php/editor/model/impl/ModelVisitor.java| 75 +- .../modules/php/editor/model/impl/Type.java| 1 + .../php/editor/model/impl/VariousUtils.java| 14 .../structure/deprecatedTypedFields.pass | 8 +-- .../php82/deprecatedDnfFieldTypes_01.pass | 23 +++ .../structure/php82/dnfFieldTypes.pass | 23 +++ .../structure/php82/deprecatedDnfFieldTypes_01.php | 58 + .../testfiles/structure/php82/dnfFieldTypes.php| 55 .../php/editor/csl/NavigatorDeprecatedTest.java| 4 ++ .../modules/php/editor/csl/NavigatorTest.java | 4 ++ 13 files changed, 252 insertions(+), 44 deletions(-) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java b/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java index ab54785743..746fecc67a 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java @@ -90,6 +90,7 @@ public final class CodeUtils { public static final String ELLIPSIS = "..."; // NOI18N public static final Pattern WHITE_SPACES_PATTERN = Pattern.compile("\\s+"); // NOI18N +public static final Pattern SPLIT_TYPES_PATTERN = Pattern.compile("[()|&]"); // NOI18N private static final Logger LOGGER = Logger.getLogger(CodeUtils.class.getName()); diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/csl/NavigatorScanner.java b/php/php.editor/src/org/netbeans/modules/php/editor/csl/NavigatorScanner.java index 3eed34cc26..a03c7c80f5 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/csl/NavigatorScanner.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/csl/NavigatorScanner.java @@ -481,7 +481,7 @@ public final class NavigatorScanner { if (declaredType == null) { return; } -if (isReturn) { +if (isReturn || modelElement instanceof FieldElement) { formatter.appendHtml(FONT_GRAY_COLOR + ":"); // NOI18N } else { formatter.appendHtml(FONT_GRAY_COLOR); @@ -508,7 +508,7 @@ public final class NavigatorScanner { if (sb.length() > 0) { processTypeName(sb, modelElement, formatter); } -if (!isReturn) { +if (!isReturn && modelElement instanceof FunctionScope) { // parameter formatter.appendText(" "); // NOI18N } formatter.appendHtml(CLOSE_FONT); @@ -606,19 +606,8 @@ public final class NavigatorScanner { if (field.isDeprecated()) { formatter.deprecated(false); } -Collection types = field.getDefaultTypeNames(); -boolean isIntersectionType = field.getDefaultType() != null && field.getDefaultType().contains(Type.SEPARATOR_INTERSECTION); -if (!types.isEmpty()) { -formatter.appendHtml(FONT_GRAY_COLOR + ":"); //NOI18N -int i = 0; -for (String type : types) { -i++; -if (i > 1) { - formatter.appendText(Type.getTypeSeparator(isIntersectionType)); -} -processTypeName(type, field, formatter); -} -formatter.appendHtml(CLOSE_FONT); +if (StringUtils.hasText(field.getDefaultType())) { +processDeclaredType(field, formatter, field.getDefaultType(), false); } return formatter.getText(); } diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/FieldElementImpl.java b/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/FieldElementImpl.java index c258cdc3bb..e3d68b1494 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/FieldElementImpl.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/FieldElementImpl.java @@ -252,16 +252,7 @@ class FieldElementImpl extends ScopeImpl implements FieldElement { @Override public Collection getDefaultTypeNa
(netbeans) 02/07: PHP 8.2 Support: Disjunctive Normal Form Types (Part 3)
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a commit to branch php-nb21-features in repository https://gitbox.apache.org/repos/asf/netbeans.git commit d564b40f39bb3c6248ec95f560319c074d81fd11 Author: Junichi Yamamoto AuthorDate: Thu Sep 28 09:08:23 2023 +0900 PHP 8.2 Support: Disjunctive Normal Form Types (Part 3) - https://github.com/apache/netbeans/issues/4725 - https://wiki.php.net/rfc/dnf_types - Fix DNF parameter types for the navigator - The following cases are incorrect syntax for `@method` tag ``` @method int i() i($a = array()) Comment 10 ``` - See: https://docs.phpdoc.org/3.0/guide/references/phpdoc/tags/method.html#method - So, disable `PHPCodeCompletion201870Test` and `PHPCodeCompletion203294Test` --- .../org/netbeans/modules/php/editor/CodeUtils.java | 4 + .../php/editor/api/elements/ParameterElement.java | 4 + .../php/editor/completion/PHPCompletionItem.java | 2 + .../modules/php/editor/csl/NavigatorScanner.java | 61 ++--- .../php/editor/elements/MethodElementImpl.java | 2 +- .../php/editor/elements/ParameterElementImpl.java | 39 ++- .../modules/php/editor/index/PHPIndexer.java | 2 +- .../modules/php/editor/model/Parameter.java| 6 + .../php/editor/model/impl/FunctionScopeImpl.java | 2 +- .../php/editor/model/impl/ParameterImpl.java | 33 ++- .../php/editor/model/impl/VariousUtils.java| 20 +- .../editor/model/nodes/FormalParameterInfo.java| 19 +- .../model/nodes/FunctionDeclarationInfo.java | 3 +- .../model/nodes/LambdaFunctionDeclarationInfo.java | 2 +- .../model/nodes/MagicMethodDeclarationInfo.java| 25 +- .../editor/model/nodes/MethodDeclarationInfo.java | 3 +- .../php/editor/parser/PHPDocCommentParser.java | 48 +++- .../deprecatedTypesForNullableTypes_01.pass| 2 +- .../deprecatedTypesForNullableTypes_02.pass| 2 +- .../php82/deprecatedDnfParameterTypes_01.pass | 15 ++ .../NavigatorTest/structure/nullableTypes_01.pass | 2 +- .../NavigatorTest/structure/nullableTypes_02.pass | 2 +- .../structure/php82/dnfParameterTypes.pass | 26 ++ .../index/testGetEnums/testGetEnums.php.indexed| 4 +- .../testGetFunctions/testGetFunctions.php.indexed | 2 +- .../testIssue240824/testIssue240824.php.indexed| 2 +- .../testNullableTypesForFunctions.php.indexed | 4 +- .../testNullableTypesForMethods.php.indexed| 8 +- ...stPHP80ConstructorPropertyPromotion.php.indexed | 20 +- .../testPHP80UnionTypesFunctions.php.indexed | 12 +- .../testPHP80UnionTypesTypes.php.indexed | 16 +- .../testPHP81PureIntersectionTypes.php.indexed | 16 +- .../testPHP82DNFParameterTypes.php | 69 + .../testPHP82DNFParameterTypes.php.indexed | 281 + .../testPHP82DNFReturnTypes.php.indexed| 2 +- .../php82/deprecatedDnfParameterTypes_01.php | 58 + .../structure/php82/dnfParameterTypes.php | 69 + .../completion/PHPCodeCompletion201870Test.java| 5 +- .../completion/PHPCodeCompletion203294Test.java| 5 +- .../php/editor/csl/NavigatorDeprecatedTest.java| 4 + .../modules/php/editor/csl/NavigatorTest.java | 4 + .../modules/php/editor/index/PHPIndexTest.java | 4 + 42 files changed, 796 insertions(+), 113 deletions(-) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java b/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java index e18311e208..ab54785743 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java @@ -25,6 +25,7 @@ import java.util.LinkedList; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; +import java.util.regex.Pattern; import javax.swing.text.Document; import org.netbeans.api.annotations.common.CheckForNull; import org.netbeans.api.annotations.common.NonNull; @@ -87,6 +88,9 @@ public final class CodeUtils { public static final String STATIC_METHOD_TYPE_PREFIX = "@static.mtd:"; // NOI18N public static final String NULLABLE_TYPE_PREFIX = "?"; // NOI18N public static final String ELLIPSIS = "..."; // NOI18N + +public static final Pattern WHITE_SPACES_PATTERN = Pattern.compile("\\s+"); // NOI18N + private static final Logger LOGGER = Logger.getLogger(CodeUtils.class.getName()); private CodeUtils() { diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/api/elements/ParameterElement.java b/php/php.editor/src/org/netbeans/modules/php/editor/api/elements/ParameterElement.java index 389aeebc95..7993e50ac2 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/api/elements/ParameterElement.java +++ b/php/php.editor/src/org/netbeans/modules/php/e
[netbeans] branch php-nb21-features updated (4086bd3bd6 -> 69feae54c1)
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a change to branch php-nb21-features in repository https://gitbox.apache.org/repos/asf/netbeans.git from 4086bd3bd6 Update netbeans_bug_report.yml for NB20 rc new 505715ac92 PHP 8.2 Support: Disjunctive Normal Form Types (Part 2) new d686d1edf8 PHP 8.2 Support: Disjunctive Normal Form Types (Part 3) new 46f2330137 PHP 8.2 Support: Disjunctive Normal Form Types (Part 4) new 27829fa56d PHP 8.2 Support: Disjunctive Normal Form Types (Part 5) new 7832f690ec PHP 8.2 Support: Disjunctive Normal Form Types (Part 6) new b3b4694f47 PHP 8.2 Support: Disjunctive Normal Form Types (Part 7) new 3ffd6159f2 PHP 8.2 Support: Disjunctive Normal Form Types (Part 8) new 69feae54c1 Merge pull request #6569 from junichi11/php82-dnf-types The 9211 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: .../org/netbeans/modules/php/editor/CodeUtils.java | 96 -- .../modules/php/editor/api/QualifiedName.java | 10 +- .../php/editor/api/elements/AliasedFunction.java | 5 + .../editor/api/elements/BaseFunctionElement.java | 6 + .../php/editor/api/elements/FieldElement.java | 1 + .../php/editor/api/elements/ParameterElement.java | 4 + .../modules/php/editor/completion/DocRenderer.java | 120 +++- .../php/editor/completion/PHPCompletionItem.java | 6 + .../modules/php/editor/csl/NavigatorScanner.java | 99 +++--- .../elements/BaseFunctionElementSupport.java | 25 +- .../php/editor/elements/FieldElementImpl.java | 32 +- .../php/editor/elements/FunctionElementImpl.java | 20 ++ .../php/editor/elements/MethodElementImpl.java | 44 ++- .../php/editor/elements/ParameterElementImpl.java | 73 +++-- .../php/editor/elements/TypeResolverImpl.java | 4 +- .../modules/php/editor/indent/FormatVisitor.java | 5 +- .../modules/php/editor/index/PHPIndexer.java | 2 +- .../modules/php/editor/model/FunctionScope.java| 1 + .../modules/php/editor/model/Parameter.java| 6 + .../php/editor/model/impl/FieldElementImpl.java| 13 +- .../php/editor/model/impl/FunctionScopeImpl.java | 93 +++--- .../php/editor/model/impl/MethodScopeImpl.java | 7 + .../php/editor/model/impl/ModelVisitor.java| 75 - .../php/editor/model/impl/ParameterImpl.java | 33 +- .../modules/php/editor/model/impl/Type.java| 42 ++- .../php/editor/model/impl/VariousUtils.java| 41 ++- .../editor/model/nodes/FormalParameterInfo.java| 19 +- .../model/nodes/FunctionDeclarationInfo.java | 3 +- .../model/nodes/LambdaFunctionDeclarationInfo.java | 2 +- .../model/nodes/MagicMethodDeclarationInfo.java| 25 +- .../editor/model/nodes/MethodDeclarationInfo.java | 3 +- .../modules/php/editor/parser/ASTPHP5Scanner.java | 316 ++- .../php/editor/parser/PHPDocCommentParser.java | 48 ++- .../php/editor/parser/PHPVarCommentParser.java | 3 +- .../editor/parser/astnodes/PHPDocMethodTag.java| 20 ++ .../php/editor/parser/astnodes/PHPDocTypeTag.java | 34 +-- .../structure/deprecatedTypedFields.pass | 8 +- .../deprecatedTypesForNullableTypes_01.pass| 2 +- .../deprecatedTypesForNullableTypes_02.pass| 2 +- .../php82/deprecatedDnfFieldTypes_01.pass | 23 ++ .../php82/deprecatedDnfParameterTypes_01.pass | 15 + .../php82/deprecatedDnfReturnTypes_01.pass | 14 + .../NavigatorTest/structure/nullableTypes_01.pass | 2 +- .../NavigatorTest/structure/nullableTypes_02.pass | 2 +- .../structure/php82/dnfFieldTypes.pass | 23 ++ .../structure/php82/dnfParameterTypes.pass | 26 ++ .../structure/php82/dnfReturnTypes.pass| 14 + .../structure/pureIntersectionTypes.pass | 10 +- .../completion/documentation/arrayReturnType.php | 14 +- ...turnType.php.testArrayReturnTypeWithTab_01.html | 9 + ...turnType.php.testArrayReturnTypeWithTab_02.html | 9 + testFunctionIntersectionTypeWithoutPhpDoc.html | 2 +- ...tPhpDoc.php.testFunctionTypedWithoutPhpDoc.html | 2 +- ...Doc.php.testFunctionUnionTypeWithoutPhpDoc.html | 2 +- ...hp.testMethodIntersectionTypeWithoutPhpDoc.html | 2 +- ...oc.php.testMethodNullableTypeWithoutPhpDoc.html | 2 +- ...hpDoc.php.testMethodUnionTypeWithoutPhpDoc.html | 2 +- .../completion/documentation/php82/dnfTypes.php| 101 +++ .../php82/dnfTypes.php.testDNFTypesField.html | 9 + .../dnfTypes.php.testDNFTypesInheritdocMethod.html | 15 + .../php82/dnfTypes.php.testDNFTypesMethod.html | 14 + .../php82/dnfTypes.php.testDNFTypesMethodTag.html | 14 + .../dnfTypes.php.testDNFTypesPhpdocF
[netbeans] branch php-nb21-features created (now 4086bd3bd6)
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a change to branch php-nb21-features in repository https://gitbox.apache.org/repos/asf/netbeans.git at 4086bd3bd6 Update netbeans_bug_report.yml for NB20 rc No new revisions were added by this update. - 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 php82-support deleted (was 4e0486e4ad)
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a change to branch php82-support in repository https://gitbox.apache.org/repos/asf/netbeans.git was 4e0486e4ad Merge pull request #5302 from junichi11/php82-constants-in-traits The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository. - 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: Add "After Use Trait" to the formatting options #4685
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 161f65c97d Add "After Use Trait" to the formatting options #4685 new b0fc0d628e Merge pull request #6467 from junichi11/php-formatter-after-use-trait 161f65c97d is described below commit 161f65c97dd8d9dade357bb3621453bd81a5ec68 Author: Junichi Yamamoto AuthorDate: Fri Sep 15 14:44:56 2023 +0900 Add "After Use Trait" to the formatting options #4685 - https://github.com/apache/netbeans/issues/4685 - Add "After Use Trait" option - Add unit tests --- .../modules/php/editor/indent/CodeStyle.java | 4 ++ .../modules/php/editor/indent/FmtOptions.java | 2 + .../modules/php/editor/indent/FormatToken.java | 1 + .../modules/php/editor/indent/FormatVisitor.java | 11 +++ .../modules/php/editor/indent/TokenFormatter.java | 6 ++ .../modules/php/editor/indent/ui/Bundle.properties | 2 + .../php/editor/indent/ui/FmtBlankLines.form| 78 +- .../php/editor/indent/ui/FmtBlankLines.java| 71 .../formatting/blankLines/AfterUseTrait_01.php | 52 +++ ...php.testAfterUseTraitHasBlankLine_01a.formatted | 57 ...php.testAfterUseTraitHasBlankLine_01b.formatted | 62 + php.testAfterUseTraitNoBlankLine_01a.formatted | 55 +++ php.testAfterUseTraitNoBlankLine_01b.formatted | 62 + .../editor/indent/PHPFormatterBlankLinesTest.java | 40 +++ 14 files changed, 443 insertions(+), 60 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 a1ba761f73..885c6ff243 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 @@ -172,6 +172,10 @@ public final class CodeStyle { return preferences.getInt(BLANK_LINES_BEFORE_USE_TRAIT, getDefaultAsInt(BLANK_LINES_BEFORE_USE_TRAIT)); } +public int getBlankLinesAfterUseTrait() { +return preferences.getInt(BLANK_LINES_AFTER_USE_TRAIT, getDefaultAsInt(BLANK_LINES_AFTER_USE_TRAIT)); +} + public int getBlankLinesAfterUse() { return preferences.getInt(BLANK_LINES_AFTER_USE, getDefaultAsInt(BLANK_LINES_AFTER_USE)); } 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 24d05c20a4..5ba623e44a 100644 --- 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 @@ -94,6 +94,7 @@ public final class FmtOptions { public static final String BLANK_LINES_AFTER_NAMESPACE = "blankLinesAfterNamespace"; //NOI18N public static final String BLANK_LINES_BEFORE_USE = "blankLinesBeforeUse"; //NOI18N public static final String BLANK_LINES_BEFORE_USE_TRAIT = "blankLinesBeforeUseTrait"; //NOI18N +public static final String BLANK_LINES_AFTER_USE_TRAIT = "blankLinesAfterUseTrait"; //NOI18N public static final String BLANK_LINES_AFTER_USE = "blankLinesAfterUse"; //NOI18N public static final String BLANK_LINES_BETWEEN_USE_TYPES = "blankLinesBetweenUseType"; //NOI18N public static final String BLANK_LINES_BEFORE_CLASS = "blankLinesBeforeClass"; //NOI18N @@ -289,6 +290,7 @@ public final class FmtOptions { {BLANK_LINES_AFTER_NAMESPACE, "1"}, //NOI18N {BLANK_LINES_BEFORE_USE, "1"}, //NOI18N {BLANK_LINES_BEFORE_USE_TRAIT, "1"}, //NOI18N +{BLANK_LINES_AFTER_USE_TRAIT, "1"}, //NOI18N {BLANK_LINES_AFTER_USE, "1"}, //NOI18N {BLANK_LINES_BETWEEN_USE_TYPES, "0"}, //NOI18N {BLANK_LINES_BEFORE_CLASS, "1"}, //NOI18N diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/indent/FormatToken.java b/php/php.editor/src/org/netbeans/modules/php/editor/indent/FormatToken.java index 4f464a826f..ec0d6cda7f 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/indent/FormatToken.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/indent/FormatToken.java @@ -103,6 +103,7 @@ public class FormatToken { WHITESPACE_BEFORE_OTHER_RIGHT_BRACE, WHITESPACE_BEFORE_USES_PART, WHITESPACE_BEFORE_USE_TRAIT, +WHITESPACE_AFTER_USE_TRAIT, WHITESPACE_BEFORE_USE_TRAIT_PART, WHITESPACE_BEFORE_USE_TRAIT_BODY_LEFT_BRACE, WHITESPACE_BEFORE_US
[netbeans] branch master updated: Fix wrong `IncorectNamedArgumentHintError` #6432
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 4a046ade48 Fix wrong `IncorectNamedArgumentHintError` #6432 new 841a4e82ab Merge pull request #6437 from junichi11/php-gh-6432-named-args-after-unpacking 4a046ade48 is described below commit 4a046ade489ed39c85ccb45f9e0a3c1e3c59efdb Author: Junichi Yamamoto AuthorDate: Tue Sep 12 13:36:20 2023 +0900 Fix wrong `IncorectNamedArgumentHintError` #6432 - https://github.com/apache/netbeans/issues/6432 - Show errors when argument uppacking is used after named arguments ```php testUnpackingAfterNamed.php} | 49 -- ...ingAfterNamed.php.testUnpackingAfterNamed.hints | 30 +++ .../IncorrectNamedArgumentsHintErrorTest.java | 4 +- 5 files changed, 74 insertions(+), 95 deletions(-) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/verification/IncorrectNamedArgumentsHintError.java b/php/php.editor/src/org/netbeans/modules/php/editor/verification/IncorrectNamedArgumentsHintError.java index fd5239bb5b..910240ab8a 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/verification/IncorrectNamedArgumentsHintError.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/verification/IncorrectNamedArgumentsHintError.java @@ -58,7 +58,7 @@ public class IncorrectNamedArgumentsHintError extends HintErrorRule { @NbBundle.Messages({ "# {0} - argument name", "IncorrectNamedArguments.desc.duplicate.name=Duplicate argument name: \"{0}\" already exists.", - "IncorrectNamedArguments.desc.combine.named.argument.and.argument.unpacking=Can't combine named arguments(name: arg) and argument unpacking(...).", + "IncorrectNamedArguments.desc.argument.unpacking.after.named.argument=Can't use argument unpacking(...) after named argument(name: arg).", "IncorrectNamedArguments.desc.positional.arguments.after.named.argument=Can't use positional argument after named argument.", }) public void invoke(PHPRuleContext context, List hints) { @@ -80,12 +80,11 @@ public class IncorrectNamedArgumentsHintError extends HintErrorRule { } addHint(argument, Bundle.IncorrectNamedArguments_desc_duplicate_name(argument.getParameterName().getName()), hints); } -for (Map.Entry entry : checkVisitor.getCombinedNamedArgumentsWithArgumentUnpacking().entrySet()) { +for (Variadic variadic : checkVisitor.getArgumentUnpackingAfterNamedArgument()) { if (CancelSupport.getDefault().isCancelled()) { return; } -addHint(entry.getKey(), Bundle.IncorrectNamedArguments_desc_combine_named_argument_and_argument_unpacking(), hints); -addHint(entry.getValue(), Bundle.IncorrectNamedArguments_desc_combine_named_argument_and_argument_unpacking(), hints); +addHint(variadic, Bundle.IncorrectNamedArguments_desc_argument_unpacking_after_named_argument(), hints); } for (Expression argument : checkVisitor.getArgumentsAfterNamedArgument()) { if (CancelSupport.getDefault().isCancelled()) { @@ -115,7 +114,7 @@ public class IncorrectNamedArgumentsHintError extends HintErrorRule { private static final class CheckVisitor extends DefaultVisitor { private final Set duplicateNames = new HashSet<>(); -private final Map combinedNamedArgumentsWithArgumentUnpacking = new HashMap<>(); +private final Set argumentUnpackingAfterNamedArgument = new HashSet<>(); private final Set argumentsAfterNamedArgument = new HashSet<>(); @Override @@ -152,7 +151,6 @@ public class IncorrectNamedArgumentsHintError extends HintErrorRule { } Set names = new HashSet<>(); NamedArgument firstNamedArgument = null; -Variadic variadic = null; for (Expression argument : arguments) { if (CancelSupport.getDefault().isCancelled()) { return; @@ -173,8 +171,9 @@ public class IncorrectNamedArgumentsHintError extends HintErrorRule { names.add(name); } } else if (argument instanceof Variadic) { -if (variadic == null) { -variadic = (Variadic) argument; +if (firstNamedArgument != null) { +// e.g. (a: 'arg', ...[]) +argumentUnpackingAfterNamedArgument.add((Variadic) argument); } } else { if (firstNamedArgument != null) {
[netbeans] branch master updated: PHP: In the navigator, inherited members are displayed in a different color, similar to how it is done in java.
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 fde8abfa47 PHP: In the navigator, inherited members are displayed in a different color, similar to how it is done in java. new 0322fce7c3 Merge pull request #6393 from troizet/navigator_php_color_inherited_members fde8abfa47 is described below commit fde8abfa47e4e2763ba1d47616f28dfdaedb79bc Author: Alexey Borokhvostov AuthorDate: Mon Aug 7 21:45:49 2023 +0700 PHP: In the navigator, inherited members are displayed in a different color, similar to how it is done in java. --- .../modules/php/editor/csl/NavigatorScanner.java | 71 .../structure/deprecatedInheritedDeclarations.pass | 54 .../structure/nb3362/traitedClass_01.pass | 46 +- .../structure/nb3362/traitedClass_02.pass | 32 +++ .../structure/nb3362/traitedTrait_01.pass | 24 +++--- .../structure/nb3362/traitedTrait_02.pass | 20 ++--- .../structure/php82/constantsInTraits.pass | 28 +++ .../structure/deprecatedInheritedDeclarations.php | 97 ++ .../php/editor/csl/NavigatorDeprecatedTest.java| 4 + 9 files changed, 284 insertions(+), 92 deletions(-) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/csl/NavigatorScanner.java b/php/php.editor/src/org/netbeans/modules/php/editor/csl/NavigatorScanner.java index 563c3c8921..2d36ab4357 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/csl/NavigatorScanner.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/csl/NavigatorScanner.java @@ -72,6 +72,7 @@ public final class NavigatorScanner { private static final Logger LOGGER = Logger.getLogger(NavigatorScanner.class.getName()); private static final String FONT_GRAY_COLOR = ""; //NOI18N +private static final String FONT_INHERITED_COLOR = ""; //NOI18N private static final String CLOSE_FONT = ""; //NOI18N private static ImageIcon interfaceIcon = null; private static ImageIcon traitIcon = null; @@ -362,11 +363,45 @@ public final class NavigatorScanner { } } +protected void appendConstantDescription(ConstantElement constant, HtmlFormatter formatter) { +appendConstantDescription(constant, formatter, false); +} + +protected void appendConstantDescription(ConstantElement constant, HtmlFormatter formatter, boolean isInherited) { +if (constant.isDeprecated()) { +formatter.deprecated(true); +} +if (isInherited) { +formatter.appendHtml(FONT_INHERITED_COLOR); +} +formatter.appendText(getName()); +if (isInherited) { +formatter.appendHtml(CLOSE_FONT); +} +if (constant.isDeprecated()) { +formatter.deprecated(false); +} +String value = constant.getValue(); +if (value != null) { +formatter.appendText(" "); //NOI18N +formatter.appendHtml(FONT_GRAY_COLOR); +formatter.appendText(value); +formatter.appendHtml(CLOSE_FONT); +} +} + protected void appendFunctionDescription(FunctionScope function, HtmlFormatter formatter) { +appendFunctionDescription(function, formatter, false); +} + +protected void appendFunctionDescription(FunctionScope function, HtmlFormatter formatter, boolean isInherited) { formatter.reset(); if (function == null) { return; } +if (isInherited) { +formatter.appendHtml(FONT_INHERITED_COLOR); +} if (function.isDeprecated()) { formatter.deprecated(true); } @@ -380,6 +415,9 @@ public final class NavigatorScanner { processParameters(function, formatter, parameters); } formatter.appendText(")"); //NOI18N +if (isInherited) { +formatter.appendHtml(CLOSE_FONT); +} Collection returnTypes = function.getReturnTypeNames(); if (!returnTypes.isEmpty()) { processReturnTypes(function, formatter, returnTypes); @@ -518,7 +556,13 @@ public final class NavigatorScanner { if (field.isDeprecated()) { formatter.deprecated(true); } +if (isInherited()) { +formatter.appendHtml(FONT_INHERITED_COLOR); +} formatter.appendText(field.getName()); +if (isInherited()) { +formatter.appendHtml(CLOSE_FONT);
[netbeans] branch master updated: Added support for exception breakpoints. #5434 Breakpoint_set and breakpoint_remove commands are used instead of breakpoint_update to change breakpoint state during d
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 5f1c9da3c5 Added support for exception breakpoints. #5434 Breakpoint_set and breakpoint_remove commands are used instead of breakpoint_update to change breakpoint state during debugging. Fixed a bug where the previous breakpoint was displayed as the current breakpoint if the current breakpoint was not found. new d507933d27 Merge pull request #6366 from troizet/exception_breakpoint 5f1c9da3c5 is described below commit 5f1c9da3c5f11cde0cbe11d251dfbd892b6ba0e1 Author: Alexey Borokhvostov AuthorDate: Sun Apr 9 19:50:03 2023 +0700 Added support for exception breakpoints. #5434 Breakpoint_set and breakpoint_remove commands are used instead of breakpoint_update to change breakpoint state during debugging. Fixed a bug where the previous breakpoint was displayed as the current breakpoint if the current breakpoint was not found. --- php/php.dbgp/licenseinfo.xml | 2 + php/php.dbgp/nbproject/project.xml | 17 ++ .../org.netbeans.spi.debugger.ui.BreakpointType| 1 + .../php/dbgp/breakpoints/BreakpointModel.java | 28 ++- .../dbgp/breakpoints/BreakpointRuntimeSetter.java | 7 +- .../php/dbgp/breakpoints/BreakpointsReader.java| 35 +++- .../modules/php/dbgp/breakpoints/Bundle.properties | 1 + .../breakpoints/DbgpExceptionBreakpointType.java | 66 +++ .../php/dbgp/breakpoints/ExceptionBreakpoint.java | 44 + .../modules/php/dbgp/breakpoints/Utils.java| 3 + .../php/dbgp/packets/BrkpntCommandBuilder.java | 8 + .../modules/php/dbgp/packets/BrkpntSetCommand.java | 2 +- .../modules/php/dbgp/packets/InitMessage.java | 6 +- .../netbeans/modules/php/dbgp/resources/class.png | Bin 0 -> 785 bytes .../netbeans/modules/php/dbgp/resources/layer.xml | 6 + .../modules/php/dbgp/resources/php16Key.png| Bin 0 -> 589 bytes .../netbeans/modules/php/dbgp/ui/Bundle.properties | 3 + .../php/dbgp/ui/DbgpExceptionBreakpointPanel.form | 101 ++ .../php/dbgp/ui/DbgpExceptionBreakpointPanel.java | 143 ++ .../completion/ExceptionClassNbDebugEditorKit.java | 31 +++ .../ui/completion/ExceptionCompletionItem.java | 210 + .../ui/completion/ExceptionCompletionProvider.java | 136 + 22 files changed, 832 insertions(+), 18 deletions(-) diff --git a/php/php.dbgp/licenseinfo.xml b/php/php.dbgp/licenseinfo.xml index bc74327931..e2e85decee 100644 --- a/php/php.dbgp/licenseinfo.xml +++ b/php/php.dbgp/licenseinfo.xml @@ -21,7 +21,9 @@ --> +src/org/netbeans/modules/php/dbgp/resources/class.png src/org/netbeans/modules/php/dbgp/resources/notice-glyph.gif +src/org/netbeans/modules/php/dbgp/resources/php16Key.png src/org/netbeans/modules/php/dbgp/resources/undefined.gif diff --git a/php/php.dbgp/nbproject/project.xml b/php/php.dbgp/nbproject/project.xml index 52a8070579..f5f5b12b93 100644 --- a/php/php.dbgp/nbproject/project.xml +++ b/php/php.dbgp/nbproject/project.xml @@ -87,6 +87,15 @@ 1.58 + + org.netbeans.modules.editor.completion + + + +1 +1.67 + + org.netbeans.modules.editor.document @@ -149,6 +158,14 @@ 9.0 + + org.netbeans.modules.parsing.indexing + + + +9.31 + + org.netbeans.modules.php.api.executable diff --git a/php/php.dbgp/src/META-INF/debugger/org.netbeans.spi.debugger.ui.BreakpointType b/php/php.dbgp/src/META-INF/debugger/org.netbeans.spi.debugger.ui.BreakpointType index 11de7f04d4..f5d02c2d83 100644 --- a/php/php.dbgp/src/META-INF/debugger/org.netbeans.spi.debugger.ui.BreakpointType +++ b/php/php.dbgp/src/META-INF/debugger/org.netbeans.spi.debugger.ui.BreakpointType @@ -1 +1,2 @@ org.netbeans.modules.php.dbgp.breakpoints.DbgpFunctionBreakpointType +org.netbeans.modules.php.dbgp.breakpoints.DbgpExceptionBreakpointType diff --git a/php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointModel.java b/php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointModel.java index 339522e91a..aea90c8684 100644 --- a/php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointModel.java +++ b/php/php.dbg
[netbeans] branch master updated: Fix code completion for fields with single line var doc #6359
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 86340d23dc Fix code completion for fields with single line var doc #6359 new c473ac3ded Merge pull request #6364 from junichi11/php-gh-6359-field-cc-with-single-line-vardoc 86340d23dc is described below commit 86340d23dc59dcd6360bed2e125969c70bdd8e70 Author: Junichi Yamamoto AuthorDate: Mon Aug 21 11:41:35 2023 +0900 Fix code completion for fields with single line var doc #6359 - https://github.com/apache/netbeans/issues/6359 - `/** @var Type $field */` is recognized as not `PHPDocBlock` but `PHPVarComment`, so, check it ```php // example class X { public function testX(): void {} } class Y { public function testY(): void {} } class GH6359 { /** @var X $testX */ protected $testX; /** @var X|Y $testXorY */ protected $testXorY; /** @var X $testXandY */ protected $testXandY; public function test(): void { $this->testX->testX(); $this->testXorY->testX(); $this->testXandY->testX(); } } ``` --- .../php/editor/model/impl/VariousUtils.java| 12 + .../testfiles/completion/lib/gh6359/gh6359.php | 42 .../lib/gh6359/gh6359.php.testGH6359_01.completion | 4 ++ .../lib/gh6359/gh6359.php.testGH6359_02.completion | 5 ++ .../lib/gh6359/gh6359.php.testGH6359_03.completion | 5 ++ .../completion/PHPCodeCompletionGH6359Test.java| 57 ++ 6 files changed, 125 insertions(+) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/VariousUtils.java b/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/VariousUtils.java index 47e02265e4..9f7ba9a6bd 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/VariousUtils.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/VariousUtils.java @@ -89,6 +89,7 @@ import org.netbeans.modules.php.editor.parser.astnodes.PHPDocBlock; import org.netbeans.modules.php.editor.parser.astnodes.PHPDocTag; import org.netbeans.modules.php.editor.parser.astnodes.PHPDocTypeNode; import org.netbeans.modules.php.editor.parser.astnodes.PHPDocVarTypeTag; +import org.netbeans.modules.php.editor.parser.astnodes.PHPVarComment; import org.netbeans.modules.php.editor.parser.astnodes.ParenthesisExpression; import org.netbeans.modules.php.editor.parser.astnodes.Program; import org.netbeans.modules.php.editor.parser.astnodes.Reference; @@ -384,7 +385,18 @@ public final class VariousUtils { break; } } +} else if ((comment instanceof PHPVarComment) && PHPDocTag.Type.VAR == tagType) { +// GH-6359 +// /** @var Type $field */ +// private $field; +PHPVarComment varComment = (PHPVarComment) comment; +PHPDocVarTypeTag tag = varComment.getVariable(); +String[] parts = WS_PATTERN.split(tag.getValue().trim(), 3); // 3: @var Type $field +if (parts.length > 1) { +return parts[1]; +} } + return null; } diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/gh6359/gh6359.php b/php/php.editor/test/unit/data/testfiles/completion/lib/gh6359/gh6359.php new file mode 100644 index 00..c53bc705f8 --- /dev/null +++ b/php/php.editor/test/unit/data/testfiles/completion/lib/gh6359/gh6359.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. + */ +class X { +public function testX(): void {} +} + +class Y { +public function testY(): void {} +} + +class GH6359 { + +/** @var X $testX */ +protected $testX; +/** @var X|Y $testXorY */ +protected $testXorY; +/** @var X $testXandY */ +protected $testXandY; + +public function test(): void { +$this->testX->testX(); +$this->testXorY->testX(); +$this->testXandY->testX(); +} +} diff --git a/php/php.editor/test/unit/data/testfiles/completion/lib/gh6359/gh6359.php.testGH6359_01.completion b/php/php.editor/test/unit/data/testfiles/completion/lib/gh6359/gh6359.php.testGH6359_01.completion new file mode 100644 index 00..66058090b3 --- /dev/null +++ b/php/php.editor/test/unit/data/testfiles/completion/lib/gh6359/gh6359.php.testGH6
[netbeans] branch master updated: Fix the problem that typed fields marked as deprecated are not displayed as deprecated #6310
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 dfcd6e5a66 Fix the problem that typed fields marked as deprecated are not displayed as deprecated #6310 new 05ed416c12 Merge pull request #6321 from junichi11/php-gh-6310-deprecated-typed-fields dfcd6e5a66 is described below commit dfcd6e5a66f7a6bfc428bdf47e562fbc6cc96b8a Author: Junichi Yamamoto AuthorDate: Tue Aug 8 07:07:05 2023 +0900 Fix the problem that typed fields marked as deprecated are not displayed as deprecated #6310 - https://github.com/apache/netbeans/issues/6310 - Fix the `NodeRangeLocator`'s end offset when the node is the `SingleFieldDeclaration` because a start offset is the start offset of not a type but a variable name - Add unit tests --- .../modules/php/editor/parser/api/Utils.java | 45 +- .../editor/parser/astnodes/FieldsDeclaration.java | 2 +- .../structure/deprecatedTypedFields.pass | 30 .../deprecatedTypedFields.php | 155 + ...lds.php.testDeprecatedStaticTypedFields_01.html | 10 ++ ...lds.php.testDeprecatedStaticTypedFields_02.html | 10 ++ ...lds.php.testDeprecatedStaticTypedFields_03.html | 10 ++ ...lds.php.testDeprecatedStaticTypedFields_04.html | 10 ++ ...lds.php.testDeprecatedStaticTypedFields_05.html | 10 ++ ...lds.php.testDeprecatedStaticTypedFields_06.html | 10 ++ ...hp.testDeprecatedStaticTypedTraitFields_01.html | 10 ++ ...hp.testDeprecatedStaticTypedTraitFields_02.html | 10 ++ ...hp.testDeprecatedStaticTypedTraitFields_03.html | 10 ++ ...hp.testDeprecatedStaticTypedTraitFields_04.html | 10 ++ ...hp.testDeprecatedStaticTypedTraitFields_05.html | 10 ++ ...hp.testDeprecatedStaticTypedTraitFields_06.html | 10 ++ ...pedFields.php.testDeprecatedTypedFields_01.html | 10 ++ ...pedFields.php.testDeprecatedTypedFields_02.html | 10 ++ ...pedFields.php.testDeprecatedTypedFields_03.html | 10 ++ ...pedFields.php.testDeprecatedTypedFields_04.html | 10 ++ ...pedFields.php.testDeprecatedTypedFields_05.html | 10 ++ ...pedFields.php.testDeprecatedTypedFields_06.html | 10 ++ ...elds.php.testDeprecatedTypedTraitFields_01.html | 10 ++ ...elds.php.testDeprecatedTypedTraitFields_02.html | 10 ++ ...elds.php.testDeprecatedTypedTraitFields_03.html | 10 ++ ...elds.php.testDeprecatedTypedTraitFields_04.html | 10 ++ ...elds.php.testDeprecatedTypedTraitFields_05.html | 10 ++ ...elds.php.testDeprecatedTypedTraitFields_06.html | 10 ++ .../deprecatedTypedFields.php | 121 .../deprecatedTypedFields.php.semantic | 121 .../testfiles/structure/deprecatedTypedFields.php | 121 .../editor/completion/PHPCCDocumentationTest.java | 106 ++ ...DeprecatedTypedFieldsSemanticAnalysisTest.java} | 27 +--- .../php/editor/csl/NavigatorDeprecatedTest.java| 5 + 34 files changed, 944 insertions(+), 29 deletions(-) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/parser/api/Utils.java b/php/php.editor/src/org/netbeans/modules/php/editor/parser/api/Utils.java index 70a042f2f2..22aa07b897 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/parser/api/Utils.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/parser/api/Utils.java @@ -19,6 +19,7 @@ package org.netbeans.modules.php.editor.parser.api; import java.util.ArrayList; +import java.util.Iterator; import java.util.List; import org.netbeans.modules.csl.api.OffsetRange; import org.netbeans.modules.csl.spi.ParserResult; @@ -27,6 +28,7 @@ import org.netbeans.modules.php.editor.parser.PHPParseResult; import org.netbeans.modules.php.editor.parser.astnodes.ASTNode; import org.netbeans.modules.php.editor.parser.astnodes.ClassDeclaration; import org.netbeans.modules.php.editor.parser.astnodes.Comment; +import org.netbeans.modules.php.editor.parser.astnodes.Expression; import org.netbeans.modules.php.editor.parser.astnodes.FunctionName; import org.netbeans.modules.php.editor.parser.astnodes.Identifier; import org.netbeans.modules.php.editor.parser.astnodes.IntersectionType; @@ -39,6 +41,7 @@ import org.netbeans.modules.php.editor.parser.astnodes.PHPDocTypeTag; import org.netbeans.modules.php.editor.parser.astnodes.PHPDocVarTypeTag; import org.netbeans.modules.php.editor.parser.astnodes.Program; import org.netbeans.modules.php.editor.parser.astnodes.Scalar; +import org.netbeans.modules.php.editor.parser.astnodes.SingleFieldDeclaration; import org.netbeans.modules.php.editor.parser.astnodes.UnionType; import org.netbeans.modules.php.editor.parser.astnodes.Variable; import org.netbeans.modules.php.editor.parser.astnodes.visitors.DefaultTreePathVisitor; @@ -72,7 +75,7 @@ public final class Utils
[netbeans] branch master updated (fbd6ddd2fb -> 2b0637a876)
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 fbd6ddd2fb Merge pull request #6251 from junichi11/php-gh-6247-wrong-suggestion-for-fix-imports new 6e0a20ddc3 Improve IntroduceSuggestionTest new 4f3cda2ce8 Prevent NPE when IntroduceSuggestionHint generates a method #6258 new d94b06bfda Add unit tests for #6266 new 2b0637a876 Merge pull request #6269 from junichi11/php-gh-6258-npe-introduce-suggestion The 8991 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: .../editor/verification/IntroduceSuggestion.java | 10 +- .../{ => testEnumCase}/testEnumCase.php| 0 .../testEnumCase.php.testEnumCase_01.hints | 0 .../testEnumCase.php.testEnumCase_02.hints | 0 .../testEnumCase.php.testEnumCase_03.hints | 0 .../testEnumCase.php.testEnumCase_Fix01a.fixed}| 0 .../testEnumCase.php.testEnumCase_Fix01b.fixed}| 0 .../testEnumCase.php.testEnumCase_Fix02a.fixed}| 0 .../testEnumCase.php.testEnumCase_Fix02b.fixed}| 0 .../testEnumCase.php.testEnumCase_Fix03a.fixed}| 0 .../testEnumCase.php.testEnumCase_Fix03b.fixed}| 0 .../{ => testEnumMethods}/testEnumMethods.php | 0 .../testEnumMethods.php.testEnumMethods_01.hints | 0 .../testEnumMethods.php.testEnumMethods_02.hints | 0 .../testEnumMethods.php.testEnumMethods_03.hints | 0 .../testEnumMethods.php.testEnumMethods_04.hints | 0 .../testEnumMethods.php.testEnumMethods_05.hints | 0 .../testEnumMethods.php.testEnumMethods_06.hints | 0 ...estEnumMethods.php.testEnumMethods_Fix01.fixed} | 0 ...estEnumMethods.php.testEnumMethods_Fix02.fixed} | 0 ...estEnumMethods.php.testEnumMethods_Fix03.fixed} | 0 ...estEnumMethods.php.testEnumMethods_Fix04.fixed} | 0 ...estEnumMethods.php.testEnumMethods_Fix05.fixed} | 0 ...estEnumMethods.php.testEnumMethods_Fix06.fixed} | 0 .../{testEnumCase.php => testGH6258/TestClass.php} | 32 +- .../testGH6258_01.php} | 33 +- .../testGH6258_01.php.testGH6258_01.hints | 4 + .../testGH6258_01.php.testGH6258_01Fix.fixed} | 33 +- .../testGH6258_02.php} | 34 +-- .../testGH6258_02.php.testGH6258_02.hints | 4 + .../testGH6258_02.php.testGH6258_02Fix.fixed} | 34 +-- .../{testEnumCase.php => testGH6266/TestClass.php} | 32 +- .../testGH6266.php}| 35 +-- .../testGH6266.php.testGH6266_Const.hints | 4 + .../testGH6266.php.testGH6266_ConstFix.fixed} | 35 +-- .../testGH6266.php.testGH6266_Field.hints | 4 + .../testGH6266.php.testGH6266_FieldFix.fixed} | 35 +-- .../testGH6266.php.testGH6266_StaticField.hints| 4 + ...testGH6266.php.testGH6266_StaticFieldFix.fixed} | 35 +-- .../testGH6266_02.php} | 32 +- .../testIntroduceSuggestion.php| 0 ...Suggestion.php.testIntroduceSuggestion_01.hints | 4 + ...Suggestion.php.testIntroduceSuggestion_02.hints | 0 ...Suggestion.php.testIntroduceSuggestion_03.hints | 0 ...Suggestion.php.testIntroduceSuggestion_04.hints | 0 ...Suggestion.php.testIntroduceSuggestion_05.hints | 0 ...Suggestion.php.testIntroduceSuggestion_06.hints | 0 ...Suggestion.php.testIntroduceSuggestion_07.hints | 0 ...estion.php.testIntroduceSuggestion_Fix02.fixed} | 0 ...estion.php.testIntroduceSuggestion_Fix03.fixed} | 0 ...estion.php.testIntroduceSuggestion_Fix04.fixed} | 0 ...estion.php.testIntroduceSuggestion_Fix05.fixed} | 0 ...estion.php.testIntroduceSuggestion_Fix06.fixed} | 0 .../testIssue223842}/testIssue223842.php | 0 .../testIssue223842.php.testIssue223842.hints | 0 .../testIssue239277}/Issue239277.php | 0 .../testIssue239277}/testIssue239277.php | 0 .../testIssue239277.php.testIssue239277_01.hints | 0 .../testIssue239277.php.testIssue239277_02.hints | 0 .../testIssue241824}/testIssue241824.php | 0 .../testIssue241824.php.testIssue241824_01.hints | 0 .../testIssue241824.php.testIssue241824_02.hints | 0 .../testSpecialTypes/testSpecialTypes.php} | 0 .../testSpecialTypes.php.testSpecialTypes_01.hints | 0 .../testSpecialTypes.php.testSpecialTypes_02.hints | 0 .../testSpecialTypes.php.testSpecialTypes_03.hints | 0 .../testTrait/testTrait.php} | 0 .../testTrait.php.testTrait_Constant.hints | 0 .../testTrait/testTrait.php.testTrait_Field.hints | 4 + .../testTrait.php.testTrait_FixField.fixed}| 0 .../testTrait.php.testTr
[netbeans] branch master updated: Prevent getting an incorrect type if a return type is `static` with PHPDoc tag(`@return`) #6247
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 60461afab6 Prevent getting an incorrect type if a return type is `static` with PHPDoc tag(`@return`) #6247 new fbd6ddd2fb Merge pull request #6251 from junichi11/php-gh-6247-wrong-suggestion-for-fix-imports 60461afab6 is described below commit 60461afab6dd315ca55f4d1d63eb2bc526b904a5 Author: Junichi Yamamoto AuthorDate: Tue Jul 25 10:49:24 2023 +0900 Prevent getting an incorrect type if a return type is `static` with PHPDoc tag(`@return`) #6247 - https://github.com/apache/netbeans/issues/6247 - Ignore `static` only when a PHPDoc tag is `@method` - Add a unit test --- .../php/editor/parser/PHPDocCommentParser.java | 23 ++- .../testfiles/actions/testGH6247/testGH6247_01.php | 34 ++ .../testGH6247/testGH6247_01.php.importData| 12 .../php/editor/actions/ImportDataCreatorTest.java | 4 +++ 4 files changed, 65 insertions(+), 8 deletions(-) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/parser/PHPDocCommentParser.java b/php/php.editor/src/org/netbeans/modules/php/editor/parser/PHPDocCommentParser.java index 64c9c3417e..6ba3e14cbf 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/parser/PHPDocCommentParser.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/parser/PHPDocCommentParser.java @@ -202,8 +202,7 @@ public class PHPDocCommentParser { private PHPDocTag createTag(int start, int end, AnnotationParsedLine type, String description, String originalComment, int originalCommentStart) { final Map types = type.getTypes(); if (types.isEmpty()) { -boolean isReturnTag = type.equals(PHPDocTag.Type.RETURN); -List docTypes = findTypes(description, start, originalComment, originalCommentStart, isReturnTag); +List docTypes = findTypes(description, start, originalComment, originalCommentStart, type); if (PHP_DOC_VAR_TYPE_TAGS.contains(type)) { String variable = getVaribleName(description); PHPDocNode varibaleNode = null; @@ -252,16 +251,16 @@ public class PHPDocCommentParser { } private List findTypes(String description, int startDescription, String originalComment, int originalCommentStart) { -return findTypes(description, startDescription, originalComment, originalCommentStart, false); +return findTypes(description, startDescription, originalComment, originalCommentStart, PHPDocTypeTag.Type.PARAM); } -private List findTypes(String description, int startDescription, String originalComment, int originalCommentStart, boolean isReturnTag) { +private List findTypes(String description, int startDescription, String originalComment, int originalCommentStart, AnnotationParsedLine tagType) { if (StringUtils.isEmpty(description)) { return Collections.emptyList(); } List result = new ArrayList<>(); -for (String stype : getTypes(description, isReturnTag)) { +for (String stype : getTypes(description, tagType)) { stype = removeHTMLTags(stype); stype = sanitizeShapes(stype); int startDocNode = findStartOfDocNode(originalComment, originalCommentStart, stype, startDescription); @@ -288,13 +287,13 @@ public class PHPDocCommentParser { return result; } -private List getTypes(String description, boolean isReturnTag) { +private List getTypes(String description, AnnotationParsedLine tagType) { String[] tokens = description.trim().split("[ ]+"); //NOI18N -if (tokens.length > 0 && tokens[0].equals("static")) { // NOI18N +if (isMethodTag(tagType) && tokens.length > 0 && tokens[0].equals(Type.STATIC)) { tokens = Arrays.copyOfRange(tokens, 1, tokens.length); } ArrayList types = new ArrayList<>(); -if (tokens.length > 0 && (isReturnTag || !tokens[0].startsWith("$"))) { //NOI18N +if (tokens.length > 0 && (isReturnTag(tagType) || !tokens[0].startsWith("$"))) { //NOI18N if (tokens[0].indexOf('|') > -1 || tokens[0].indexOf('&') > -1) { String[] ttokens = tokens[0].split("[|&]"); //NOI18N for (String ttoken : ttokens) { @@ -473,6 +472,14 @@ public class PHPDocCommentParser { return result; } +private static boolean isReturnTag(AnnotationParsedLine type) { +return PHPDocTypeTag.Type.RETURN == type; +} + +private static boolean isMethodTag(AnnotationParsedLine type) { +return PHPDocTypeTag.Type.METHOD ==
[netbeans] branch master updated: Fixed gap between checkboxes in php project testing settings
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 30af44cb44 Fixed gap between checkboxes in php project testing settings new 28d308b400 Merge pull request #6381 from troizet/php_testing_settings_checkboxes 30af44cb44 is described below commit 30af44cb4487eaf827120fcd74dde5bb225be535 Author: Alexey Borokhvostov AuthorDate: Mon Aug 28 21:45:12 2023 +0700 Fixed gap between checkboxes in php project testing settings --- .../modules/php/project/ui/customizer/CustomizerTesting.java | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/php/php.project/src/org/netbeans/modules/php/project/ui/customizer/CustomizerTesting.java b/php/php.project/src/org/netbeans/modules/php/project/ui/customizer/CustomizerTesting.java index 1b80475ff4..41c6c6f603 100644 --- a/php/php.project/src/org/netbeans/modules/php/project/ui/customizer/CustomizerTesting.java +++ b/php/php.project/src/org/netbeans/modules/php/project/ui/customizer/CustomizerTesting.java @@ -133,7 +133,6 @@ public class CustomizerTesting extends JPanel { GroupLayout providersPanelLayout = new GroupLayout(providersPanel); GroupLayout.ParallelGroup horizontalGroup = providersPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING); GroupLayout.SequentialGroup verticalGroup = providersPanelLayout.createSequentialGroup(); -boolean first = true; final Collator collator = Collator.getInstance(); Collections.sort(allTestingProviders, new Comparator() { @Override @@ -150,11 +149,7 @@ public class CustomizerTesting extends JPanel { } horizontalGroup.addComponent(checkBox); verticalGroup.addComponent(checkBox); -if (first) { -first = false; -} else { - verticalGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED); -} + verticalGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED); } providersPanel.setLayout(providersPanelLayout); providersPanelLayout.setHorizontalGroup( - 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: Improved validation when creating a line breakpoint: - added check that the specified file is a php source file - added check that the specified line number is less
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 c88b994179 Improved validation when creating a line breakpoint: - added check that the specified file is a php source file - added check that the specified line number is less than the maximum line number in the file new fa5e96b52b Merge pull request #6241 from troizet/improve_validation_php_line_breakpoint c88b994179 is described below commit c88b994179c6ea9de72f3c2fdc3e7f6b53fb23ae Author: Alexey Borokhvostov AuthorDate: Fri Jul 21 18:43:17 2023 +0700 Improved validation when creating a line breakpoint: - added check that the specified file is a php source file - added check that the specified line number is less than the maximum line number in the file --- .../dbgp/ui/DbgpLineBreakpointCustomizerPanel.java | 103 + 1 file changed, 86 insertions(+), 17 deletions(-) diff --git a/php/php.dbgp/src/org/netbeans/modules/php/dbgp/ui/DbgpLineBreakpointCustomizerPanel.java b/php/php.dbgp/src/org/netbeans/modules/php/dbgp/ui/DbgpLineBreakpointCustomizerPanel.java index 0cc7903d94..4eb8eee752 100644 --- a/php/php.dbgp/src/org/netbeans/modules/php/dbgp/ui/DbgpLineBreakpointCustomizerPanel.java +++ b/php/php.dbgp/src/org/netbeans/modules/php/dbgp/ui/DbgpLineBreakpointCustomizerPanel.java @@ -21,32 +21,43 @@ package org.netbeans.modules.php.dbgp.ui; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import java.io.File; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.swing.DefaultComboBoxModel; import javax.swing.JPanel; import javax.swing.SwingUtilities; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; +import javax.swing.text.Document; +import javax.swing.text.StyledDocument; import org.netbeans.api.debugger.DebuggerManager; import org.netbeans.api.debugger.Properties; +import org.netbeans.modules.php.api.util.FileUtils; import org.netbeans.modules.php.dbgp.breakpoints.LineBreakpoint; import org.netbeans.modules.php.dbgp.breakpoints.Utils; import org.netbeans.spi.debugger.ui.Controller; import org.openide.DialogDisplayer; import org.openide.NotifyDescriptor; +import org.openide.cookies.EditorCookie; import org.openide.filesystems.FileObject; import org.openide.filesystems.FileUtil; +import org.openide.loaders.DataObject; +import org.openide.loaders.DataObjectNotFoundException; import org.openide.text.Line; +import org.openide.text.NbDocument; import org.openide.util.NbBundle; public class DbgpLineBreakpointCustomizerPanel extends JPanel implements ControllerProvider { +private static final Logger LOGGER = Logger.getLogger(DbgpLineBreakpointCustomizerPanel.class.getName()); + private static final int MAX_SAVED_CONDITIONS = 10; private static final String BP_CONDITIONS = "BPConditions"; // NOI18N private static final String DEBUGGER_PHP = "debugger.php"; // NOI18N private static final long serialVersionUID = 6364512868561614302L; private final LineBreakpoint lineBreakpoint; -private final Controller controller; +private final CustomizerController controller; private boolean createBreakpoint; private static LineBreakpoint createLineBreakpoint() { @@ -97,7 +108,7 @@ public class DbgpLineBreakpointCustomizerPanel extends JPanel implements Control } private void processUpdate() { -((CustomizerController) controller).firePropertyChange(); +controller.checkValid(); } }; fileTextField.setEditable(isEditable); @@ -112,6 +123,13 @@ public class DbgpLineBreakpointCustomizerPanel extends JPanel implements Control FileObject fo = line.getLookup().lookup(FileObject.class); updateComponents(fo, line.getLineNumber() + 1, lineBreakpoint.getCondition()); } + +SwingUtilities.invokeLater(new Runnable() { +@Override +public void run() { +controller.checkValid(); +} +}); } private void updateComponents(FileObject fileObject, int lineNumber, String condition) { @@ -175,7 +193,7 @@ public class DbgpLineBreakpointCustomizerPanel extends JPanel implements Control .setArray(BP_CONDITIONS, conditions); } -private Controller createController() { +private CustomizerController createController() { return new CustomizerController(); } @@ -184,6 +202,28 @@ public class DbgpLineBreakpointCustomizerPanel extends JPanel implements Control return controller; } +private static int findNumLines(FileObject file) { +DataObject dataObject; +try { +dataObje
[netbeans] branch master updated: Fix the vendor name regex for Composer #6192
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 cd3bc27f54 Fix the vendor name regex for Composer #6192 new 595fa2cf4f Merge pull request #6196 from junichi11/php-gh-6192-composer-vendor-name cd3bc27f54 is described below commit cd3bc27f546e925ac5598d518b605ef5cefea5ce Author: Junichi Yamamoto AuthorDate: Fri Jul 14 11:52:05 2023 +0900 Fix the vendor name regex for Composer #6192 - https://github.com/apache/netbeans/issues/6192 - https://getcomposer.org/doc/04-schema.md#name - VendorName/PackageName: `^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9](([_.]|-{1,2})?[a-z0-9]+)*$` --- .../modules/php/composer/options/ComposerOptionsValidator.java| 3 ++- .../php/composer/options/ComposerOptionsValidatorTest.java| 8 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/php/php.composer/src/org/netbeans/modules/php/composer/options/ComposerOptionsValidator.java b/php/php.composer/src/org/netbeans/modules/php/composer/options/ComposerOptionsValidator.java index 043bffb6ab..ea1b056a3b 100644 --- a/php/php.composer/src/org/netbeans/modules/php/composer/options/ComposerOptionsValidator.java +++ b/php/php.composer/src/org/netbeans/modules/php/composer/options/ComposerOptionsValidator.java @@ -29,7 +29,8 @@ import org.openide.util.NbBundle; */ public final class ComposerOptionsValidator { -private static final Pattern VENDOR_REGEX = Pattern.compile("^[a-z0-9-]+$"); // NOI18N +// GH-6192 : https://getcomposer.org/doc/04-schema.md#name +private static final Pattern VENDOR_REGEX = Pattern.compile("^[a-z0-9]([_.-]?[a-z0-9]+)*$"); // NOI18N private static final Pattern EMAIL_REGEX = Pattern.compile("^\\w+[\\.\\w\\-]*@\\w+[\\.\\w\\-]*\\.[a-z]{2,}$", Pattern.CASE_INSENSITIVE); // NOI18N private static final Pattern AUTHOR_NAME_REGEX = Pattern.compile("^[^\\d]+$"); // NOI18N diff --git a/php/php.composer/test/unit/src/org/netbeans/modules/php/composer/options/ComposerOptionsValidatorTest.java b/php/php.composer/test/unit/src/org/netbeans/modules/php/composer/options/ComposerOptionsValidatorTest.java index 2643ff739f..8c0260038e 100644 --- a/php/php.composer/test/unit/src/org/netbeans/modules/php/composer/options/ComposerOptionsValidatorTest.java +++ b/php/php.composer/test/unit/src/org/netbeans/modules/php/composer/options/ComposerOptionsValidatorTest.java @@ -52,11 +52,15 @@ public class ComposerOptionsValidatorTest extends NbTestCase { result = new ComposerOptionsValidator() .validateVendor("my.company") .getResult(); -assertTrue(result.hasWarnings()); +assertFalse(result.hasWarnings()); result = new ComposerOptionsValidator() .validateVendor("my_company") .getResult(); -assertTrue(result.hasWarnings()); +assertFalse(result.hasWarnings()); +result = new ComposerOptionsValidator() +.validateVendor("my-company") +.getResult(); +assertFalse(result.hasWarnings()); } public void testValidAuthorEmail() { - 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: Don't remove existing uses if they are the same as the created string for use statements
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 26ab50f13b Don't remove existing uses if they are the same as the created string for use statements new f6df5f3323 Merge pull request #6179 from junichi11/php-gh-5681-reimplement 26ab50f13b is described below commit 26ab50f13b7c223f6e8cfa6592961f9f57551055 Author: Junichi Yamamoto AuthorDate: Wed Jul 12 00:20:50 2023 +0900 Don't remove existing uses if they are the same as the created string for use statements - https://github.com/apache/netbeans/pull/5681 - Avoid changing the file state if the created string is the same as the existing use statements --- .../php/editor/actions/FixUsesPerformer.java | 37 +- .../01/testIssue210093_01.php.fixUses | 4 +-- .../actions/testNoChanges/01/testNoChanges_01.php | 37 ++ .../testNoChanges/01/testNoChanges_01.php.fixUses | 37 ++ .../php/editor/actions/FixUsesPerformerTest.java | 7 5 files changed, 112 insertions(+), 10 deletions(-) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/actions/FixUsesPerformer.java b/php/php.editor/src/org/netbeans/modules/php/editor/actions/FixUsesPerformer.java index 678f6e372c..f294b47160 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/actions/FixUsesPerformer.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/actions/FixUsesPerformer.java @@ -114,7 +114,6 @@ public class FixUsesPerformer { if (document instanceof BaseDocument) { baseDocument = (BaseDocument) document; editList = new EditList(baseDocument); -processExistingUses(); processSelections(); editList.apply(); } @@ -157,10 +156,23 @@ public class FixUsesPerformer { } replaceUnimportedItems(); String insertString = createInsertString(useParts); +insertUses(startOffset, insertString); +} + +private void insertUses(int startOffset, String insertString) { +ExistingUseStatementVisitor visitor = new ExistingUseStatementVisitor(); +Program program = parserResult.getProgram(); +if (program != null) { +program.accept(visitor); +} +List usedRanges = visitor.getUsedRanges(); +String existingUses = getExistingUses(usedRanges); // avoid being recognized as a modified file -if (insertString.isEmpty()) { +if (insertString.isEmpty() +|| existingUses.equals(insertString.trim())) { StatusDisplayer.getDefault().setStatusText(Bundle.FixUsesPerformer_noChanges()); } else { +processExistingUses(usedRanges); editList.replace(startOffset, 0, insertString, false, 0); } } @@ -493,13 +505,22 @@ public class FixUsesPerformer { return result.toString(); } -private void processExistingUses() { -ExistingUseStatementVisitor visitor = new ExistingUseStatementVisitor(); -Program program = parserResult.getProgram(); -if (program != null) { -program.accept(visitor); +private String getExistingUses(List usedRanges) { +String existingUses = EMPTY_STRING; +if (!usedRanges.isEmpty()) { +int start = usedRanges.get(0).getStart(); +int end = usedRanges.get(usedRanges.size() - 1).getEnd(); +try { +existingUses = baseDocument.getText(start, end - start); +} catch (BadLocationException ex) { +LOGGER.log(Level.WARNING, "Invalid offset: {0}", ex.offsetRequested()); // NOI18N +} } -for (OffsetRange offsetRange : visitor.getUsedRanges()) { +return existingUses; +} + +private void processExistingUses(List usedRanges) { +for (OffsetRange offsetRange : usedRanges) { int startOffset = getOffsetWithoutLeadingWhitespaces(offsetRange.getStart()); editList.replace(startOffset, offsetRange.getEnd() - startOffset, EMPTY_STRING, false, 0); } diff --git a/php/php.editor/test/unit/data/testfiles/actions/testIssue210093/01/testIssue210093_01.php.fixUses b/php/php.editor/test/unit/data/testfiles/actions/testIssue210093/01/testIssue210093_01.php.fixUses index c64e8084be..2eff6f58a1 100644 --- a/php/php.editor/test/unit/data/testfiles/actions/testIssue210093/01/testIssue210093_01.php.fixUses +++ b/php/php.editor/test/unit/data/testfiles/actions/testIssue210093/01/testIssue210093_01.php.fixUses @@ -8,11 +8,11 @@ namespace Issue\Martin { namespace { -use \Issue\Martin\Pondeli; +use \Issue\Martin\Pondeli; function testOk(Pondeli $param) {} function testFa
[netbeans] branch master updated (8b268263d8 -> 691f0b4480)
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 8b268263d8 Merge pull request #6150 from kamilkrzywanski/lambdaListeners new f63b8463cd Fix "Fix Imports" when the phptag is in HTML #5578 new 75d16e8c53 Fix "Fix Imports" issue with declare statements #5578 new 082e5a779d Fix "Fix Imports" issue with declare statements #5578 new 691f0b4480 Merge pull request #6177 from junichi11/php-gh-5578-reimplement The 8805 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: .../php/editor/actions/FixUsesPerformer.java | 96 -- .../testGH5578/declare01/testGH5578_declare01.php | 44 ++ .../declare01/testGH5578_declare01.php.fixUses | 46 +++ .../testfiles/actions/testGH5578/declare02/B.php | 24 ++ .../testGH5578/declare02/testGH5578_declare02.php | 35 .../declare02/testGH5578_declare02.php.fixUses | 37 + .../testGH5578/declare03/testGH5578_declare03.php | 40 + .../declare03/testGH5578_declare03.php.fixUses | 42 ++ .../testGH5578/declare04/testGH5578_declare04.php | 39 + .../declare04/testGH5578_declare04.php.fixUses | 41 + .../testGH5578/declare05/testGH5578_declare05.php | 39 + .../declare05/testGH5578_declare05.php.fixUses | 41 + .../actions/testGH5578/inHtml01/InHtml.php | 22 + .../testGH5578/inHtml01/testGH5578_inHtml01.php| 32 .../inHtml01/testGH5578_inHtml01.php.fixUses | 34 .../php/editor/actions/FixUsesPerformerTest.java | 42 ++ 16 files changed, 649 insertions(+), 5 deletions(-) create mode 100644 php/php.editor/test/unit/data/testfiles/actions/testGH5578/declare01/testGH5578_declare01.php create mode 100644 php/php.editor/test/unit/data/testfiles/actions/testGH5578/declare01/testGH5578_declare01.php.fixUses create mode 100644 php/php.editor/test/unit/data/testfiles/actions/testGH5578/declare02/B.php create mode 100644 php/php.editor/test/unit/data/testfiles/actions/testGH5578/declare02/testGH5578_declare02.php create mode 100644 php/php.editor/test/unit/data/testfiles/actions/testGH5578/declare02/testGH5578_declare02.php.fixUses create mode 100644 php/php.editor/test/unit/data/testfiles/actions/testGH5578/declare03/testGH5578_declare03.php create mode 100644 php/php.editor/test/unit/data/testfiles/actions/testGH5578/declare03/testGH5578_declare03.php.fixUses create mode 100644 php/php.editor/test/unit/data/testfiles/actions/testGH5578/declare04/testGH5578_declare04.php create mode 100644 php/php.editor/test/unit/data/testfiles/actions/testGH5578/declare04/testGH5578_declare04.php.fixUses create mode 100644 php/php.editor/test/unit/data/testfiles/actions/testGH5578/declare05/testGH5578_declare05.php create mode 100644 php/php.editor/test/unit/data/testfiles/actions/testGH5578/declare05/testGH5578_declare05.php.fixUses create mode 100644 php/php.editor/test/unit/data/testfiles/actions/testGH5578/inHtml01/InHtml.php create mode 100644 php/php.editor/test/unit/data/testfiles/actions/testGH5578/inHtml01/testGH5578_inHtml01.php create mode 100644 php/php.editor/test/unit/data/testfiles/actions/testGH5578/inHtml01/testGH5578_inHtml01.php.fixUses - 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 incorrect AbstractClassInstantiationHintError #6119
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 e8bf72eec6 Fix incorrect AbstractClassInstantiationHintError #6119 new 3a61869b00 Merge pull request #6171 from junichi11/php-gh-6119-incorrect-abstract-instantiation-hint e8bf72eec6 is described below commit e8bf72eec654d4fb46d3eca1a255ab3b2ece4c28 Author: Junichi Yamamoto AuthorDate: Mon Jul 10 00:09:29 2023 +0900 Fix incorrect AbstractClassInstantiationHintError #6119 - https://github.com/apache/netbeans/issues/6119 - Check whether the class name has `$` - Add unit tests --- .../org/netbeans/modules/php/editor/CodeUtils.java | 9 + .../AbstractClassInstantiationHintError.java | 12 -- .../AbstractClassInstantiationHint/gh6119.php | 23 +++ .../gh6119.php.testGH6119.hints| 1 + .../testAbstractClassInstantiationHint.php | 0 ...nt.php.testAbstractClassInstantiationHint.hints | 0 .../testAbstractClassInstantiationHint_02.php | 0 ...php.testAbstractClassInstantiationHint_02.hints | 0 .../AbstractClassInstantiationHintErrorTest.java | 47 ++ .../modules/php/editor/verification/HintsTest.java | 8 10 files changed, 89 insertions(+), 11 deletions(-) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java b/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java index fcc307ef31..d87712a333 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java @@ -690,6 +690,15 @@ public final class CodeUtils { return "__construct".equals(extractMethodName(node)); //NOI18N } +public static boolean isDollaredName(ClassName className) { +Expression name = className.getName(); +if (name instanceof Variable) { +Variable variable = (Variable) name; +return variable.isDollared(); +} +return false; +} + /** * Finds common namespace prefixes for the given sorted namespaces. * diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/verification/AbstractClassInstantiationHintError.java b/php/php.editor/src/org/netbeans/modules/php/editor/verification/AbstractClassInstantiationHintError.java index f1d3dcc389..375807bed5 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/verification/AbstractClassInstantiationHintError.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/verification/AbstractClassInstantiationHintError.java @@ -19,11 +19,13 @@ package org.netbeans.modules.php.editor.verification; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Set; import org.netbeans.modules.csl.api.Hint; import org.netbeans.modules.csl.api.OffsetRange; import org.netbeans.modules.csl.spi.support.CancelSupport; +import org.netbeans.modules.php.editor.CodeUtils; import org.netbeans.modules.php.editor.api.ElementQuery.Index; import org.netbeans.modules.php.editor.api.NameKind; import org.netbeans.modules.php.editor.api.QualifiedName; @@ -79,7 +81,7 @@ public class AbstractClassInstantiationHintError extends HintErrorRule { } public List getHints() { -return hints; +return Collections.unmodifiableList(hints); } @Override @@ -88,7 +90,12 @@ public class AbstractClassInstantiationHintError extends HintErrorRule { "AbstractClassInstantiationDesc=Abstract class {0} can not be instantiated" }) public void visit(ClassInstanceCreation node) { -if (CancelSupport.getDefault().isCancelled()) { +if (CancelSupport.getDefault().isCancelled() +|| CodeUtils.isDollaredName(node.getClassName())) { +// GH-6119 +// e.g. +// abstract class AbstractClass {} +// $a = new $abstractClass(); return; } ASTNodeInfo info = ASTNodeInfo.create(node); @@ -110,7 +117,6 @@ public class AbstractClassInstantiationHintError extends HintErrorRule { } } } - } @Override diff --git a/php/php.editor/test/unit/data/testfiles/verification/AbstractClassInstantiationHint/gh6119.php b/php/php.editor/test/unit/data/testfiles/verification/AbstractClassInstantiationHint/gh6119.php new file mode 100644 index 00..105ae28aa9 --- /dev/null +++ b/php/php.editor/test/unit/data/testfiles/verification/AbstractClassInstantiationHint/gh6119.php @@ -0,0 +1,23 @@ +http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * softwa
[netbeans] branch master updated (e418ee1003 -> 954ab1d28a)
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 e418ee1003 Merge pull request #6169 from junichi11/php-update-php-sample-for-phpunit new 4da2d495f8 Support for nullable types in vardoc #6075 new 1f50e9eb05 Fix "Fix Imports" for vardoc with a nullable type #6075 new ff8f2cc1f7 Add unit tests for #6162 new 954ab1d28a Merge pull request #6170 from junichi11/php-gh-6075-vardoc-with-nullable-type The 8791 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: .../php/editor/actions/ImportDataCreator.java | 19 +- .../php/editor/actions/UsedNamesCollector.java | 11 +- .../modules/php/editor/parser/ASTPHP5Scanner.java | 255 +++-- .../php/editor/parser/UnusedUsesCollector.java | 5 +- .../ASTPHP5ParserTest/parser/issueGH6075_01.pass | 250 .../gh6075_01.php} | 25 +- .../data/testfiles/actions/gh6075_01.php.usedNames | 2 + .../gh6075_02.php} | 25 +- .../data/testfiles/actions/gh6075_02.php.usedNames | 0 .../gh6162_01.php} | 28 +-- .../data/testfiles/actions/gh6162_01.php.usedNames | 0 .../testGH6075/01/Vendor/User.php} | 25 +- .../testGH6075/01/testGH6075_01.php} | 25 +- .../testGH6075/01/testGH6075_01.php.fixUses} | 27 +-- .../testGH6075/Vendor/User.php}| 25 +- .../testGH6075/testGH6075_01.php} | 25 +- .../testGH6075/testGH6075_01.php.importData| 12 + .../testGH6162/01/Vendor/User.php} | 25 +- .../testGH6162/01/testGH6162_01.php} | 26 +-- .../testGH6162/01/testGH6162_01.php.fixUses} | 28 +-- .../lib/gh6075/gh6075.php} | 31 ++- .../lib/gh6075/gh6075.php.testGH6075_01.completion | 5 + .../lib/gh6075/gh6075.php.testGH6075_02.completion | 5 + .../lib/gh6075/gh6075.php.testGH6075_03.completion | 5 + .../lib/gh6075/gh6075.php.testGH6075_04.completion | 5 + .../testIssueGH6075/testIssueGH6075.php} | 31 ++- .../testIssueGH6075/testIssueGH6075.php} | 31 ++- ...IssueGH6075.php.testIssueGH6075_01a.occurrences | 5 + ...IssueGH6075.php.testIssueGH6075_01b.occurrences | 5 + ...IssueGH6075.php.testIssueGH6075_01c.occurrences | 5 + ...IssueGH6075.php.testIssueGH6075_01d.occurrences | 5 + ...IssueGH6075.php.testIssueGH6075_01e.occurrences | 5 + .../issueGH6075_01.php}| 27 +-- .../testGH6075/Vendor/User.php}| 25 +- .../testGH6075/testGH6075.php} | 25 +- .../testGH6075/testGH6075.php.testGH6075.hints | 0 .../testGH6162/Vendor/User.php}| 25 +- .../testGH6162/testGH6162.php} | 26 +-- .../testGH6162/testGH6162.php.testGH6162.hints | 0 .../testUnusedUsesHint}/testUnusedUsesHint.php | 0 ...testUnusedUsesHint.php.testUnusedUsesHint.hints | 0 .../testUnusedUsesHintWithTypedProperties.php | 0 ...php.testUnusedUsesHintWithTypedProperties.hints | 0 ...php.testUnusedUsesHintWithTypedProperties.hints | 0 .../php/editor/actions/FixUsesPerformerTest.java | 16 ++ .../php/editor/actions/ImportDataCreatorTest.java | 4 + .../php/editor/actions/UsedNamesCollectorTest.java | 20 +- .../completion/PHPCodeCompletionGH6075Test.java| 61 + .../php/editor/csl/GotoDeclarationGH6075Test.java} | 29 +-- .../csl/OccurrencesFinderImplGH6075Test.java | 47 .../php/editor/parser/ASTPHP5ParserTest.java | 4 + .../modules/php/editor/verification/HintsTest.java | 9 - .../editor/verification/UnusedUsesHintTest.java| 71 ++ php/php.editor/tools/ASTPHP5Scanner.flex | 4 +- 54 files changed, 827 insertions(+), 542 deletions(-) create mode 100644 php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/issueGH6075_01.pass copy php/php.editor/test/unit/data/testfiles/{verification/testUnusedUsesHintWithTypedProperties.php => actions/gh6075_01.php} (70%) create mode 100644 php/php.editor/test/unit/data/testfiles/actions/gh6075_01.php.usedNames copy php/php.editor/test/unit/data/testfiles/{verification/testUnusedUsesHintWithTypedProperties.php => actions/gh6075_02.php} (70%) copy enterprise/web.jspparser/test/unit/data/jspparser-data/wmroot/subdir/Page1.jsp => php/php.editor/test/unit/data/testfiles/actions/gh6075_02.php.usedNames (100%) copy php/php.editor/test/unit/data/testfiles/{verification/testUnusedUsesHintWithTypedProperties.php
[netbeans] branch master updated: Update the PHP sample project for PHPUnit
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 7939c99c77 Update the PHP sample project for PHPUnit new e418ee1003 Merge pull request #6169 from junichi11/php-update-php-sample-for-phpunit 7939c99c77 is described below commit 7939c99c7723b87cb80c82327a1a2820c2872ac8 Author: Junichi Yamamoto AuthorDate: Wed Apr 26 23:52:24 2023 +0900 Update the PHP sample project for PHPUnit - Update the version to PHPUnit 10 - Remove the unavailable URL from readme.html - Add setting for code coverage to readme.html - Fix the phpunit.xml (the `filter` element is available no longer. Instead, use the `coverage` element.) - See: https://docs.phpunit.de/en/10.1/configuration.html (https://phpunit.de/documentation.html) --- .../samples_src/Calculator-PHPUnit/composer.json | 2 +- .../samples_src/Calculator-PHPUnit/readme.html | 20 +++- .../samples_src/Calculator-PHPUnit/test/phpunit.xml | 8 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/php/php.samples/samples_src/Calculator-PHPUnit/composer.json b/php/php.samples/samples_src/Calculator-PHPUnit/composer.json index a590f62ccd..e22c9558f3 100644 --- a/php/php.samples/samples_src/Calculator-PHPUnit/composer.json +++ b/php/php.samples/samples_src/Calculator-PHPUnit/composer.json @@ -11,7 +11,7 @@ }, "require-dev": { -"phpunit/phpunit": "~8" +"phpunit/phpunit": "~10" }, "autoload": { "classmap": ["src/"] diff --git a/php/php.samples/samples_src/Calculator-PHPUnit/readme.html b/php/php.samples/samples_src/Calculator-PHPUnit/readme.html index ea44e913b4..42abcf1a37 100644 --- a/php/php.samples/samples_src/Calculator-PHPUnit/readme.html +++ b/php/php.samples/samples_src/Calculator-PHPUnit/readme.html @@ -1,3 +1,4 @@ + - Calculator (PHPUnit) - sample application for NetBeans IDE -
[netbeans] branch master updated (61a114ac6d -> 0f4aafed70)
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 61a114ac6d Merge pull request #6092 from junichi11/php-gh-5933-instanceof-with-cast new 9e3bc8a8ad Fix the problem that "Fix Imports" don't work when there are types that have the same suffix #5330 new c990ed293e Separate between class-based, function-based, and const-based use statements by a single blank line #4609 new 921e42fc6e Don't add a space before `{` new ce548fe871 Don't generate full class names new 0f4aafed70 Merge pull request #6161 from junichi11/php-reimplement-fix-imports The 8780 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/Bundle.properties | 4 + .../editor/actions/FixDuplicateImportStmts.form| 3 +- .../editor/actions/FixDuplicateImportStmts.java| 155 +-- .../php/editor/actions/FixImportsBottomPanel.form | 95 + .../php/editor/actions/FixImportsBottomPanel.java | 144 ++ .../modules/php/editor/actions/FixUsesAction.java | 82 +++- .../php/editor/actions/FixUsesPerformer.java | 99 +- .../php/editor/actions/UsedNamesCollector.java | 7 +- .../modules/php/editor/indent/CodeStyle.java | 4 + .../modules/php/editor/indent/FmtOptions.java | 4 +- .../modules/php/editor/indent/ui/Bundle.properties | 1 + .../modules/php/editor/indent/ui/FmtUses.form | 14 +- .../modules/php/editor/indent/ui/FmtUses.java | 79 .../GroupUses/testGH4609PSR12_GroupUses.php| 71 +++ .../testGH4609PSR12_GroupUses.php.fixUses | 81 .../testGH4609PSR12_GroupUsesWithPSR12a.php| 69 +++ ...testGH4609PSR12_GroupUsesWithPSR12a.php.fixUses | 83 .../testGH4609PSR12_GroupUsesWithPSR12b.php| 68 +++ ...testGH4609PSR12_GroupUsesWithPSR12b.php.fixUses | 80 .../testGH4609PSR12_GroupUsesWithPSR12c.php| 65 ++ ...testGH4609PSR12_GroupUsesWithPSR12c.php.fixUses | 70 +++ .../testGH4609PSR12_GroupUsesWithPSR12d.php| 67 +++ ...testGH4609PSR12_GroupUsesWithPSR12d.php.fixUses | 76 +++ .../testGH4609PSR12_GroupUsesWithPSR12e.php| 66 +++ ...testGH4609PSR12_GroupUsesWithPSR12e.php.fixUses | 73 +++ .../testGH4609PSR12_GroupUsesWithPSR12f.php| 66 +++ ...testGH4609PSR12_GroupUsesWithPSR12f.php.fixUses | 73 +++ .../testGH4609PSR12_GroupUsesWithPSR12g.php| 64 ++ ...testGH4609PSR12_GroupUsesWithPSR12g.php.fixUses | 66 +++ .../testGH4609PSR12_SingleLineUses.php | 71 +++ .../testGH4609PSR12_SingleLineUses.php.fixUses | 77 .../testGH4609PSR12_SingleLineUsesWithPSR12a.php | 69 +++ ...H4609PSR12_SingleLineUsesWithPSR12a.php.fixUses | 79 .../testGH4609PSR12_SingleLineUsesWithPSR12b.php | 68 +++ ...H4609PSR12_SingleLineUsesWithPSR12b.php.fixUses | 76 +++ .../testGH4609PSR12_SingleLineUsesWithPSR12c.php | 65 ++ ...H4609PSR12_SingleLineUsesWithPSR12c.php.fixUses | 68 +++ .../testGH4609PSR12_SingleLineUsesWithPSR12d.php | 67 +++ ...H4609PSR12_SingleLineUsesWithPSR12d.php.fixUses | 74 +++ .../testGH4609PSR12_SingleLineUsesWithPSR12e.php | 66 +++ ...H4609PSR12_SingleLineUsesWithPSR12e.php.fixUses | 71 +++ .../testGH4609PSR12_SingleLineUsesWithPSR12f.php | 66 +++ ...H4609PSR12_SingleLineUsesWithPSR12f.php.fixUses | 71 +++ .../testGH4609PSR12_SingleLineUsesWithPSR12g.php | 64 ++ ...H4609PSR12_SingleLineUsesWithPSR12g.php.fixUses | 66 +++ .../actions/testGH5330/01/testGH5330_01.php| 35 .../testGH5330/01/testGH5330_01.php.fixUses| 36 .../testfiles/actions/testGH5330/testGH5330_01.php | 35 .../testGH5330/testGH5330_01.php.importData| 11 ++ .../testGroupUse/06/testGroupUse_06.php.fixUses| 2 +- .../testGroupUse/07/testGroupUse_07.php.fixUses| 2 +- .../testGroupUse/08/testGroupUse_08.php.fixUses| 2 +- .../testGroupUse/09/testGroupUse_09.php.fixUses| 2 +- .../testGroupUse/10/testGroupUse_10.php.fixUses| 2 +- .../testGroupUse/11/testGroupUse_11.php.fixUses| 2 +- .../testGroupUse/12/testGroupUse_12.php.fixUses| 6 +- .../testGroupUse/14/testGroupUse_14.php.fixUses| 6 +- .../01/testGroupUseComplex_01.php.fixUses | 6 +- .../php/editor/actions/FixUsesPerformerTest.java | 219 + .../php/editor/actions/ImportDataCreatorTest.java | 4 + 60 files changed, 3144 insertions(+), 173 deletions(-) create mode 100644 php/php.editor/src/org/netbe
[netbeans] branch master updated (5f9b451bd8 -> d29bbb336a)
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 5f9b451bd8 Merge pull request #6090 from mbien/update-return-encapsulation-hint new 910fd0fd70 Revert "Merge pull request #5801 from junichi11/php-gh-5330-fix-imports" new 2c6ea841fc Revert "Don't generate full class names" new e345d0ea6c Revert "Don't add a space before `{`" new 5aed58eb99 Revert "Separate between class-based, function-based, and const-based use statements by a single blank line #4609" new 7893aaae14 Revert "FixUsesPerformer,ImportDataCreator and UsedNamespaceCollector logic update to fix imports in whole file, fix ModelUtils multiple default namespace detection" new c01cbbd6b7 Revert "Merge pull request #5579 from rossluk/php/fix-uses-performer-fix" new b6be0f8b57 Add unit tests for `FixUsesPerformer` #6056 #6082 new 251f448632 Fix unit tests new d29bbb336a Merge pull request #6152 from junichi11/revert-fix-import-changes The 8757 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/Bundle.properties | 8 +- .../editor/actions/FixDuplicateImportStmts.form| 3 +- .../editor/actions/FixDuplicateImportStmts.java| 166 ++--- .../php/editor/actions/FixImportsBottomPanel.form | 114 -- .../php/editor/actions/FixImportsBottomPanel.java | 159 - .../modules/php/editor/actions/FixUsesAction.java | 26 +- .../php/editor/actions/FixUsesPerformer.java | 389 +++-- .../php/editor/actions/ImportDataCreator.java | 38 +- .../php/editor/actions/UsedNamesCollector.java | 83 +++-- .../php/editor/actions/UsedNamespaceName.java | 12 +- .../modules/php/editor/model/ModelUtils.java | 83 - .../php/editor/model/impl/ModelBuilder.java| 2 +- ..._multiple_namespaces_with_multiple_default.pass | 2 +- ...iple_namespaces_with_elements_from_default.pass | 7 + .../data/testfiles/actions/nb4978_08.php.usedNames | 5 +- .../GroupUses/testGH4609PSR12_GroupUses.php| 71 .../testGH4609PSR12_GroupUses.php.fixUses | 81 - .../testGH4609PSR12_GroupUsesWithPSR12a.php| 69 ...testGH4609PSR12_GroupUsesWithPSR12a.php.fixUses | 83 - .../testGH4609PSR12_GroupUsesWithPSR12b.php| 68 ...testGH4609PSR12_GroupUsesWithPSR12b.php.fixUses | 80 - .../testGH4609PSR12_GroupUsesWithPSR12c.php| 65 ...testGH4609PSR12_GroupUsesWithPSR12c.php.fixUses | 70 .../testGH4609PSR12_GroupUsesWithPSR12d.php| 67 ...testGH4609PSR12_GroupUsesWithPSR12d.php.fixUses | 76 .../testGH4609PSR12_GroupUsesWithPSR12e.php| 66 ...testGH4609PSR12_GroupUsesWithPSR12e.php.fixUses | 73 .../testGH4609PSR12_GroupUsesWithPSR12f.php| 66 ...testGH4609PSR12_GroupUsesWithPSR12f.php.fixUses | 73 .../testGH4609PSR12_GroupUsesWithPSR12g.php| 64 ...testGH4609PSR12_GroupUsesWithPSR12g.php.fixUses | 66 .../testGH4609PSR12_SingleLineUses.php | 71 .../testGH4609PSR12_SingleLineUses.php.fixUses | 77 .../testGH4609PSR12_SingleLineUsesWithPSR12a.php | 69 ...H4609PSR12_SingleLineUsesWithPSR12a.php.fixUses | 79 - .../testGH4609PSR12_SingleLineUsesWithPSR12b.php | 68 ...H4609PSR12_SingleLineUsesWithPSR12b.php.fixUses | 76 .../testGH4609PSR12_SingleLineUsesWithPSR12c.php | 65 ...H4609PSR12_SingleLineUsesWithPSR12c.php.fixUses | 68 .../testGH4609PSR12_SingleLineUsesWithPSR12d.php | 67 ...H4609PSR12_SingleLineUsesWithPSR12d.php.fixUses | 74 .../testGH4609PSR12_SingleLineUsesWithPSR12e.php | 66 ...H4609PSR12_SingleLineUsesWithPSR12e.php.fixUses | 71 .../testGH4609PSR12_SingleLineUsesWithPSR12f.php | 66 ...H4609PSR12_SingleLineUsesWithPSR12f.php.fixUses | 71 .../testGH4609PSR12_SingleLineUsesWithPSR12g.php | 64 ...H4609PSR12_SingleLineUsesWithPSR12g.php.fixUses | 66 .../actions/testGH5330/01/testGH5330_01.php| 35 -- .../testGH5330/01/testGH5330_01.php.fixUses| 36 -- .../testfiles/actions/testGH5330/testGH5330_01.php | 35 -- .../testGH5330/testGH5330_01.php.importData| 12 - .../actions/testGH5578/01/testGH5578_01.php| 36 -- .../testGH5578/01/testGH5578_01.php.fixUses| 38 -- .../actions/testGH5578/02/testGH5578_02.php| 35 -- .../testGH5578/02/testGH5578_02.php.fixUses| 37 -- .../actions/testGH5578/03/testGH5578_03.php| 42 --- .../testGH5578/03/testGH5578_03.php.fi
[netbeans] branch master updated: - Changed the way null is parsed similar to true and false - Fixed displaying null value for constant in navigator and in autocomplete - Fixed guessing the returned n
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 9d825de877 - Changed the way null is parsed similar to true and false - Fixed displaying null value for constant in navigator and in autocomplete - Fixed guessing the returned null type in documentation, in the navigator and during phpDoc comment generation - Fixed broken tests - Added parser test for true, false, null - Added documentation test to guess the returned null type - Added phpDoc generation test to guess the returned null type new 8cfba329e6 Merge pull request #6065 from troizet/parse_null_as_scalar 9d825de877 is described below commit 9d825de877aac61ffade893bb45cfa1ac7952f42 Author: Alexey Borokhvostov AuthorDate: Wed May 17 23:54:51 2023 +0700 - Changed the way null is parsed similar to true and false - Fixed displaying null value for constant in navigator and in autocomplete - Fixed guessing the returned null type in documentation, in the navigator and during phpDoc comment generation - Fixed broken tests - Added parser test for true, false, null - Added documentation test to guess the returned null type - Added phpDoc generation test to guess the returned null type --- .../modules/php/editor/parser/ASTPHP5Parser.java |8 +- .../modules/php/editor/parser/ASTPHP5Symbols.java |2 +- .../ASTPHP5ParserTest/parser/TrueFalseNull.pass| 1723 .../ASTPHP5ParserTest/parser/nullableTypes_01.pass |4 +- .../parser/php74/typedPropertiesClass.pass |4 +- .../parser/php74/typedPropertiesTrait.pass |4 +- .../php80/constructorPropertyPromotion_01.pass | 12 +- .../parser/php80/mixedType_01.pass |8 +- .../parser/php80/namedArguments_01.pass|4 +- .../parser/php80/throwExpression_01.pass | 16 +- .../parser/php80/unionTypesTypes.pass |8 +- .../parser/testVariadicFunctions_01.pass |4 +- .../parser/testVariadicFunctions_02.pass |4 +- .../documentation/guessingNullReturnType.php | 42 + ...turnType.php.testGuessingNullReturnType_01.html | 13 + ...turnType.php.testGuessingNullReturnType_02.html | 13 + .../completion/documentation/nullConstant.php | 30 + .../nullConstant.php.testNullConstant_01.html |7 + .../nullConstant.php.testNullConstant_02.html |7 + .../issue235450.php.testLowercase_01.completion|2 +- .../issue235450.php.testLowercase_04.completion|2 +- .../issue235450.php.testLowercase_07.completion|2 +- .../unit/data/testfiles/parser/TrueFalseNull.php | 114 ++ .../editor/completion/PHPCCDocumentationTest.java | 16 + .../php/editor/parser/ASTPHP5ParserTest.java |4 + .../typinghooks/PhpCommentGeneratorTest.java | 28 +- php/php.editor/tools/ASTPHP5Parser.cup |4 +- 27 files changed, 2022 insertions(+), 63 deletions(-) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/parser/ASTPHP5Parser.java b/php/php.editor/src/org/netbeans/modules/php/editor/parser/ASTPHP5Parser.java index cd9afd516b..9ec1dfaa08 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/parser/ASTPHP5Parser.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/parser/ASTPHP5Parser.java @@ -19,7 +19,7 @@ // // The following code was generated by CUP v0.11a beta 20060608 -// Wed Feb 08 23:05:51 NOVT 2023 +// Wed May 17 22:19:17 NOVT 2023 // package org.netbeans.modules.php.editor.parser; @@ -30,7 +30,7 @@ import org.netbeans.modules.php.editor.parser.astnodes.*; import org.openide.util.Pair; /** CUP v0.11a beta 20060608 generated parser. - * @version Wed Feb 08 23:05:51 NOVT 2023 + * @version Wed May 17 22:19:17 NOVT 2023 */ @org.netbeans.api.annotations.common.SuppressWarnings({"EI_EXPOSE_REP", "MS_PKGPROTECT", "BC_BAD_CAST_TO_CONCRETE_COLLECTION"}) public class ASTPHP5Parser extends java_cup.runtime.lr_parser { @@ -12918,7 +12918,7 @@ switch (CUP$ASTPHP5Parser$act_num) { if (!nsn.isGlobal() && list.size() == 1) { String itemName = ((Identifier) list.get(0)).getName(); String itemNameLower = itemName.toLowerCase(); -if ("true".equals(itemNameLower) || "false".equals(itemNameLower)) { // NOI18N +if ("true".equals(itemNameLower) || "false".equals(itemNameLower) || "null".equals(itemNameLower)) { // NOI18N RESULT = new Scalar(nsnleft, nsnright, itemName, Scalar.Type.STRING); } else { RESULT = nsn; @@ -14181,7 +14181,7 @@ switch (CUP$ASTPHP5Parser$act_num) {
[netbeans] branch master updated (6862116550 -> efa6483fb3)
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 6862116550 VSCode: Renaming Java 8+ debug configuration to Java+. (#5816) new 9ae85ac64f Add the "End of File" blank line formatting option #4641 new d61e1d09ea Add the new hint for PSR-12 Files new efa6483fb3 Merge pull request #5824 from junichi11/php-gh-4641-formatter-blank-lines-eof The 8461 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/indent/CodeStyle.java | 4 + .../modules/php/editor/indent/FmtOptions.java | 6 +- .../modules/php/editor/indent/TokenFormatter.java | 35 .../modules/php/editor/indent/ui/Bundle.properties | 1 + .../php/editor/indent/ui/FmtBlankLines.form| 12 +- .../php/editor/indent/ui/FmtBlankLines.java| 10 +- .../modules/php/editor/resources/layer.xml | 4 + .../php/editor/verification/Bundle.properties | 1 + .../php/editor/verification/PSR12FilesHint.java| 133 ++ .../modules/php/editor/verification/PSR12Hint.java | 112 .../testfiles/formatting/blankLines/eof_01.php | 21 +++ .../blankLines/eof_01.php.testEOF_01a.formatted| 21 +++ .../blankLines/eof_01.php.testEOF_01b.formatted| 21 +++ .../testfiles/formatting/blankLines/eof_02.php | 21 +++ .../blankLines/eof_02.php.testEOF_02a.formatted| 21 +++ .../blankLines/eof_02.php.testEOF_02b.formatted| 21 +++ .../testEndWithWhitespace.php | 21 +++ ...dWithWhitespace.php.testEndWithWhitespace.hints | 3 + .../PSR12/Files/testHasNewline/testHasNewline.php | 20 +++ .../testHasNewline.php.testHasNewline.hints| 0 .../testHasNewlineCRLF/testHasNewlineCRLF.php | 20 +++ ...testHasNewlineCRLF.php.testHasNewlineCRLF.hints | 4 + .../testNoNewlineAtEOF/testNoNewlineAtEOF.php | 20 +++ ...testNoNewlineAtEOF.php.testNoNewlineAtEOF.hints | 3 + .../indent/PHPFormatterBlankLinesEOFTest.java | 191 + .../php/editor/indent/PHPFormatterTestBase.java| 2 +- .../editor/verification/PSR12FilesHintTest.java| 73 .../php/editor/verification/PSR12HintTestBase.java | 56 ++ 28 files changed, 853 insertions(+), 4 deletions(-) create mode 100644 php/php.editor/src/org/netbeans/modules/php/editor/verification/PSR12FilesHint.java create mode 100644 php/php.editor/src/org/netbeans/modules/php/editor/verification/PSR12Hint.java create mode 100644 php/php.editor/test/unit/data/testfiles/formatting/blankLines/eof_01.php create mode 100644 php/php.editor/test/unit/data/testfiles/formatting/blankLines/eof_01.php.testEOF_01a.formatted create mode 100644 php/php.editor/test/unit/data/testfiles/formatting/blankLines/eof_01.php.testEOF_01b.formatted create mode 100644 php/php.editor/test/unit/data/testfiles/formatting/blankLines/eof_02.php create mode 100644 php/php.editor/test/unit/data/testfiles/formatting/blankLines/eof_02.php.testEOF_02a.formatted create mode 100644 php/php.editor/test/unit/data/testfiles/formatting/blankLines/eof_02.php.testEOF_02b.formatted create mode 100644 php/php.editor/test/unit/data/testfiles/verification/PSR12/Files/testEndWithWhitespace/testEndWithWhitespace.php create mode 100644 php/php.editor/test/unit/data/testfiles/verification/PSR12/Files/testEndWithWhitespace/testEndWithWhitespace.php.testEndWithWhitespace.hints create mode 100644 php/php.editor/test/unit/data/testfiles/verification/PSR12/Files/testHasNewline/testHasNewline.php copy enterprise/web.jspparser/test/unit/data/jspparser-data/wmroot/subdir/Page1.jsp => php/php.editor/test/unit/data/testfiles/verification/PSR12/Files/testHasNewline/testHasNewline.php.testHasNewline.hints (100%) create mode 100644 php/php.editor/test/unit/data/testfiles/verification/PSR12/Files/testHasNewlineCRLF/testHasNewlineCRLF.php create mode 100644 php/php.editor/test/unit/data/testfiles/verification/PSR12/Files/testHasNewlineCRLF/testHasNewlineCRLF.php.testHasNewlineCRLF.hints create mode 100644 php/php.editor/test/unit/data/testfiles/verification/PSR12/Files/testNoNewlineAtEOF/testNoNewlineAtEOF.php create mode 100644 php/php.editor/test/unit/data/testfiles/verification/PSR12/Files/testNoNewlineAtEOF/testNoNewlineAtEOF.php.testNoNewlineAtEOF.hints create mode 100644 php/php.editor/test/unit/src/org/netbeans/modules/php/editor/indent/PHPFormatterBlankLinesEOFTest.java create mode 100644 php/php.editor/test/unit/src/org/netbeans/modules/php/editor/verification/PSR12FilesHintTest.java create mode 100644 php/php.editor/test/unit/src/org/netbeans/modules/php/editor/ve
[netbeans] branch master updated: Sort overload methods in the Navigator
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 7567fdb00c Sort overload methods in the Navigator new a0b7c0d7c2 Merge pull request #5797 from junichi11/java-navigator-sort-overload-methods 7567fdb00c is described below commit 7567fdb00cc9adf14a1c82a21e6cfd97211ccb3f Author: Junichi Yamamoto AuthorDate: Sat Apr 8 23:01:01 2023 +0900 Sort overload methods in the Navigator --- .../src/org/netbeans/modules/java/navigation/ElementNode.java | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/java/java.navigation/src/org/netbeans/modules/java/navigation/ElementNode.java b/java/java.navigation/src/org/netbeans/modules/java/navigation/ElementNode.java index 46213077b6..37e4524df1 100644 --- a/java/java.navigation/src/org/netbeans/modules/java/navigation/ElementNode.java +++ b/java/java.navigation/src/org/netbeans/modules/java/navigation/ElementNode.java @@ -673,7 +673,15 @@ public class ElementNode extends AbstractNode implements Iterable { if (d1.posInKind != d2.posInKind) { return d1.posInKind - d2.posInKind; } -return d1.name.compareTo(d2.name); +int compareToName = d1.name.compareTo(d2.name); +if (compareToName == 0) { +// htmlHeader might stay uninitialized in ElementScanningTask +String htmlHeader1 = d1.htmlHeader != null ? d1.htmlHeader : ""; // NOI18N +String htmlHeader2 = d2.htmlHeader != null ? d2.htmlHeader : ""; // NOI18N +return htmlHeader1.compareTo(htmlHeader2); +} else { +return compareToName; +} } int k2i( ElementKind kind ) { - 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: [GH-5355] PHP: Corrects the display of the guessed return type for a function or method in the documentation
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 e71087302b [GH-5355] PHP: Corrects the display of the guessed return type for a function or method in the documentation new 7c9c4bcfb0 Merge pull request #5779 from troizet/fix_gh_5355 e71087302b is described below commit e71087302b58795b7d8af53afb9763da756305ce Author: Alexey Borokhvostov AuthorDate: Wed Apr 5 22:50:37 2023 +0700 [GH-5355] PHP: Corrects the display of the guessed return type for a function or method in the documentation --- .../modules/php/editor/completion/DocRenderer.java | 12 +-- .../completion/documentation/issueGH5355.php | 42 ++ .../issueGH5355.php.testIssueGH5355_01.html| 13 +++ .../issueGH5355.php.testIssueGH5355_02.html| 13 +++ .../editor/completion/PHPCCDocumentationTest.java | 8 + 5 files changed, 85 insertions(+), 3 deletions(-) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/completion/DocRenderer.java b/php/php.editor/src/org/netbeans/modules/php/editor/completion/DocRenderer.java index a42ed5c4ab..c16340c68a 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/completion/DocRenderer.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/completion/DocRenderer.java @@ -608,9 +608,15 @@ final class DocRenderer { if (type.isResolved()) { QualifiedName typeName = type.getTypeName(true); if (typeName != null) { -if (sb.length() > 0 -&& (typeKind == Type.Kind.UNION || typeKind == Type.Kind.INTERSECTION)) { -sb.append(" ").append(typeKind.getSign()).append(" "); // NOI18N +if (sb.length() > 0) { +if (typeKind == Type.Kind.INTERSECTION) { +sb.append(" ").append(typeKind.getSign()).append(" "); // NOI18N +} else { +//GH-5355: If a function returns multiple types +//and doesn't have a declared return type, +//it's always a union type. +sb.append(" ").append(Type.Kind.UNION.getSign()).append(" "); // NOI18N +} } if (type.isNullableType()) { sb.append(CodeUtils.NULLABLE_TYPE_PREFIX); diff --git a/php/php.editor/test/unit/data/testfiles/completion/documentation/issueGH5355.php b/php/php.editor/test/unit/data/testfiles/completion/documentation/issueGH5355.php new file mode 100644 index 00..82833f80aa --- /dev/null +++ b/php/php.editor/test/unit/data/testfiles/completion/documentation/issueGH5355.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. + */ + +class ClassName { + +public function testMethod($a) { +if ($a) { +return 1; +} +return 'str'; +} + +public function test() { +$this->testMethod(null); +} +} + +function testFunction($a) { +if ($a) { +return 1; +} +return 'str'; +} + +testFunction(null); diff --git a/php/php.editor/test/unit/data/testfiles/completion/documentation/issueGH5355.php.testIssueGH5355_01.html b/php/php.editor/test/unit/data/testfiles/completion/documentation/issueGH5355.php.testIssueGH5355_01.html new file mode 100644 index 00..527c6112c4 --- /dev/null +++ b/php/php.editor/test/unit/data/testfiles/completion/documentation/issueGH5355.php.testIssueGH5355_01.html @@ -0,0 +1,13 @@ + +Code completion result for source line: +$this->testMetho|d(null); +(QueryType=COMPLETION, prefixSearch=false, caseSensitive=true) +METHOD testMethod($a) [PUBLIC] ClassName +Documentation:testMethod +Parameters: + +$aPHPDoc not found + +Returns: + +Type:string | int diff --git a/php/php.editor/test/unit/data/testfiles/completion/documentation/issueGH5355.php.testIssueGH5355_02.html b/php/php.editor/test/unit/data/testfiles/completion/documentation/issueGH5355.php.testIssueGH5355_02.html new file mode 100644 index 00..ad2f8cf126 --- /dev/null +++ b/php/php.editor/test/unit/data/testfiles/completion/documentation/issueGH5
[netbeans] branch master updated: Fixed issue #5375 for intersection type
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 ac76fd10e1 Fixed issue #5375 for intersection type new 3f2916e457 Merge pull request #5700 from troizet/intersection_part_gh5375 ac76fd10e1 is described below commit ac76fd10e1ab74d0bf885afe325755142c1ee739 Author: Alexey Borokhvostov AuthorDate: Wed Mar 22 23:02:09 2023 +0700 Fixed issue #5375 for intersection type --- .../modules/php/editor/parser/api/Utils.java | 4 +- .../documentation/issueGH5375Intersection.php | 44 ++ ...eGH5375Intersection.php.testIssueGH5375_03.html | 11 ++ ...eGH5375Intersection.php.testIssueGH5375_04.html | 10 + .../editor/completion/PHPCCDocumentationTest.java | 8 5 files changed, 76 insertions(+), 1 deletion(-) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/parser/api/Utils.java b/php/php.editor/src/org/netbeans/modules/php/editor/parser/api/Utils.java index ee2e2e7c42..70a042f2f2 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/parser/api/Utils.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/parser/api/Utils.java @@ -29,6 +29,7 @@ import org.netbeans.modules.php.editor.parser.astnodes.ClassDeclaration; import org.netbeans.modules.php.editor.parser.astnodes.Comment; import org.netbeans.modules.php.editor.parser.astnodes.FunctionName; import org.netbeans.modules.php.editor.parser.astnodes.Identifier; +import org.netbeans.modules.php.editor.parser.astnodes.IntersectionType; import org.netbeans.modules.php.editor.parser.astnodes.NamespaceName; import org.netbeans.modules.php.editor.parser.astnodes.NullableType; import org.netbeans.modules.php.editor.parser.astnodes.PHPDocBlock; @@ -105,7 +106,8 @@ public final class Utils { ASTNode next = nodes.iterator().next(); if (next instanceof NamespaceName || next instanceof NullableType -|| next instanceof UnionType) { +|| next instanceof UnionType +|| next instanceof IntersectionType) { isFieldDeclaration = true; } } diff --git a/php/php.editor/test/unit/data/testfiles/completion/documentation/issueGH5375Intersection.php b/php/php.editor/test/unit/data/testfiles/completion/documentation/issueGH5375Intersection.php new file mode 100644 index 00..83f087b4e5 --- /dev/null +++ b/php/php.editor/test/unit/data/testfiles/completion/documentation/issueGH5375Intersection.php @@ -0,0 +1,44 @@ +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 ClassA {} +class ClassB extends ClassA {} + + +class ClassName { + +/** + * This text should be displayed here. + */ +public ClassA $test_without_var_tag; + +/** + * This text should be displayed here. + * @var ClassA + */ +public ClassA $test_with_var_tag; + +public function test() { +$this->test_without_var_tag; +$this->test_with_var_tag; +} + +} + diff --git a/php/php.editor/test/unit/data/testfiles/completion/documentation/issueGH5375Intersection.php.testIssueGH5375_03.html b/php/php.editor/test/unit/data/testfiles/completion/documentation/issueGH5375Intersection.php.testIssueGH5375_03.html new file mode 100644 index 00..9b46895426 --- /dev/null +++ b/php/php.editor/test/unit/data/testfiles/completion/documentation/issueGH5375Intersection.php.testIssueGH5375_03.html @@ -0,0 +1,11 @@ + +Code completion result for source line: +$this->test_without_v|ar_tag; +(QueryType=COMPLETION, prefixSearch=false, caseSensitive=true) +VARIABLE ClassA test_without_var [PUBLIC] ClassName +Documentation:$test_without_var_tag +This text should be displayed here. + + +Type:ClassA & ClassB + \ No newline at end of file diff --git a/php/php.editor/test/unit/data/testfiles/completion/documentation/issueGH5375Intersection.php.testIssueGH5375_04.html b/php/php.editor/test/unit/data/testfiles/completion/documentation/issueGH5375Intersection.php.testIssueGH5375_04.html new file mode 100644 index 00..a8d985526a --- /dev/null +++ b/php/php.editor/test/unit/data/testfiles/completion/documentation/issueGH5375Intersection.php.testIssueGH5375_04.html @@ -0,0 +1,10 @@ + +Code completion result for source line: +$this->test_with_v|ar_tag; +(QueryType=COMPLETION, prefixSearch=false, caseSensitive=true) +VARIABLE ClassA test_with_var_ta [PUBLIC] ClassName +Docume
[netbeans] branch master updated (296dc8c4d4 -> eba3855928)
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: Adding a new error hint that checks if the return statement has a value if the return type is specified for the function, as suggested in #5078 Fixing the cancelabili
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 f55ac21e3e Adding a new error hint that checks if the return statement has a value if the return type is specified for the function, as suggested in #5078 Fixing the cancelability bug in ReturnTypeHintError by reverting from a for each loop to a normal loop new 232ad487ab Merge pull request #5648 from troizet/return_statement_filled_value_hint f55ac21e3e is described below commit f55ac21e3eceeb5709318d20ec4b01dced1c1aed Author: Alexey Borokhvostov AuthorDate: Fri Mar 10 21:53:38 2023 +0700 Adding a new error hint that checks if the return statement has a value if the return type is specified for the function, as suggested in #5078 Fixing the cancelability bug in ReturnTypeHintError by reverting from a for each loop to a normal loop --- .../editor/verification/ReturnTypeHintError.java | 45 ++-- ...rnTypeHint.php.testNeverReturnTypeHint_01.hints | 25 - ...rnTypeHint.php.testNeverReturnTypeHint_02.hints | 6 + .../testReturnStatementWithoutValueHintError.php | 125 + ...hp.testReturnStatementWithoutValueHint_01.hints | 0 ...hp.testReturnStatementWithoutValueHint_02.hints | 0 ...hp.testReturnStatementWithoutValueHint_03.hints | 30 + ...hp.testReturnStatementWithoutValueHint_04.hints | 33 ++ ...urnTypeHint.php.testVoidReturnTypeHint_02.hints | 6 + .../verification/ReturnTypeHintErrorTest.java | 16 +++ 10 files changed, 277 insertions(+), 9 deletions(-) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/verification/ReturnTypeHintError.java b/php/php.editor/src/org/netbeans/modules/php/editor/verification/ReturnTypeHintError.java index 2db7904335..2f4ee1e3d4 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/verification/ReturnTypeHintError.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/verification/ReturnTypeHintError.java @@ -39,17 +39,19 @@ import org.netbeans.modules.php.editor.parser.PHPParseResult; import org.netbeans.modules.php.editor.parser.astnodes.ASTNode; import org.netbeans.modules.php.editor.parser.astnodes.Expression; import org.netbeans.modules.php.editor.parser.astnodes.FunctionDeclaration; +import org.netbeans.modules.php.editor.parser.astnodes.IntersectionType; import org.netbeans.modules.php.editor.parser.astnodes.LambdaFunctionDeclaration; import org.netbeans.modules.php.editor.parser.astnodes.NamespaceName; import org.netbeans.modules.php.editor.parser.astnodes.NullableType; import org.netbeans.modules.php.editor.parser.astnodes.ReturnStatement; +import org.netbeans.modules.php.editor.parser.astnodes.UnionType; import org.netbeans.modules.php.editor.parser.astnodes.visitors.DefaultVisitor; import org.openide.filesystems.FileObject; import org.openide.util.NbBundle; /** * Check "void" and "never" return type. - * + * Checks if the return statement has a value if a return type is specified for the function. */ public class ReturnTypeHintError extends HintErrorRule { @@ -116,6 +118,7 @@ public class ReturnTypeHintError extends HintErrorRule { NamespaceName namespaceName = (NamespaceName) returnType; String name = CodeUtils.extractUnqualifiedName(namespaceName); checkVoidAndNeverReturnStatements(statements, name, hints); +checkReturnStatementsWithoutValue(statements, name, hints); } else if (returnType instanceof NullableType) { Expression type = ((NullableType) returnType).getType(); if (type instanceof NamespaceName) { @@ -123,6 +126,10 @@ public class ReturnTypeHintError extends HintErrorRule { String name = CodeUtils.extractUnqualifiedName(namespaceName); checkInvalidVoidAndNeverReturnType(type, name, hints); } +checkReturnStatementsWithoutValue(statements, "", hints); // NOI18N +} else if (returnType instanceof UnionType +|| returnType instanceof IntersectionType) { +checkReturnStatementsWithoutValue(statements, "", hints); // NOI18N } } @@ -133,9 +140,9 @@ public class ReturnTypeHintError extends HintErrorRule { "ReturnTypeHintErrorVoidDesc=\"{0}\" cannot return anything" }) private void checkVoidAndNeverReturnStatements(Set statements, String name, List hints) { -if (Type.VOID.equals(name) || isNeverType(name)) { +if (isVoidType(name) || isNeverType(name)) { // check empty return statement -statements.forEach((statement) -> { +for (ReturnStatement statement: statements
[netbeans] branch master updated: Fix #5578 namespaces/use placement in FixUsesPerformer
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 fb0636966f Fix #5578 namespaces/use placement in FixUsesPerformer new d4944b7d76 Merge pull request #5579 from rossluk/php/fix-uses-performer-fix fb0636966f is described below commit fb0636966fd4ea4a545c829d3f58cabc8d07b43c Author: Andrei Rosliuk AuthorDate: Tue Feb 28 13:21:01 2023 +0100 Fix #5578 namespaces/use placement in FixUsesPerformer --- .../php/editor/actions/FixUsesPerformer.java | 221 - .../data/testfiles/actions/testGH5578/01/B.php | 23 +++ .../actions/testGH5578/01/testGH5578_01.php| 36 .../testGH5578/01/testGH5578_01.php.fixUses| 38 .../data/testfiles/actions/testGH5578/02/B.php | 23 +++ .../actions/testGH5578/02/testGH5578_02.php| 35 .../testGH5578/02/testGH5578_02.php.fixUses| 37 .../actions/testGH5578/03/testGH5578_03.php| 42 .../testGH5578/03/testGH5578_03.php.fixUses| 46 + .../actions/testGH5578/04/testGH5578_04.php| 43 .../testGH5578/04/testGH5578_04.php.fixUses| 46 + .../actions/testGH5578/05/testGH5578_05.php| 44 .../testGH5578/05/testGH5578_05.php.fixUses| 46 + .../actions/testGH5578/06/testGH5578_06.php| 49 + .../testGH5578/06/testGH5578_06.php.fixUses| 51 + .../actions/testGH5578/07/testGH5578_07.php| 49 + .../testGH5578/07/testGH5578_07.php.fixUses| 51 + .../data/testfiles/actions/testGH5578/08/B.php | 23 +++ .../actions/testGH5578/08/testGH5578_08.php| 41 .../testGH5578/08/testGH5578_08.php.fixUses| 43 .../php/editor/actions/FixUsesPerformerTest.java | 50 + 21 files changed, 941 insertions(+), 96 deletions(-) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/actions/FixUsesPerformer.java b/php/php.editor/src/org/netbeans/modules/php/editor/actions/FixUsesPerformer.java index 809ccbd85a..b0190da508 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/actions/FixUsesPerformer.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/actions/FixUsesPerformer.java @@ -19,6 +19,7 @@ package org.netbeans.modules.php.editor.actions; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.Iterator; @@ -28,7 +29,6 @@ import java.util.Objects; import java.util.stream.Collectors; import javax.swing.text.BadLocationException; import javax.swing.text.Document; -import org.netbeans.api.annotations.common.CheckForNull; import org.netbeans.api.editor.document.LineDocumentUtils; import org.netbeans.api.lexer.TokenSequence; import org.netbeans.editor.BaseDocument; @@ -46,10 +46,8 @@ import org.netbeans.modules.php.editor.indent.CodeStyle; import org.netbeans.modules.php.editor.lexer.LexUtilities; import org.netbeans.modules.php.editor.lexer.PHPTokenId; import org.netbeans.modules.php.editor.model.GroupUseScope; -import org.netbeans.modules.php.editor.model.ModelElement; import org.netbeans.modules.php.editor.model.ModelUtils; import org.netbeans.modules.php.editor.model.NamespaceScope; -import org.netbeans.modules.php.editor.model.Scope; import org.netbeans.modules.php.editor.model.UseScope; import org.netbeans.modules.php.editor.parser.PHPParseResult; import org.netbeans.modules.php.editor.parser.UnusedUsesCollector; @@ -89,6 +87,7 @@ public class FixUsesPerformer { private final Options options; private EditList editList; private BaseDocument baseDocument; +private NamespaceScope namespaceScope; public FixUsesPerformer( final PHPParseResult parserResult, @@ -108,18 +107,16 @@ public class FixUsesPerformer { if (document instanceof BaseDocument) { baseDocument = (BaseDocument) document; editList = new EditList(baseDocument); -processExistingUses(); -processSelections(); +namespaceScope = ModelUtils.getNamespaceScope(parserResult, importData.caretPosition); +assert namespaceScope != null; +processSelections(processExistingUses(importData.caretPosition)); editList.apply(); } } @NbBundle.Messages("FixUsesPerformer.noChanges=Fix imports: No Changes") -private void processSelections() { +private void processSelections(int startOffset) { final List dataItems = resolveDuplicateSelections(); -NamespaceScope namespaceScope = ModelUtils.getNamespaceScope(parserResult, importData.caretPosition); -assert namespaceScope != null; -int startOffset = getOffset(baseDocument, namespaceScope, parserResult, importData.car
[netbeans] branch master updated: Regenerate PHP signature files
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 be7cf3b8fc Regenerate PHP signature files new c09769351f Merge pull request #5565 from junichi11/regenerate-php-sigfiles-1.5 be7cf3b8fc is described below commit be7cf3b8fcfc4a30a7d51daa17ccb1b434550d61 Author: Junichi Yamamoto AuthorDate: Sun Feb 26 13:57:48 2023 +0900 Regenerate PHP signature files PHP Documentation: Date: 21 Feb 2023 --- php/php.project/external/binaries-list | 2 +- .../{phpsigfiles-1.4-license.txt => phpsigfiles-1.5-license.txt}| 2 +- .../external/{phpsigfiles-1.4-notice.txt => phpsigfiles-1.5-notice.txt} | 0 php/php.project/nbproject/project.properties| 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/php/php.project/external/binaries-list b/php/php.project/external/binaries-list index a4f3348299..23bd43969e 100644 --- a/php/php.project/external/binaries-list +++ b/php/php.project/external/binaries-list @@ -14,4 +14,4 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -4EA0C90D7EB03DEC5AC2AD19FE33C3A9F71AD790 phpsigfiles-1.4.zip +85671C8F8F936E1E66FC46D463ED290105A46EAC phpsigfiles-1.5.zip diff --git a/php/php.project/external/phpsigfiles-1.4-license.txt b/php/php.project/external/phpsigfiles-1.5-license.txt similarity index 99% rename from php/php.project/external/phpsigfiles-1.4-license.txt rename to php/php.project/external/phpsigfiles-1.5-license.txt index 1afd05aaba..73c37552a1 100644 --- a/php/php.project/external/phpsigfiles-1.4-license.txt +++ b/php/php.project/external/phpsigfiles-1.5-license.txt @@ -1,5 +1,5 @@ Name: phpsigfiles -Version: 1.4 +Version: 1.5 Description: Signature files for PHP runtime and PHP runtime extensions for use from code completion etc. The file is build from the PHP manual. License: CC-BY-3.0 Origin: http://www.php.net/docs.php diff --git a/php/php.project/external/phpsigfiles-1.4-notice.txt b/php/php.project/external/phpsigfiles-1.5-notice.txt similarity index 100% rename from php/php.project/external/phpsigfiles-1.4-notice.txt rename to php/php.project/external/phpsigfiles-1.5-notice.txt diff --git a/php/php.project/nbproject/project.properties b/php/php.project/nbproject/project.properties index cb3f715295..985907d8e6 100644 --- a/php/php.project/nbproject/project.properties +++ b/php/php.project/nbproject/project.properties @@ -20,7 +20,7 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.8 javadoc.arch=${basedir}/arch.xml -release.external/phpsigfiles-1.4.zip=docs/phpsigfiles.zip +release.external/phpsigfiles-1.5.zip=docs/phpsigfiles.zip extra.module.files=docs/phpsigfiles.zip test.config.stableBTD.includes=**/*Test.class - 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: Fixed detection of duplicate types
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 064e9e3b84 Fixed detection of duplicate types new c12e495692 Merge pull request #5534 from KacerCZ/fix-duplicate-type-hint 064e9e3b84 is described below commit 064e9e3b84667fe7faae8c0ee5b68abbabd3dc5c Author: Tomas Prochazka AuthorDate: Sun Feb 19 15:21:38 2023 +0100 Fixed detection of duplicate types Goes through all types and does not return on first error. Partial fix for #5072 --- .../verification/UnusableTypesHintError.java | 3 - .../testDuplicateTypes_01.php | 99 ++ ...plicateTypes_01.php.testDuplicateTypes_01.hints | 114 + .../verification/UnusableTypesHintErrorTest.java | 4 + 4 files changed, 217 insertions(+), 3 deletions(-) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/verification/UnusableTypesHintError.java b/php/php.editor/src/org/netbeans/modules/php/editor/verification/UnusableTypesHintError.java index b777a168d6..227b7efe82 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/verification/UnusableTypesHintError.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/verification/UnusableTypesHintError.java @@ -430,18 +430,15 @@ public class UnusableTypesHintError extends HintErrorRule { } if (checkedTypes.contains(name)) { createDuplicateTypeError(type, typeName); -return; } else if (checkedTypes.contains(Type.BOOL)) { // bool|false bool|true if (Type.FALSE.equals(name) || Type.TRUE.equals(name)) { createDuplicateTypeError(type, typeName); -return; } } else if (checkedTypes.contains(Type.FALSE) || checkedTypes.contains(Type.TRUE)) { // false|bool true|bool if (Type.BOOL.equals(name)) { createDuplicateTypeError(type, typeName); -return; } } checkedTypes.add(name); diff --git a/php/php.editor/test/unit/data/testfiles/verification/UnusableTypesHintError/testDuplicateTypes_01.php b/php/php.editor/test/unit/data/testfiles/verification/UnusableTypesHintError/testDuplicateTypes_01.php new file mode 100644 index 00..74eb42c6b6 --- /dev/null +++ b/php/php.editor/test/unit/data/testfiles/verification/UnusableTypesHintError/testDuplicateTypes_01.php @@ -0,0 +1,99 @@ +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 DuplicateTypes { + +private First|First $union; +private First $intersection; +private First|Second|First|Second $twoUnions; +private First $twoIntersections; + +private bool|true|bool $unionBoolAndTrue; +private bool|false|bool $unionBoolAndFalse; + +private bool|true|First|First $unionAfterBoolAndTrue; +private bool|false|First|First $unionAfterBoolAndFalse; +private true|bool|First|First $unionAfterTrueAndBool; +private false|bool|First|First $unionAfterFalseAndBool; + +public function returnUnion(): First|First { +} + +public function returnIntersection(): First { +} + +public function returnTwoUnions(): First|Second|First|Second { +} + +public function returnTwoIntersections(): First { +} + +public function returnUnionBoolAndTrue(): bool|true|bool { +} + +public function returnUnionBoolAndFalse(): bool|false|bool { +} + +public function returnUnionAfterBoolAndTrue(): bool|true|First|First { +} + +public function returnUnionAfterBoolAndFalse(): bool|false|First|First { +} + +public function returnUnionAfterTrueAndBool(): true|bool|First|First { +} + +public function returnUnionAfterFalseAndBool(): false|bool|First|First { +} + +public function parameterUnion(First|First $union) { +} + +public function parameterIntersection(First $intersection) { +} + +public function parameterTwoUnions(First|Second|First|Second $twoUnions) { +} + +public function parameterTwoIntersections(First $twoIntersections) { +} + +public function parameterUnionBoolAndTrue(bool|true|bool $union) { +} + +public function parameterUnionBoolAndFalse(bool|false|bool $union) { +} + +public function parameterUnionAfterBoolAndTrue(bool|
[netbeans] branch master updated: PHP Debugger - show NULL values by default
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 16f048e68e PHP Debugger - show NULL values by default new eabde1b15d Merge pull request #5531 from KacerCZ/php-debugger-show-null 16f048e68e is described below commit 16f048e68e1d138a9f305ce6bd6a4f0b2b2be890 Author: Tomas Prochazka AuthorDate: Sat Feb 18 12:32:19 2023 +0100 PHP Debugger - show NULL values by default --- .../src/org/netbeans/modules/php/dbgp/models/VariablesModelFilter.java | 1 + 1 file changed, 1 insertion(+) diff --git a/php/php.dbgp/src/org/netbeans/modules/php/dbgp/models/VariablesModelFilter.java b/php/php.dbgp/src/org/netbeans/modules/php/dbgp/models/VariablesModelFilter.java index 116afae359..b0c2f06132 100644 --- a/php/php.dbgp/src/org/netbeans/modules/php/dbgp/models/VariablesModelFilter.java +++ b/php/php.dbgp/src/org/netbeans/modules/php/dbgp/models/VariablesModelFilter.java @@ -154,6 +154,7 @@ public class VariablesModelFilter extends ViewModelSupport FilterType.SCALARS, FilterType.SUPERGLOBALS, FilterType.RESOURCE, +FilterType.NULL, }; myShowFilters.set( filters ); } - 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: - Changed the way to parse an array type by analogy with other types. - Fixed broken tests. - Fixed issue #5375 - New tests for fixed issue have been added - Fixed br
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 267e706157 - Changed the way to parse an array type by analogy with other types. - Fixed broken tests. - Fixed issue #5375 - New tests for fixed issue have been added - Fixed broken UnusableTypesHintError new e8425feafc Merge pull request #5475 from troizet/parsing_array_type 267e706157 is described below commit 267e706157028cbb644a5b07b7b73ec302b79e03 Author: Alexey Borokhvostov AuthorDate: Sun Feb 12 13:00:36 2023 +0700 - Changed the way to parse an array type by analogy with other types. - Fixed broken tests. - Fixed issue #5375 - New tests for fixed issue have been added - Fixed broken UnusableTypesHintError --- .../modules/php/editor/parser/ASTPHP5Parser.java | 13 ++-- .../modules/php/editor/parser/ASTPHP5Symbols.java | 2 +- .../verification/UnusableTypesHintError.java | 15 ++ .../parser/php74/arrowFunctions_01.pass| 8 ++-- .../parser/php74/typedPropertiesClass.pass | 8 ++-- .../parser/php74/typedPropertiesTrait.pass | 8 ++-- .../parser/php80/namedArguments_01.pass| 4 +++- .../parser/php81/readonlyProperties_01.pass| 16 +++ .../ASTPHP5ParserTest/parser/returnTypes_02.pass | 4 +++- .../ASTPHP5ParserTest/parser/shortArrays_02.pass | 4 +++- .../completion/documentation/issueGH5375.php | 23 ++ .../issueGH5375.php.testIssueGH5375_01.html| 11 +++ .../issueGH5375.php.testIssueGH5375_02.html| 10 ++ .../editor/completion/PHPCCDocumentationTest.java | 8 php/php.editor/tools/ASTPHP5Parser.cup | 5 ++--- 15 files changed, 106 insertions(+), 33 deletions(-) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/parser/ASTPHP5Parser.java b/php/php.editor/src/org/netbeans/modules/php/editor/parser/ASTPHP5Parser.java index 9a904c96ca..cd9afd516b 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/parser/ASTPHP5Parser.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/parser/ASTPHP5Parser.java @@ -19,7 +19,7 @@ // // The following code was generated by CUP v0.11a beta 20060608 -// Tue Jan 17 01:59:15 JST 2023 +// Wed Feb 08 23:05:51 NOVT 2023 // package org.netbeans.modules.php.editor.parser; @@ -30,7 +30,7 @@ import org.netbeans.modules.php.editor.parser.astnodes.*; import org.openide.util.Pair; /** CUP v0.11a beta 20060608 generated parser. - * @version Tue Jan 17 01:59:15 JST 2023 + * @version Wed Feb 08 23:05:51 NOVT 2023 */ @org.netbeans.api.annotations.common.SuppressWarnings({"EI_EXPOSE_REP", "MS_PKGPROTECT", "BC_BAD_CAST_TO_CONCRETE_COLLECTION"}) public class ASTPHP5Parser extends java_cup.runtime.lr_parser { @@ -7685,12 +7685,11 @@ switch (CUP$ASTPHP5Parser$act_num) { case 287: // class_type_without_static ::= T_ARRAY { Expression RESULT =null; - int arrayleft = ((java_cup.runtime.Symbol)CUP$ASTPHP5Parser$stack.peek()).left; - int arrayright = ((java_cup.runtime.Symbol)CUP$ASTPHP5Parser$stack.peek()).right; - String array = (String)((java_cup.runtime.Symbol) CUP$ASTPHP5Parser$stack.peek()).value; + int nameleft = ((java_cup.runtime.Symbol)CUP$ASTPHP5Parser$stack.peek()).left; + int nameright = ((java_cup.runtime.Symbol)CUP$ASTPHP5Parser$stack.peek()).right; + String name = (String)((java_cup.runtime.Symbol) CUP$ASTPHP5Parser$stack.peek()).value; -Identifier classId = new Identifier(arrayleft, arrayright, "array"); -RESULT = classId; +RESULT = NamespaceName.create(nameleft, nameright, name); CUP$ASTPHP5Parser$result = parser.getSymbolFactory().newSymbol("class_type_without_static",163, ((java_cup.runtime.Symbol)CUP$ASTPHP5Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$ASTPHP5Parser$stack.peek()), RESULT); } diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/parser/ASTPHP5Symbols.java b/php/php.editor/src/org/netbeans/modules/php/editor/parser/ASTPHP5Symbols.java index 06e07b87f9..e7ef52d870 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/parser/ASTPHP5Symbols.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/parser/ASTPHP5Symbols.java @@ -19,7 +19,7 @@ // // The following code was generated by CUP v0.11a beta 20060608 -// Tue Jan 17 01:59:15 JST 2023 +// Wed Feb 08 23:05:51 NOVT 2023 //
[netbeans] branch master updated: Corrected a typo in the php parser tests
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 1c64bc5880 Corrected a typo in the php parser tests new 52975795ec Merge pull request #5476 from troizet/fix_php_parser_tests 1c64bc5880 is described below commit 1c64bc5880f27de272963d40c80feca6f3601a80 Author: Alexey Borokhvostov AuthorDate: Sun Feb 12 14:42:54 2023 +0700 Corrected a typo in the php parser tests --- .../treatNamespacedNamesAsSingleToken_02a.pass | 32 +-- .../treatNamespacedNamesAsSingleToken_02b.pass | 36 +++--- .../treatNamespacedNamesAsSingleToken_02a.php | 2 +- .../treatNamespacedNamesAsSingleToken_02b.php | 2 +- 4 files changed, 36 insertions(+), 36 deletions(-) diff --git a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php80/treatNamespacedNamesAsSingleToken_02a.pass b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php80/treatNamespacedNamesAsSingleToken_02a.pass index 6969358281..4483160105 100644 --- a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php80/treatNamespacedNamesAsSingleToken_02a.pass +++ b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php80/treatNamespacedNamesAsSingleToken_02a.pass @@ -615,26 +615,26 @@ namespace - -ineterface + +interface - + ; - + namespace - + enum - + ; - + - + @@ -1117,18 +1117,18 @@ - - - + + + - + - - - + + + - + diff --git a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php80/treatNamespacedNamesAsSingleToken_02b.pass b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php80/treatNamespacedNamesAsSingleToken_02b.pass index 831ac128a0..fd3c2c6af5 100644 --- a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php80/treatNamespacedNamesAsSingleToken_02b.pass +++ b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/parser/ASTPHP5ParserTest/parser/php80/treatNamespacedNamesAsSingleToken_02b.pass @@ -819,32 +819,32 @@ namespace - -ineterface + +interface - + { - + } - + namespace - + enum - + { - + } - + - + @@ -1327,18 +1327,18 @@ - - - + + + - + - - - + + + - + diff --git a/php/php.editor/test/unit/data/testfiles/parser/php80/treatNamespacedNamesAsSingleToken_02a.php b/php/php.editor/test/unit/data/testfiles/parser/php80/treatNamespacedNamesAsSingleToken_02a.php index 22a51e9e66..d62a8d5469 100644 --- a/php/php.editor/test/unit/data/testfiles/parser/php80/treatNamespacedNamesAsSingleToken_02a.php +++ b/php/php.editor/test/unit/data/testfiles/parser/php80/treatNamespacedNamesAsSingleToken_02a.php @@ -87,5 +87,5 @@ namespace callable; namespace extends; namespace implements; namespace trait; -namespace ineterface; +namespace interface; namespace enum; diff --git a/php/php.editor/test/unit/data/testfiles/parser/php80/treatNamespacedNamesAsSingleToken_02b.php b/php/php.editor/test/unit/data/testfiles/parser/php80
[netbeans] branch php82-support created (now 9445a566c5)
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a change to branch php82-support in repository https://gitbox.apache.org/repos/asf/netbeans.git at 9445a566c5 Merge pull request #4846 from junichi11/gh-4686-inheritdoc No new revisions were added by this update. - 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: Fixes unhandled ExpressionArrayAccess in PHP Editor
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 85d5c0c17b Fixes unhandled ExpressionArrayAccess in PHP Editor new 6bf270e71b Merge pull request #4308 from KacerCZ/php-expression-array-access-fix 85d5c0c17b is described below commit 85d5c0c17b2142e6bc9eda1304672a090170955b Author: Tomas Prochazka AuthorDate: Thu Jun 30 22:35:06 2022 +0200 Fixes unhandled ExpressionArrayAccess in PHP Editor --- php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java b/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java index c6e2328e98..cd55d90131 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java @@ -43,6 +43,7 @@ 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.ClassName; import org.netbeans.modules.php.editor.parser.astnodes.Expression; +import org.netbeans.modules.php.editor.parser.astnodes.ExpressionArrayAccess; import org.netbeans.modules.php.editor.parser.astnodes.FieldAccess; import org.netbeans.modules.php.editor.parser.astnodes.FormalParameter; import org.netbeans.modules.php.editor.parser.astnodes.FunctionDeclaration; @@ -288,6 +289,8 @@ public final class CodeUtils { } else if (typeName instanceof NullableType) { NullableType nullableType = (NullableType) typeName; return NULLABLE_TYPE_PREFIX + extractQualifiedName(nullableType.getType()); +} else if (typeName instanceof ExpressionArrayAccess) { +return extractQualifiedName(((ExpressionArrayAccess) typeName).getExpression()); } else if (typeName instanceof UnionType) { UnionType unionType = (UnionType) typeName; StringBuilder sb = new StringBuilder(); - 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: PHPStan alternative configuration file
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 f9e22f8097 PHPStan alternative configuration file new cd760a40fc Merge pull request #3963 from KacerCZ/phpstan-config-file f9e22f8097 is described below commit f9e22f809787ea483b41691be1a2f482d0672de2 Author: Tomas Prochazka AuthorDate: Mon Apr 11 21:23:55 2022 +0200 PHPStan alternative configuration file This change adds `phpstan.dist.neon` to Important files. PHPStan 1.4.7 added `phpstan.dist.neon` as configuration file. https://github.com/phpstan/phpstan/releases/tag/1.4.7 --- .../src/org/netbeans/modules/php/analysis/ImportantFilesImpl.java | 3 ++- .../src/org/netbeans/modules/php/analysis/commands/PHPStan.java| 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/php/php.code.analysis/src/org/netbeans/modules/php/analysis/ImportantFilesImpl.java b/php/php.code.analysis/src/org/netbeans/modules/php/analysis/ImportantFilesImpl.java index cb55ec9dce..9b253561bb 100644 --- a/php/php.code.analysis/src/org/netbeans/modules/php/analysis/ImportantFilesImpl.java +++ b/php/php.code.analysis/src/org/netbeans/modules/php/analysis/ImportantFilesImpl.java @@ -41,7 +41,8 @@ public final class ImportantFilesImpl implements ImportantFilesImplementation { CodingStandardsFixer.CONFIG_FILE_NAME_V3, CodingStandardsFixer.DIST_CONFIG_FILE_NAME_V3, PHPStan.CONFIG_FILE_NAME, -PHPStan.DIST_CONFIG_FILE_NAME}; +PHPStan.DIST_CONFIG_FILE_NAME, +PHPStan.ALTERNATIVE_DIST_CONFIG_FILE_NAME}; private final ImportantFilesSupport support; diff --git a/php/php.code.analysis/src/org/netbeans/modules/php/analysis/commands/PHPStan.java b/php/php.code.analysis/src/org/netbeans/modules/php/analysis/commands/PHPStan.java index c5734e875f..c5affcadfe 100644 --- a/php/php.code.analysis/src/org/netbeans/modules/php/analysis/commands/PHPStan.java +++ b/php/php.code.analysis/src/org/netbeans/modules/php/analysis/commands/PHPStan.java @@ -78,6 +78,7 @@ public final class PHPStan { // configuration files public static final String CONFIG_FILE_NAME = "phpstan.neon"; // NOI18N public static final String DIST_CONFIG_FILE_NAME = "phpstan.neon.dist"; // NOI18N +public static final String ALTERNATIVE_DIST_CONFIG_FILE_NAME = "phpstan.dist.neon"; // NOI18N private final String phpStanPath; private int analyzeGroupCounter = 1; - 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: Improve ImplementAbstractMethodsHintError
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 b6d57f2 Improve ImplementAbstractMethodsHintError new 30b1d7c Merge pull request #3734 from junichi11/php-improve-implement-abstract-methods-hint-error b6d57f2 is described below commit b6d57f2e23815bfb415a68a9f9547d9948146af3 Author: Junichi Yamamoto AuthorDate: Wed Mar 9 09:13:25 2022 +0900 Improve ImplementAbstractMethodsHintError - Sort method elements to get the same result --- .../verification/ImplementAbstractMethodsHintError.java | 11 ++- ...urnTypeImplementMethod01.php.testStaticReturnType_01.hints | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/verification/ImplementAbstractMethodsHintError.java b/php/php.editor/src/org/netbeans/modules/php/editor/verification/ImplementAbstractMethodsHintError.java index e9b3fc9..fbef93b 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/verification/ImplementAbstractMethodsHintError.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/verification/ImplementAbstractMethodsHintError.java @@ -23,6 +23,7 @@ import java.util.Collections; import java.util.HashSet; import java.util.LinkedHashSet; import java.util.ArrayList; +import java.util.Comparator; import java.util.List; import java.util.Set; import java.util.logging.Level; @@ -148,7 +149,15 @@ public class ImplementAbstractMethodsHintError extends HintErrorRule { allValidMethods.addAll(toNames(getValidInheritedMethods(getInheritedMethods(classScope, index; allValidMethods.addAll(toNames(index.getDeclaredMethods(classScope))); ElementFilter declaredMethods = ElementFilter.forExcludedNames(allValidMethods, PhpElementKind.METHOD); -Set accessibleMethods = declaredMethods.filter(index.getAccessibleMethods(classScope, classScope)); +List accessibleMethods = new ArrayList<>(declaredMethods.filter(index.getAccessibleMethods(classScope, classScope))); +// sort to get the same result +accessibleMethods.sort((MethodElement m1, MethodElement m2) -> { +int result = m1.getFilenameUrl().compareTo(m2.getFilenameUrl()); +if (result == 0) { +return Integer.compare(m1.getOffset(), m2.getOffset()); +} +return result; +}); Set methodSkeletons = new LinkedHashSet<>(); MethodElement lastMethodElement = null; FileObject lastFileObject = null; diff --git a/php/php.editor/test/unit/data/testfiles/verification/ImplementAbstractMethodsHintError/testStaticReturnTypeImplementMethod01.php.testStaticReturnType_01.hints b/php/php.editor/test/unit/data/testfiles/verification/ImplementAbstractMethodsHintError/testStaticReturnTypeImplementMethod01.php.testStaticReturnType_01.hints index 70580a1..0209abc 100644 --- a/php/php.editor/test/unit/data/testfiles/verification/ImplementAbstractMethodsHintError/testStaticReturnTypeImplementMethod01.php.testStaticReturnType_01.hints +++ b/php/php.editor/test/unit/data/testfiles/verification/ImplementAbstractMethodsHintError/testStaticReturnTypeImplementMethod01.php.testStaticReturnType_01.hints @@ -1,5 +1,5 @@ class TestClass implements TestInterface { - -HINT:\TestClass is not abstract and does not override abstract method testSimple() in \TestInterface +HINT:\TestClass is not abstract and does not override abstract method testUnionType() in \TestInterface FIX:Implement All Abstract Methods FIX:Declare Abstract Class - 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: [NETBEANS-6315] Escape HTML entities in PHPStan report
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 8529892 [NETBEANS-6315] Escape HTML entities in PHPStan report new b4fb977 Merge pull request #3380 from KacerCZ/netbeans-6315-phpstan-message-fix 8529892 is described below commit 852989292e99671a89ef1264cfefb89c843edbd7 Author: Tomas Prochazka AuthorDate: Sat Dec 18 11:03:02 2021 +0100 [NETBEANS-6315] Escape HTML entities in PHPStan report https://issues.apache.org/jira/browse/NETBEANS-6315 - Escapes HTML entities in message from PHPStan report --- php/php.code.analysis/manifest.mf | 2 +- php/php.code.analysis/nbproject/project.xml| 9 .../php/analysis/parsers/PHPStanReportParser.java | 4 +++- .../data/phpstan/phpstan-log-html-entities.xml | 26 ++ .../analysis/parsers/PHPStanReportParserTest.java | 14 5 files changed, 53 insertions(+), 2 deletions(-) diff --git a/php/php.code.analysis/manifest.mf b/php/php.code.analysis/manifest.mf index ecc7226..0b3efb8 100644 --- a/php/php.code.analysis/manifest.mf +++ b/php/php.code.analysis/manifest.mf @@ -2,4 +2,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.php.code.analysis OpenIDE-Module-Layer: org/netbeans/modules/php/analysis/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/php/analysis/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 0.28 +OpenIDE-Module-Specification-Version: 0.29 diff --git a/php/php.code.analysis/nbproject/project.xml b/php/php.code.analysis/nbproject/project.xml index 812ab35..dad2ea0 100644 --- a/php/php.code.analysis/nbproject/project.xml +++ b/php/php.code.analysis/nbproject/project.xml @@ -44,6 +44,15 @@ + org.netbeans.modules.editor.util + + + +1 +1.80 + + + org.netbeans.modules.extexecution diff --git a/php/php.code.analysis/src/org/netbeans/modules/php/analysis/parsers/PHPStanReportParser.java b/php/php.code.analysis/src/org/netbeans/modules/php/analysis/parsers/PHPStanReportParser.java index 2ed5e47..5638a82 100644 --- a/php/php.code.analysis/src/org/netbeans/modules/php/analysis/parsers/PHPStanReportParser.java +++ b/php/php.code.analysis/src/org/netbeans/modules/php/analysis/parsers/PHPStanReportParser.java @@ -34,6 +34,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import org.netbeans.api.annotations.common.CheckForNull; import org.netbeans.api.annotations.common.NullAllowed; +import org.netbeans.lib.editor.util.StringEscapeUtils; import org.netbeans.modules.php.analysis.results.Result; import org.netbeans.modules.php.api.util.FileUtils; import org.openide.filesystems.FileObject; @@ -165,7 +166,8 @@ public class PHPStanReportParser extends DefaultHandler { currentResult.setColumn(getInt(attributes, "column")); // NOI18N String message = attributes.getValue("message"); // NOI18N currentResult.setCategory(String.format("%s: %s", attributes.getValue("severity"), message)); // NOI18N -currentResult.setDescription(message); +// Message can contain types like "array" and description is renderd as HTML so it has to be properly escaped. +currentResult.setDescription(StringEscapeUtils.escapeHtml(message)); } private void processResultEnd() { diff --git a/php/php.code.analysis/test/unit/data/phpstan/phpstan-log-html-entities.xml b/php/php.code.analysis/test/unit/data/phpstan/phpstan-log-html-entities.xml new file mode 100644 index 000..ffe1f06 --- /dev/null +++ b/php/php.code.analysis/test/unit/data/phpstan/phpstan-log-html-entities.xml @@ -0,0 +1,26 @@ + + + + + + + diff --git a/php/php.code.analysis/test/unit/src/org/netbeans/modules/php/analysis/parsers/PHPStanReportParserTest.java b/php/php.code.analysis/test/unit/src/org/netbeans/modules/php/analysis/parsers/PHPStanReportParserTest.java index 5c9bf57..42786d7 100644 --- a/php/php.code.analysis/test/unit/src/org/netbeans/modules/php/analysis/parsers/PHPStanReportParserTest.java +++ b/php/php.code.analysis/test/unit/src/org/netbeans/modules/php/analysis/parsers/PHPStanReportParserTest.java @@ -98,6 +98,20 @@ public class PHPStanReportParserTest extends NbTestCase { assertEquals(3, results.size()); } +public void testParseWithHtmlEntities() throws Exception { +FileObject root = getDataDir("phpstan/PHPStanSupport"); +FileObject workDir = root; +L
[netbeans] branch master updated: [NETBEANS-6239] Add PHPStan rule level 9
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 d89f552 [NETBEANS-6239] Add PHPStan rule level 9 new cbb0446 Merge pull request #3341 from KacerCZ/netbeans-6239-phpstan-level-9 d89f552 is described below commit d89f552571432fd771596cfafbd09637df1618e3 Author: Tomas Prochazka AuthorDate: Sun Nov 28 12:19:20 2021 +0100 [NETBEANS-6239] Add PHPStan rule level 9 https://issues.apache.org/jira/browse/NETBEANS-6239 Added PHPStan rule level 9. Announcement: https://phpstan.org/blog/phpstan-1-0-released#level-9 --- .../src/org/netbeans/modules/php/analysis/options/AnalysisOptions.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/php.code.analysis/src/org/netbeans/modules/php/analysis/options/AnalysisOptions.java b/php/php.code.analysis/src/org/netbeans/modules/php/analysis/options/AnalysisOptions.java index 0ab7493..9f370cc 100644 --- a/php/php.code.analysis/src/org/netbeans/modules/php/analysis/options/AnalysisOptions.java +++ b/php/php.code.analysis/src/org/netbeans/modules/php/analysis/options/AnalysisOptions.java @@ -57,7 +57,7 @@ public final class AnalysisOptions { private static final String PHPSTAN_CONFIGURATION = "phpstan.configuration"; // NOI18N private static final String PHPSTAN_MEMORY_LIMIT = "phpstan.memory.limit"; // NOI18N public static final int PHPSTAN_MIN_LEVEL = Integer.getInteger("nb.phpstan.min.level", 0); // NOI18N -public static final int PHPSTAN_MAX_LEVEL = Integer.getInteger("nb.phpstan.max.level", 8); // NOI18N +public static final int PHPSTAN_MAX_LEVEL = Integer.getInteger("nb.phpstan.max.level", 9); // NOI18N private volatile boolean codeSnifferSearched = false; private volatile boolean messDetectorSearched = false; - 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 php81-support created (now 1e86a06)
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a change to branch php81-support in repository https://gitbox.apache.org/repos/asf/netbeans.git. at 1e86a06 Merge pull request #3327 from junichi11/netbeans-2472-overriding-properties No new revisions were added by this update. - 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 (ae0b68e -> 1e86a06)
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 ae0b68e Merge pull request #3316 from ppisl/NETBEANS-6196 new 94a092b [NETBEANS-2472] Mark overriding/overridden constants and properties as annotations new 898ebb0 Fix the message of TP_Overrides new 1e86a06 Merge pull request #3327 from junichi11/netbeans-2472-overriding-properties The 6190 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: .../csl/editor/overridden/Bundle.properties| 2 +- .../php/editor/csl/OverridingMethodsImpl.java | 196 - .../php/editor/elements/IndexQueryImpl.java| 16 +- .../overriding/overridden/overridden_01.pass | 18 ++ .../overriding/overriding/overriding_01.pass | 16 ++ .../overriding/overridden/ChildClass1.php | 63 +++ .../overriding/overridden/ChildClass2.php | 83 + .../overriding/overridden/overridden_01.php| 55 ++ .../overriding/overriding/ParentClass.php | 55 ++ .../overriding/overriding/overriding_01.php| 83 + .../editor/csl/OverridingMethodsImplTestBase.java | 179 +++ .../csl/OverridingMethodsOverriddenTest.java | 49 ++ .../csl/OverridingMethodsOverridingTest.java | 49 ++ 13 files changed, 847 insertions(+), 17 deletions(-) create mode 100644 php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/OverridingMethodsOverriddenTest/overriding/overridden/overridden_01.pass create mode 100644 php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/OverridingMethodsOverridingTest/overriding/overriding/overriding_01.pass create mode 100644 php/php.editor/test/unit/data/testfiles/overriding/overridden/ChildClass1.php create mode 100644 php/php.editor/test/unit/data/testfiles/overriding/overridden/ChildClass2.php create mode 100644 php/php.editor/test/unit/data/testfiles/overriding/overridden/overridden_01.php create mode 100644 php/php.editor/test/unit/data/testfiles/overriding/overriding/ParentClass.php create mode 100644 php/php.editor/test/unit/data/testfiles/overriding/overriding/overriding_01.php create mode 100644 php/php.editor/test/unit/src/org/netbeans/modules/php/editor/csl/OverridingMethodsImplTestBase.java create mode 100644 php/php.editor/test/unit/src/org/netbeans/modules/php/editor/csl/OverridingMethodsOverriddenTest.java create mode 100644 php/php.editor/test/unit/src/org/netbeans/modules/php/editor/csl/OverridingMethodsOverridingTest.java - 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 (224dfc0 -> 07639d1)
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 224dfc0 [NETBEANS-5846] Minimal support of java-platfom Gradle projects. new dbb2c6e [NETBEANS-3362] Add StructureItem.InheritedItem interface new 89b415b [NETBEANS-3362] Show inherited members on the navigator pane new 07639d1 Merge pull request #3296 from junichi11/netbeans-3362-cls-navigation-inherited-filter The 6181 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: ide/csl.api/apichanges.xml | 15 ++ ide/csl.api/nbproject/project.properties | 2 +- .../netbeans/modules/csl/api/StructureItem.java| 38 - .../src/org/netbeans/modules/csl/api/UiUtils.java | 154 +++-- .../csl/editor/overridden/ComputeAnnotations.java | 4 + .../modules/csl/navigation/BreadCrumbsTask.java| 4 +- .../modules/csl/navigation/ClassMemberFilters.java | 22 +-- .../modules/csl/navigation/ElementNode.java| 5 + .../csl/navigation/base/FiltersManager.java| 30 ++-- php/php.editor/nbproject/project.properties| 2 +- php/php.editor/nbproject/project.xml | 2 +- .../modules/php/editor/csl/NavigatorScanner.java | 134 -- .../php/editor/model/impl/ClassScopeImpl.java | 7 +- .../php/editor/model/impl/FieldElementImpl.java| 12 +- .../php/editor/model/impl/TraitScopeImpl.java | 4 +- .../structure/deprecatedTypes.pass | 2 +- .../structure/nb3362/traitedClass_01.pass | 41 ++ .../structure/nb3362/traitedClass_02.pass | 41 ++ .../structure/nb3362/traitedTrait_01.pass | 26 .../structure/nb3362/traitedTrait_02.pass | 26 .../data/testfiles/structure/nb3362/BarTrait.php | 32 + .../data/testfiles/structure/nb3362/FooTrait.php | 32 + .../testfiles/structure/nb3362/ParentClass.php | 37 + .../testfiles/structure/nb3362/traitedClass_01.php | 39 ++ .../testfiles/structure/nb3362/traitedClass_02.php | 58 .../testfiles/structure/nb3362/traitedTrait_01.php | 34 + .../testfiles/structure/nb3362/traitedTrait_02.php | 42 ++ .../php/editor/csl/NavigatorNb3362Test.java| 62 + .../modules/php/editor/csl/NavigatorTest.java | 11 +- .../php/editor/csl/PhpNavigatorTestBase.java | 41 -- 30 files changed, 823 insertions(+), 136 deletions(-) create mode 100644 php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorNb3362Test/structure/nb3362/traitedClass_01.pass create mode 100644 php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorNb3362Test/structure/nb3362/traitedClass_02.pass create mode 100644 php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorNb3362Test/structure/nb3362/traitedTrait_01.pass create mode 100644 php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorNb3362Test/structure/nb3362/traitedTrait_02.pass create mode 100644 php/php.editor/test/unit/data/testfiles/structure/nb3362/BarTrait.php create mode 100644 php/php.editor/test/unit/data/testfiles/structure/nb3362/FooTrait.php create mode 100644 php/php.editor/test/unit/data/testfiles/structure/nb3362/ParentClass.php create mode 100644 php/php.editor/test/unit/data/testfiles/structure/nb3362/traitedClass_01.php create mode 100644 php/php.editor/test/unit/data/testfiles/structure/nb3362/traitedClass_02.php create mode 100644 php/php.editor/test/unit/data/testfiles/structure/nb3362/traitedTrait_01.php create mode 100644 php/php.editor/test/unit/data/testfiles/structure/nb3362/traitedTrait_02.php create mode 100644 php/php.editor/test/unit/src/org/netbeans/modules/php/editor/csl/NavigatorNb3362Test.java - 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 php81-support created (now d29bc86)
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a change to branch php81-support in repository https://gitbox.apache.org/repos/asf/netbeans.git. at d29bc86 Merge pull request #3284 from mbien/generic_iterator No new revisions were added by this update. - 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 (bf77340 -> d5a9964)
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 bf77340 Merge pull request #3166 from mbien/col_to_array new 43e2a15 [NETBEANS-5970] Add the option for HTML palette completion new 7934294 Reformat and don't generate FQN new d5a9964 Merge pull request #3146 from junichi11/netbeans-5970-option-for-html-palette-completion The 6056 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: .../netbeans/modules/html/editor/Bundle.properties | 1 + .../html/editor/HtmlCompletionOptionsPanel.form| 21 ++- .../html/editor/HtmlCompletionOptionsPanel.java| 150 - .../modules/html/editor/HtmlPreferences.java | 16 ++- .../completion/HtmlPaletteCompletionProvider.java | 5 +- 5 files changed, 120 insertions(+), 73 deletions(-) - 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: [NETBEANS-5577] Add PHP-CS-Fixer 3.x configuration files
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 906d882 [NETBEANS-5577] Add PHP-CS-Fixer 3.x configuration files new a2cdd59 Merge pull request #2880 from KacerCZ/netbeans-5577-php-cs-fixer-v3-config-files 906d882 is described below commit 906d882f430c24f262c48e0a1095b3a0a0fb4829 Author: Tomas Prochazka AuthorDate: Tue Apr 13 20:02:13 2021 +0200 [NETBEANS-5577] Add PHP-CS-Fixer 3.x configuration files https://issues.apache.org/jira/browse/NETBEANS-5577 Added configuration files `.php-cs-fixer.php` and `.php-cs-fixer.dist.php` to Important files. Reference: - https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/3.0/UPGRADE-v3.md - https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/5607 --- .../src/org/netbeans/modules/php/analysis/ImportantFilesImpl.java | 6 -- .../modules/php/analysis/commands/CodingStandardsFixer.java | 6 -- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/php/php.code.analysis/src/org/netbeans/modules/php/analysis/ImportantFilesImpl.java b/php/php.code.analysis/src/org/netbeans/modules/php/analysis/ImportantFilesImpl.java index 7be381e..cb55ec9 100644 --- a/php/php.code.analysis/src/org/netbeans/modules/php/analysis/ImportantFilesImpl.java +++ b/php/php.code.analysis/src/org/netbeans/modules/php/analysis/ImportantFilesImpl.java @@ -36,8 +36,10 @@ public final class ImportantFilesImpl implements ImportantFilesImplementation { CodeSniffer.DOT_CONFIG_FILE_NAME, CodeSniffer.DIST_CONFIG_FILE_NAME, CodeSniffer.DIST_DOT_CONFIG_FILE_NAME, -CodingStandardsFixer.CONFIG_FILE_NAME, -CodingStandardsFixer.DIST_CONFIG_FILE_NAME, +CodingStandardsFixer.CONFIG_FILE_NAME_V2, +CodingStandardsFixer.DIST_CONFIG_FILE_NAME_V2, +CodingStandardsFixer.CONFIG_FILE_NAME_V3, +CodingStandardsFixer.DIST_CONFIG_FILE_NAME_V3, PHPStan.CONFIG_FILE_NAME, PHPStan.DIST_CONFIG_FILE_NAME}; diff --git a/php/php.code.analysis/src/org/netbeans/modules/php/analysis/commands/CodingStandardsFixer.java b/php/php.code.analysis/src/org/netbeans/modules/php/analysis/commands/CodingStandardsFixer.java index 7eed8c6..2759977 100644 --- a/php/php.code.analysis/src/org/netbeans/modules/php/analysis/commands/CodingStandardsFixer.java +++ b/php/php.code.analysis/src/org/netbeans/modules/php/analysis/commands/CodingStandardsFixer.java @@ -87,8 +87,10 @@ public final class CodingStandardsFixer { NO_INTERACTION_PARAM); // configuration files -public static final String CONFIG_FILE_NAME = ".php_cs"; // NOI18N -public static final String DIST_CONFIG_FILE_NAME = ".php_cs.dist"; // NOI18N +public static final String CONFIG_FILE_NAME_V2 = ".php_cs"; // NOI18N +public static final String DIST_CONFIG_FILE_NAME_V2 = ".php_cs.dist"; // NOI18N +public static final String CONFIG_FILE_NAME_V3 = ".php-cs-fixer.php"; // NOI18N +public static final String DIST_CONFIG_FILE_NAME_V3 = ".php-cs-fixer.dist.php"; // NOI18N @org.netbeans.api.annotations.common.SuppressWarnings(value = "MS_MUTABLE_COLLECTION", justification = "It is immutable") // NOI18N public static final List VERSIONS = Arrays.asList( - 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: [NETBEANS-5438] Fix incorrect PHP xdebug3 port config when copying to clipboard
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 94ba8a7 [NETBEANS-5438] Fix incorrect PHP xdebug3 port config when copying to clipboard new ad8c5be Merge pull request #2805 from saulotoledo/fix/incorrect_xdebug3_clipboard_config 94ba8a7 is described below commit 94ba8a7f0c1fe8b6491212681e2cdd3f4775f09f Author: Saulo Soares de Toledo AuthorDate: Thu Mar 11 22:59:13 2021 +0100 [NETBEANS-5438] Fix incorrect PHP xdebug3 port config when copying to clipboard --- .../src/org/netbeans/modules/php/dbgp/ConnectionErrMessage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/php.dbgp/src/org/netbeans/modules/php/dbgp/ConnectionErrMessage.java b/php/php.dbgp/src/org/netbeans/modules/php/dbgp/ConnectionErrMessage.java index 8d77411..b10630c 100644 --- a/php/php.dbgp/src/org/netbeans/modules/php/dbgp/ConnectionErrMessage.java +++ b/php/php.dbgp/src/org/netbeans/modules/php/dbgp/ConnectionErrMessage.java @@ -311,7 +311,7 @@ public class ConnectionErrMessage extends JPanel { StringBuilder sb = new StringBuilder(); sb.append("xdebug.mode=debug").append(NEWLINE); // NOI18N sb.append("xdebug.client_host=localhost").append(NEWLINE); // NOI18N - sb.append("xdebug.remote_port=").append(String.valueOf(PhpOptions.getInstance().getDebuggerPort())).append(NEWLINE); // NOI18N + sb.append("xdebug.client_port=").append(String.valueOf(PhpOptions.getInstance().getDebuggerPort())).append(NEWLINE); // NOI18N sb.append(String.format("xdebug.idekey=\"%s\"", PhpOptions.getInstance().getDebuggerSessionId())); // NOI18N return sb.toString(); } - 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 (fabd5e4 -> 9f3a805)
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 fabd5e4 Merge pull request #2678 from junichi11/netbeans-5244-phpdocumentor-config new c06edb9 [NETBEANS-4443] PHP 8.0 Support: Constructor Property Promotion (Part 1) new 2362a41 [NETBEANS-4443] PHP 8.0 Support: Constructor Property Promotion (Part 2) new 853da02 [NETBEANS-4443] PHP 8.0 Support: Constructor Property Promotion (Part 3) new 8a5c272 [NETBEANS-4443] PHP 8.0 Support: Constructor Property Promotion (Part 4) new 9d7588a [NETBEANS-4443] PHP 8.0 Support: Constructor Property Promotion (Part 5) new b8530e6 [NETBEANS-4443] PHP 8.0 Support: Constructor Property Promotion (Part 6) new e87cc06 [NETBEANS-4443] PHP 8.0 Support: Constructor Property Promotion (Part 7) new 809ca8e [NETBEANS-4443] PHP 8.0 Support: Constructor Property Promotion (Part 8) new 9f3a805 Merge pull request #2674 from junichi11/php80-constructor-property-promotion The 4878 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: .../php/editor/api/elements/ParameterElement.java | 15 +- .../modules/php/editor/codegen/CGSInfo.java| 10 + .../editor/completion/CompletionContextFinder.java | 37 +- .../php/editor/completion/PHPCodeCompletion.java |7 + .../php/editor/completion/PHPCompletionItem.java |7 +- .../modules/php/editor/csl/SemanticAnalysis.java | 13 + .../php/editor/elements/MethodElementImpl.java |2 +- .../php/editor/elements/ParameterElementImpl.java | 38 +- .../modules/php/editor/indent/FormatVisitor.java | 33 +- .../modules/php/editor/indent/TokenFormatter.java |4 +- .../modules/php/editor/index/PHPIndexer.java |2 +- .../php/editor/model/impl/FieldElementImpl.java| 14 +- .../php/editor/model/impl/ModelBuilder.java|1 + .../php/editor/model/impl/ModelVisitor.java| 10 + .../php/editor/model/impl/OccurenceBuilder.java| 30 +- .../editor/model/nodes/FormalParameterInfo.java|4 +- .../model/nodes/MagicMethodDeclarationInfo.java|2 +- .../model/nodes/SingleFieldDeclarationInfo.java|1 + .../modules/php/editor/parser/ASTPHP5Parser.java | 4594 ++-- .../modules/php/editor/parser/ASTPHP5Symbols.java |2 +- .../php/editor/parser/EncodedActionTable1.java | 3518 +++ .../php/editor/parser/EncodedActionTable10.java| 920 ++-- .../php/editor/parser/EncodedActionTable11.java| 776 ++-- .../php/editor/parser/EncodedActionTable12.java| 2506 +-- .../php/editor/parser/EncodedActionTable13.java| 1560 +++ .../php/editor/parser/EncodedActionTable14.java| 552 +-- .../php/editor/parser/EncodedActionTable15.java| 1244 +++--- .../php/editor/parser/EncodedActionTable16.java| 214 +- .../php/editor/parser/EncodedActionTable2.java | 2316 +- .../php/editor/parser/EncodedActionTable3.java | 3440 +++ .../php/editor/parser/EncodedActionTable4.java | 2174 - .../php/editor/parser/EncodedActionTable5.java | 1418 +++--- .../php/editor/parser/EncodedActionTable6.java | 2492 +-- .../php/editor/parser/EncodedActionTable7.java | 1378 +++--- .../php/editor/parser/EncodedActionTable8.java | 1444 +++--- .../php/editor/parser/EncodedActionTable9.java | 730 ++-- .../editor/parser/astnodes/BodyDeclaration.java| 14 + .../editor/parser/astnodes/FieldsDeclaration.java | 56 +- .../editor/parser/astnodes/FormalParameter.java| 36 +- .../modules/php/editor/resources/layer.xml |1 + .../typinghooks/PhpTypedBreakInterceptor.java |7 +- ...rrectConstructorPropertyPromotionHintError.java | 210 + .../verification/InitializeFieldSuggestion.java| 34 +- .../editor/verification/PHP80UnhandledError.java | 15 + .../verification/UnusableTypesUnhandledError.java |9 + .../editor/verification/UnusedVariableHint.java|8 +- .../editor/verification/WrongOrderOfArgsHint.java | 16 +- .../php80ConstructorPropertyPromotion.pass | 26 + ...onstructorPropertyPromotionErrorWithStatic.pass | 67 + .../php80/constructorPropertyPromotion_01.pass | 1991 + .../php80/constructorPropertyPromotion_02.pass | 274 ++ .../constructorPropertyPromotionParameter01.pass | 27 + .../testConstructorPropertyPromotionGetter.php}| 45 +- ...stConstructorPropertyPromotionGetter_01.codegen | 12 + ...stConstructorPropertyPromotionGetter_02.codegen | 12 + ...stConstructorPropertyPromotionGetter_03.codegen | 20 + ...ructorPropertyPromotionOverrideCon