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 2022/01/05 16:25:48 UTC

[GitHub] [netbeans] sdedic commented on a change in pull request #3408: [NETBEANS-6361] Code completion for class fields doesn't work.

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