sdedic commented on a change in pull request #3408:
URL: https://github.com/apache/netbeans/pull/3408#discussion_r778954129
##########
File path:
groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/completion/inference/TypeInferenceVisitor.java
##########
@@ -99,6 +99,8 @@ public void visitField(FieldNode node) {
if (sameVariableName(leaf, node)) {
if (node.hasInitialExpression()){
guessedType = deriveExpressonType(node.getInitialExpression());
+ } else if (node.getType() != null) {
+ guessedType = node.getType();
Review comment:
Q: would `GroovyUtils.findInferredType()` in addition to getType() bring
some benefits here ?
##########
File path:
groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/occurrences/TypeVisitor.java
##########
@@ -139,6 +139,11 @@ public void collect() {
visitClosureListExpression((ClosureListExpression)
scope);
return;
}
+ } else if (scope instanceof ClassNode) {
+ ClassNode classNode = (ClassNode) scope;
+ for (FieldNode fieldNode: classNode.getFields()) {
+ visitField(fieldNode);
Review comment:
just fields ?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists