From 6423ae6b9f65e4e27e5d88f110ae78eb8b5566b2 Mon Sep 17 00:00:00 2001 From: Manindra Moharana Date: Sun, 7 Jul 2013 12:47:57 +0530 Subject: [PATCH] bug fix in local completion involving qualified name/field access, fd2 --- .../mode/experimental/ASTGenerator.java | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/pdex/src/processing/mode/experimental/ASTGenerator.java b/pdex/src/processing/mode/experimental/ASTGenerator.java index d778ecc56..0157773d5 100644 --- a/pdex/src/processing/mode/experimental/ASTGenerator.java +++ b/pdex/src/processing/mode/experimental/ASTGenerator.java @@ -1865,6 +1865,7 @@ public class ASTGenerator { */ @SuppressWarnings("unchecked") private static ASTNode findDeclaration(Name findMe) { + // WARNING: You're entering the Rube Goldberg territory of Experimental Mode. // To debug this code, thou must take the Recursive Leap of Faith. @@ -1978,7 +1979,6 @@ public class ASTGenerator { null); } else{ - System.out.println("hereeee."); if(findMe instanceof QualifiedName){ QualifiedName qnn = (QualifiedName) findMe; System.out.println("findMe is a QN, " @@ -2176,6 +2176,26 @@ public class ASTGenerator { return definedIn(declaringClass, qn.getName().toString(), constrains, null); } + else{ + if(findMe instanceof QualifiedName){ + QualifiedName qnn = (QualifiedName) findMe; + System.out.println("findMe is a QN, " + + (qnn.getQualifier().toString() + " other " + qnn.getName() + .toString())); + + SimpleType stp = extracTypeInfo(findDeclaration2((qnn.getQualifier()), alternateParent)); + System.out.println(qnn.getQualifier() + "->" + qnn.getName()); + declaringClass = findDeclaration2(stp.getName(), alternateParent); + + System.out.println("QN decl class: " + + getNodeAsString(declaringClass)); + constrains.clear(); + constrains.add(ASTNode.TYPE_DECLARATION); + constrains.add(ASTNode.FIELD_DECLARATION); + return definedIn(declaringClass, qnn.getName().toString(), constrains, + null); + } + } } else if (parent.getNodeType() == ASTNode.SIMPLE_TYPE) { constrains.add(ASTNode.TYPE_DECLARATION); if (parent.getParent().getNodeType() == ASTNode.CLASS_INSTANCE_CREATION)