mirror of
https://github.com/processing/processing4.git
synced 2026-02-12 01:50:44 +01:00
bug fix in local completion involving qualified name/field access, fd2
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user