You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "troizet (via GitHub)" <gi...@apache.org> on 2024/05/20 16:33:05 UTC
[PR] PHP: removed built-in type real [netbeans]
troizet opened a new pull request, #7387:
URL: https://github.com/apache/netbeans/pull/7387
In this PR:
- deleted the built-in type `real` (php does not have a built-in `real` type: https://www.php.net/manual/en/language.types.intro.php Also see the warning under "Scalar Types": https://www.php.net/manual/en/language.types.declarations.php)
- fixed broken tests
- new tests added
- does not affect phpDoc
This PR is similar to #5294.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] PHP: removed built-in type real [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on code in PR #7387:
URL: https://github.com/apache/netbeans/pull/7387#discussion_r1668451330
##########
php/php.editor/test/unit/src/org/netbeans/modules/php/editor/completion/PHPCCDocumentationTest.java:
##########
@@ -654,6 +654,14 @@ public void testPhpDocAndFunctionInDifferentBlocks_02() throws Exception {
checkCompletionDocumentation("testfiles/completion/documentation/phpDocAndFunctionInDifferentBlocks.php", "func2^(1)", false, "");
}
+ public void testFunctionGuessingFloatReturnType_01() throws Exception {
+ checkCompletionDocumentation("testfiles/completion/documentation/functionGuessingFloatReturnType.php", "testFloatReturn^Type_01();", false, "");
+ }
Review Comment:
this was a bit of a dejavu for me but I can't remember where this happened before (groovy? javascript? php?)
what do you think about this change:
```diff
diff --git a/ide/csl.api/test/unit/src/org/netbeans/modules/csl/api/test/CslTestBase.java b/ide/csl.api/test/unit/src/org/netbeans/modules/csl/api/test/CslTestBase.java
index 4b21823..8eff017 100644
--- a/ide/csl.api/test/unit/src/org/netbeans/modules/csl/api/test/CslTestBase.java
+++ b/ide/csl.api/test/unit/src/org/netbeans/modules/csl/api/test/CslTestBase.java
@@ -107,6 +107,7 @@
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.regex.Pattern;
+import java.util.stream.Collectors;
import javax.swing.JEditorPane;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentEvent.ElementChange;
@@ -182,6 +183,7 @@
import org.openide.util.Pair;
import org.openide.util.lookup.Lookups;
import org.openide.util.test.MockLookup;
+
import static org.openide.util.test.MockLookup.setLookup;
/**
@@ -3145,13 +3147,12 @@
CodeCompletionResult completionResult = cc.complete(context);
List<CompletionProposal> proposals = completionResult.getItems();
- CompletionProposal match = null;
- for (CompletionProposal proposal : proposals) {
- if (proposal.getName().startsWith(itemPrefix)) {
- match = proposal;
- break;
- }
- }
+ List<CompletionProposal> matched = proposals.stream()
+ .filter(p -> p.getName().startsWith(itemPrefix))
+ .collect(Collectors.toList());
+ assertEquals("more than one item matched the prefix", 1, matched.size());
+ CompletionProposal match = matched.get(0);
+
assertNotNull(match);
assertNotNull(match.getElement());
```
this would prevent this situation to re-occur, however, this would also cause many other test failures right now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] PHP: removed built-in type real [netbeans]
Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #7387:
URL: https://github.com/apache/netbeans/pull/7387#discussion_r1668508930
##########
php/php.editor/test/unit/src/org/netbeans/modules/php/editor/completion/PHPCCDocumentationTest.java:
##########
@@ -654,6 +654,14 @@ public void testPhpDocAndFunctionInDifferentBlocks_02() throws Exception {
checkCompletionDocumentation("testfiles/completion/documentation/phpDocAndFunctionInDifferentBlocks.php", "func2^(1)", false, "");
}
+ public void testFunctionGuessingFloatReturnType_01() throws Exception {
+ checkCompletionDocumentation("testfiles/completion/documentation/functionGuessingFloatReturnType.php", "testFloatReturn^Type_01();", false, "");
+ }
Review Comment:
@mbien `matched.size()` may not be `1`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] PHP: removed built-in type real [netbeans]
Posted by "troizet (via GitHub)" <gi...@apache.org>.
troizet commented on PR #7387:
URL: https://github.com/apache/netbeans/pull/7387#issuecomment-2208972517
Made the suggested corrections.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] PHP: removed built-in type real [netbeans]
Posted by "troizet (via GitHub)" <gi...@apache.org>.
troizet commented on PR #7387:
URL: https://github.com/apache/netbeans/pull/7387#issuecomment-2120881709
@mbien Can I ask for the tests to be restarted? I don't have the ability to set the label before creating the PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] PHP: removed built-in type real [netbeans]
Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on code in PR #7387:
URL: https://github.com/apache/netbeans/pull/7387#discussion_r1608051235
##########
php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/Scalar.java:
##########
@@ -29,7 +29,7 @@ public class Scalar extends Expression {
public enum Type {
INT, // 'int'
- REAL, // 'real'
+ FLOAT, // 'float'
Review Comment:
Right, we cannot do this if it is an API/SPI. If you really want to do that, the steps should be like:
- in release X
- deprecate the `REAL` type + document all the details (why deprecated and when it will be removed)
- add new `FLOAT` type
- change the code under our control to start using the `FLOAT` type
- increase the minor API version of the module
- in release X + Y (Y is quite a big number, we cannot do it in the near future, we need to give time to our API consumers - plugins - to change their code):
- remove the `REAL` type
- increase the **major** API version of the module
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] PHP: removed built-in type real [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on code in PR #7387:
URL: https://github.com/apache/netbeans/pull/7387#discussion_r1668389146
##########
php/php.editor/test/unit/src/org/netbeans/modules/php/editor/completion/PHPCCDocumentationTest.java:
##########
@@ -654,6 +654,14 @@ public void testPhpDocAndFunctionInDifferentBlocks_02() throws Exception {
checkCompletionDocumentation("testfiles/completion/documentation/phpDocAndFunctionInDifferentBlocks.php", "func2^(1)", false, "");
}
+ public void testFunctionGuessingFloatReturnType_01() throws Exception {
+ checkCompletionDocumentation("testfiles/completion/documentation/functionGuessingFloatReturnType.php", "testFloatReturn^Type_01();", false, "");
+ }
Review Comment:
this test started failing recently on linux. Could this be some kind of race condition where it is sometimes returning a different completion item?
it works fine on windows.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] PHP: removed built-in type real [netbeans]
Posted by "troizet (via GitHub)" <gi...@apache.org>.
troizet commented on PR #7387:
URL: https://github.com/apache/netbeans/pull/7387#issuecomment-2211103824
@junichi11 Forgot to set milestone for this PR, or is it optional? Thank you!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] PHP: removed built-in type real [netbeans]
Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #7387:
URL: https://github.com/apache/netbeans/pull/7387#discussion_r1668394526
##########
php/php.editor/test/unit/src/org/netbeans/modules/php/editor/completion/PHPCCDocumentationTest.java:
##########
@@ -654,6 +654,14 @@ public void testPhpDocAndFunctionInDifferentBlocks_02() throws Exception {
checkCompletionDocumentation("testfiles/completion/documentation/phpDocAndFunctionInDifferentBlocks.php", "func2^(1)", false, "");
}
+ public void testFunctionGuessingFloatReturnType_01() throws Exception {
+ checkCompletionDocumentation("testfiles/completion/documentation/functionGuessingFloatReturnType.php", "testFloatReturn^Type_01();", false, "");
+ }
Review Comment:
I also noticed it. I'll fix it ASAP. Thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] PHP: removed built-in type real [netbeans]
Posted by "troizet (via GitHub)" <gi...@apache.org>.
troizet commented on code in PR #7387:
URL: https://github.com/apache/netbeans/pull/7387#discussion_r1668481212
##########
php/php.editor/test/unit/src/org/netbeans/modules/php/editor/completion/PHPCCDocumentationTest.java:
##########
@@ -654,6 +654,14 @@ public void testPhpDocAndFunctionInDifferentBlocks_02() throws Exception {
checkCompletionDocumentation("testfiles/completion/documentation/phpDocAndFunctionInDifferentBlocks.php", "func2^(1)", false, "");
}
+ public void testFunctionGuessingFloatReturnType_01() throws Exception {
+ checkCompletionDocumentation("testfiles/completion/documentation/functionGuessingFloatReturnType.php", "testFloatReturn^Type_01();", false, "");
+ }
Review Comment:
@mbien @junichi11 I apologize for the problematic tests. Couldn't this also be related to the #6066?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] PHP: removed built-in type real [netbeans]
Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on code in PR #7387:
URL: https://github.com/apache/netbeans/pull/7387#discussion_r1668417222
##########
php/php.editor/test/unit/src/org/netbeans/modules/php/editor/completion/PHPCCDocumentationTest.java:
##########
@@ -654,6 +654,14 @@ public void testPhpDocAndFunctionInDifferentBlocks_02() throws Exception {
checkCompletionDocumentation("testfiles/completion/documentation/phpDocAndFunctionInDifferentBlocks.php", "func2^(1)", false, "");
}
+ public void testFunctionGuessingFloatReturnType_01() throws Exception {
+ checkCompletionDocumentation("testfiles/completion/documentation/functionGuessingFloatReturnType.php", "testFloatReturn^Type_01();", false, "");
+ }
Review Comment:
Thanks a lot, @junichi11!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] PHP: removed built-in type real [netbeans]
Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on code in PR #7387:
URL: https://github.com/apache/netbeans/pull/7387#discussion_r1608052594
##########
php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/CastExpression.java:
##########
@@ -27,7 +27,7 @@ public class CastExpression extends Expression {
public enum Type {
INT, // 'int'
- REAL, // 'real'
+ FLOAT, // 'float'
Review Comment:
Yes, see [my comment](https://github.com/apache/netbeans/pull/7387#discussion_r1608051235).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] PHP: removed built-in type real [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on code in PR #7387:
URL: https://github.com/apache/netbeans/pull/7387#discussion_r1668514634
##########
php/php.editor/test/unit/src/org/netbeans/modules/php/editor/completion/PHPCCDocumentationTest.java:
##########
@@ -654,6 +654,14 @@ public void testPhpDocAndFunctionInDifferentBlocks_02() throws Exception {
checkCompletionDocumentation("testfiles/completion/documentation/phpDocAndFunctionInDifferentBlocks.php", "func2^(1)", false, "");
}
+ public void testFunctionGuessingFloatReturnType_01() throws Exception {
+ checkCompletionDocumentation("testfiles/completion/documentation/functionGuessingFloatReturnType.php", "testFloatReturn^Type_01();", false, "");
+ }
Review Comment:
> @mbien `matched.size()` may not be `1`.
in that case it needs to be sorted so that it doesn't randomly fail
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] PHP: removed built-in type real [netbeans]
Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #7387:
URL: https://github.com/apache/netbeans/pull/7387#discussion_r1607347715
##########
php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/CastExpression.java:
##########
@@ -27,7 +27,7 @@ public class CastExpression extends Expression {
public enum Type {
INT, // 'int'
- REAL, // 'real'
+ FLOAT, // 'float'
Review Comment:
I don't think we should change this because this is an API.
@tmysik What do you think?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] PHP: removed built-in type real [netbeans]
Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on code in PR #7387:
URL: https://github.com/apache/netbeans/pull/7387#discussion_r1608051235
##########
php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/Scalar.java:
##########
@@ -29,7 +29,7 @@ public class Scalar extends Expression {
public enum Type {
INT, // 'int'
- REAL, // 'real'
+ FLOAT, // 'float'
Review Comment:
Right, we cannot do this. If you really want to do that, the steps should be like:
- in release X
- deprecate the `REAL` type + document all the details (why deprecated and when it will be removed)
- add new `FLOAT` type
- change the code under our control to start using the `FLOAT` type
- increase the minor API version of the module
- in release X + Y (Y is quite a big number, we cannot do it in the near future, we need to give time to our API consumers - plugins - to change their code):
- remove the `REAL` type
- increase the **major** API version of the module
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] PHP: removed built-in type real [netbeans]
Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on PR #7387:
URL: https://github.com/apache/netbeans/pull/7387#issuecomment-2122302185
_Note:_ If we already did something similar in #5294, then it is unfortunate, as I explained above. Ideally, we should revert the API change and follow the steps I described.
OTOH, not sure how many plugins exist that are affected by this change and therefore can be broken. Also, the fix should be easy, but we must avoid of such API changes, definitely.
CC @junichi11
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] PHP: removed built-in type real [netbeans]
Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #7387:
URL: https://github.com/apache/netbeans/pull/7387#discussion_r1662491703
##########
php/php.editor/src/org/netbeans/modules/php/editor/typinghooks/PhpCommentGenerator.java:
##########
@@ -541,7 +541,7 @@ public void scan(ASTNode node) {
case INT:
type = Type.INTEGER;
break;
- case REAL:
Review Comment:
It should be OK (I assume all `REAL` types were replaced with `FLOAT` in the parser).
But I would leave it, just in case.
##########
php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP54UnhandledError.java:
##########
@@ -156,7 +156,7 @@ public void visit(Scalar node) {
if (CancelSupport.getDefault().isCancelled()) {
return;
}
- if (node.getScalarType().equals(Scalar.Type.REAL) && node.getStringValue().startsWith(BINARY_PREFIX)) {
+ if (node.getScalarType().equals(Scalar.Type.FLOAT) && node.getStringValue().startsWith(BINARY_PREFIX)) {
Review Comment:
It should be OK (I assume all `REAL` types were replaced with `FLOAT` in the parser).
But I would keep both types, just in case.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] PHP: removed built-in type real [netbeans]
Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on code in PR #7387:
URL: https://github.com/apache/netbeans/pull/7387#discussion_r1608051235
##########
php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/Scalar.java:
##########
@@ -29,7 +29,7 @@ public class Scalar extends Expression {
public enum Type {
INT, // 'int'
- REAL, // 'real'
+ FLOAT, // 'float'
Review Comment:
Right, we cannot do this. If you really want to do that, the steps should be like:
- in release X
- deprecate the `REAL` type + document all the details (why deprecated and when it will be removed)
- add new `FLOAT` type
- change the code under our control to start using the `FLOAT` type
- in release X + Y (Y is quite a big number, we cannot do it in the near future, we need to give time to our API consumers - plugins - to change their code):
- remove the `REAL` type
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] PHP: removed built-in type real [netbeans]
Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #7387:
URL: https://github.com/apache/netbeans/pull/7387#discussion_r1607347817
##########
php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/Scalar.java:
##########
@@ -29,7 +29,7 @@ public class Scalar extends Expression {
public enum Type {
INT, // 'int'
- REAL, // 'real'
+ FLOAT, // 'float'
Review Comment:
I don't think we should change this because this is an API.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] PHP: removed built-in type real [netbeans]
Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #7387:
URL: https://github.com/apache/netbeans/pull/7387#discussion_r1668523442
##########
php/php.editor/test/unit/src/org/netbeans/modules/php/editor/completion/PHPCCDocumentationTest.java:
##########
@@ -654,6 +654,14 @@ public void testPhpDocAndFunctionInDifferentBlocks_02() throws Exception {
checkCompletionDocumentation("testfiles/completion/documentation/phpDocAndFunctionInDifferentBlocks.php", "func2^(1)", false, "");
}
+ public void testFunctionGuessingFloatReturnType_01() throws Exception {
+ checkCompletionDocumentation("testfiles/completion/documentation/functionGuessingFloatReturnType.php", "testFloatReturn^Type_01();", false, "");
+ }
Review Comment:
Yes, the cause is it, I think.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] PHP: removed built-in type real [netbeans]
Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #7387:
URL: https://github.com/apache/netbeans/pull/7387#discussion_r1668413707
##########
php/php.editor/test/unit/src/org/netbeans/modules/php/editor/completion/PHPCCDocumentationTest.java:
##########
@@ -654,6 +654,14 @@ public void testPhpDocAndFunctionInDifferentBlocks_02() throws Exception {
checkCompletionDocumentation("testfiles/completion/documentation/phpDocAndFunctionInDifferentBlocks.php", "func2^(1)", false, "");
}
+ public void testFunctionGuessingFloatReturnType_01() throws Exception {
+ checkCompletionDocumentation("testfiles/completion/documentation/functionGuessingFloatReturnType.php", "testFloatReturn^Type_01();", false, "");
+ }
Review Comment:
It should be fixed in https://github.com/apache/netbeans/pull/7553. Sorry for the inconvenience.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] PHP: removed built-in type real [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on code in PR #7387:
URL: https://github.com/apache/netbeans/pull/7387#discussion_r1668451330
##########
php/php.editor/test/unit/src/org/netbeans/modules/php/editor/completion/PHPCCDocumentationTest.java:
##########
@@ -654,6 +654,14 @@ public void testPhpDocAndFunctionInDifferentBlocks_02() throws Exception {
checkCompletionDocumentation("testfiles/completion/documentation/phpDocAndFunctionInDifferentBlocks.php", "func2^(1)", false, "");
}
+ public void testFunctionGuessingFloatReturnType_01() throws Exception {
+ checkCompletionDocumentation("testfiles/completion/documentation/functionGuessingFloatReturnType.php", "testFloatReturn^Type_01();", false, "");
+ }
Review Comment:
this was a bit of a dejavu for me but I can't remember where this happened before (groovy? javascript? php?)
what do you think about this change:
```diff
diff --git a/ide/csl.api/test/unit/src/org/netbeans/modules/csl/api/test/CslTestBase.java b/ide/csl.api/test/unit/src/org/netbeans/modules/csl/api/test/CslTestBase.java
index 4b21823..8eff017 100644
--- a/ide/csl.api/test/unit/src/org/netbeans/modules/csl/api/test/CslTestBase.java
+++ b/ide/csl.api/test/unit/src/org/netbeans/modules/csl/api/test/CslTestBase.java
@@ -107,6 +107,7 @@
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.regex.Pattern;
+import java.util.stream.Collectors;
import javax.swing.JEditorPane;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentEvent.ElementChange;
@@ -182,6 +183,7 @@
import org.openide.util.Pair;
import org.openide.util.lookup.Lookups;
import org.openide.util.test.MockLookup;
+
import static org.openide.util.test.MockLookup.setLookup;
/**
@@ -3145,13 +3147,12 @@
CodeCompletionResult completionResult = cc.complete(context);
List<CompletionProposal> proposals = completionResult.getItems();
- CompletionProposal match = null;
- for (CompletionProposal proposal : proposals) {
- if (proposal.getName().startsWith(itemPrefix)) {
- match = proposal;
- break;
- }
- }
+ List<CompletionProposal> matched = proposals.stream()
+ .filter(p -> p.getName().startsWith(itemPrefix))
+ .collect(Collectors.toList());
+ assertEquals("more than one item matched the prefix", 1, matched.size());
+ CompletionProposal match = matched.get(0);
+
assertNotNull(match);
assertNotNull(match.getElement());
```
this would avoid prevent this situation to re-occur, however, this would also cause many other test failures right now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] PHP: removed built-in type real [netbeans]
Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #7387:
URL: https://github.com/apache/netbeans/pull/7387#discussion_r1668510265
##########
php/php.editor/test/unit/src/org/netbeans/modules/php/editor/completion/PHPCCDocumentationTest.java:
##########
@@ -654,6 +654,14 @@ public void testPhpDocAndFunctionInDifferentBlocks_02() throws Exception {
checkCompletionDocumentation("testfiles/completion/documentation/phpDocAndFunctionInDifferentBlocks.php", "func2^(1)", false, "");
}
+ public void testFunctionGuessingFloatReturnType_01() throws Exception {
+ checkCompletionDocumentation("testfiles/completion/documentation/functionGuessingFloatReturnType.php", "testFloatReturn^Type_01();", false, "");
+ }
Review Comment:
@troizet Maybe, It is not related to this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] PHP: removed built-in type real [netbeans]
Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 merged PR #7387:
URL: https://github.com/apache/netbeans/pull/7387
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists