You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2020/01/06 17:28:20 UTC

[GitHub] [netbeans] svenreimers opened a new pull request #1850: Update to Groovy 2.5.8

svenreimers opened a new pull request #1850: Update to Groovy 2.5.8
URL: https://github.com/apache/netbeans/pull/1850
 
 
   - Enables tests for groovy.editor on travis
   - Fixed NETBEANS-1150
   - Fixed NETBEANS-3668

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
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


[GitHub] [netbeans] mklaehn commented on a change in pull request #1850: [WIP] Update to Groovy 2.5.8

Posted by GitBox <gi...@apache.org>.
mklaehn commented on a change in pull request #1850: [WIP] Update to Groovy 2.5.8
URL: https://github.com/apache/netbeans/pull/1850#discussion_r363408887
 
 

 ##########
 File path: groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/completion/inference/TypeInferenceVisitor.java
 ##########
 @@ -144,11 +135,19 @@ public void visitVariableExpression(VariableExpression expression) {
                         int newOffset = ASTUtils.getOffset(doc, initialExpression.getLineNumber(), initialExpression.getColumnNumber());
                         AstPath newPath = new AstPath(path.root(), newOffset, doc);
                         guessedType = MethodInference.findCallerType(initialExpression, newPath, doc, newOffset);
+                    } else if (initialExpression instanceof ListExpression) {
+                        guessedType =  ((ListExpression) initialExpression).getType();
+                    } else if (initialExpression instanceof MapExpression) {
+                        guessedType =  ((MapExpression) initialExpression).getType();
+                    } else if (initialExpression instanceof RangeExpression) {
+                        // this should work, but the type is Object - nut sure why
+                        // guessedType = ((RangeExpression)initialExpression).getType();
+                        guessedType =  ClassHelper.makeWithoutCaching(Range.class, true);                
 
 Review comment:
   usually there's only one space after the assignment character

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
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


[GitHub] [netbeans] mklaehn commented on a change in pull request #1850: [WIP] Update to Groovy 2.5.8

Posted by GitBox <gi...@apache.org>.
mklaehn commented on a change in pull request #1850: [WIP] Update to Groovy 2.5.8
URL: https://github.com/apache/netbeans/pull/1850#discussion_r363408776
 
 

 ##########
 File path: groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/completion/inference/TypeInferenceVisitor.java
 ##########
 @@ -144,11 +135,19 @@ public void visitVariableExpression(VariableExpression expression) {
                         int newOffset = ASTUtils.getOffset(doc, initialExpression.getLineNumber(), initialExpression.getColumnNumber());
                         AstPath newPath = new AstPath(path.root(), newOffset, doc);
                         guessedType = MethodInference.findCallerType(initialExpression, newPath, doc, newOffset);
+                    } else if (initialExpression instanceof ListExpression) {
+                        guessedType =  ((ListExpression) initialExpression).getType();
 
 Review comment:
   usually there's only one space after the assignment character

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
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


[GitHub] [netbeans] mklaehn commented on a change in pull request #1850: [WIP] Update to Groovy 2.5.8

Posted by GitBox <gi...@apache.org>.
mklaehn commented on a change in pull request #1850: [WIP] Update to Groovy 2.5.8
URL: https://github.com/apache/netbeans/pull/1850#discussion_r363408585
 
 

 ##########
 File path: groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/completion/inference/TypeInferenceVisitor.java
 ##########
 @@ -109,19 +112,7 @@ public void visitField(FieldNode node) {
     @Override
     public void visitDeclarationExpression(DeclarationExpression expression) {
         if (sameVariableName(leaf, expression.getLeftExpression())) {
-            Expression rightExpression = expression.getRightExpression();
-            if (rightExpression instanceof ConstantExpression
-                    && !rightExpression.getText().equals("null")) { // NOI18N
-                guessedType = ((ConstantExpression) rightExpression).getType();
-            } else if (rightExpression instanceof ConstructorCallExpression) {
-                guessedType = ((ConstructorCallExpression) rightExpression).getType();
-            } else if (rightExpression instanceof MethodCallExpression) {
-                guessedType = MethodInference.findCallerType(rightExpression, path, doc, cursorOffset);
-            } else if (rightExpression instanceof StaticMethodCallExpression) {
-                guessedType = MethodInference.findCallerType(rightExpression, path, doc, cursorOffset);
-            } else if (rightExpression instanceof ListExpression) {
-                guessedType = ((ListExpression) rightExpression).getType();
-            }
+            guessedType= deriveExpressonType(expression.getRightExpression());
 
 Review comment:
   usually there's a space before the assignment character

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
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


[GitHub] [netbeans] mklaehn commented on a change in pull request #1850: [WIP] Update to Groovy 2.5.8

Posted by GitBox <gi...@apache.org>.
mklaehn commented on a change in pull request #1850: [WIP] Update to Groovy 2.5.8
URL: https://github.com/apache/netbeans/pull/1850#discussion_r363408838
 
 

 ##########
 File path: groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/completion/inference/TypeInferenceVisitor.java
 ##########
 @@ -144,11 +135,19 @@ public void visitVariableExpression(VariableExpression expression) {
                         int newOffset = ASTUtils.getOffset(doc, initialExpression.getLineNumber(), initialExpression.getColumnNumber());
                         AstPath newPath = new AstPath(path.root(), newOffset, doc);
                         guessedType = MethodInference.findCallerType(initialExpression, newPath, doc, newOffset);
+                    } else if (initialExpression instanceof ListExpression) {
+                        guessedType =  ((ListExpression) initialExpression).getType();
+                    } else if (initialExpression instanceof MapExpression) {
+                        guessedType =  ((MapExpression) initialExpression).getType();
 
 Review comment:
   usually there's only one space after the assignment character

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
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


[GitHub] [netbeans] svenreimers closed pull request #1850: [WIP] Update to Groovy 2.5.8

Posted by GitBox <gi...@apache.org>.
svenreimers closed pull request #1850: [WIP] Update to Groovy 2.5.8
URL: https://github.com/apache/netbeans/pull/1850
 
 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
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


[GitHub] [netbeans] mklaehn commented on a change in pull request #1850: [WIP] Update to Groovy 2.5.8

Posted by GitBox <gi...@apache.org>.
mklaehn commented on a change in pull request #1850: [WIP] Update to Groovy 2.5.8
URL: https://github.com/apache/netbeans/pull/1850#discussion_r363409038
 
 

 ##########
 File path: groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/completion/inference/TypeInferenceVisitor.java
 ##########
 @@ -144,11 +135,19 @@ public void visitVariableExpression(VariableExpression expression) {
                         int newOffset = ASTUtils.getOffset(doc, initialExpression.getLineNumber(), initialExpression.getColumnNumber());
                         AstPath newPath = new AstPath(path.root(), newOffset, doc);
                         guessedType = MethodInference.findCallerType(initialExpression, newPath, doc, newOffset);
+                    } else if (initialExpression instanceof ListExpression) {
+                        guessedType =  ((ListExpression) initialExpression).getType();
+                    } else if (initialExpression instanceof MapExpression) {
+                        guessedType =  ((MapExpression) initialExpression).getType();
+                    } else if (initialExpression instanceof RangeExpression) {
+                        // this should work, but the type is Object - nut sure why
+                        // guessedType = ((RangeExpression)initialExpression).getType();
+                        guessedType =  ClassHelper.makeWithoutCaching(Range.class, true);                
                     }
                 } else if (accessedVariable instanceof Parameter) {
                     Parameter param = (Parameter) accessedVariable;
                     guessedType = param.getType();
-                }
+                } 
 
 Review comment:
   this change is actually not needed ;-)

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
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