diff --git a/pdex/Todo, GSoC 2013.txt b/pdex/Todo, GSoC 2013.txt index 2f7dd80c8..856ee76c8 100644 --- a/pdex/Todo, GSoC 2013.txt +++ b/pdex/Todo, GSoC 2013.txt @@ -20,7 +20,7 @@ x! Should I implement wrapper for ASTNode? - possibly needed for code completion x Differentiating between multiple statements on the same line. How to? Done with offset handling. Finer details -* Obj a1; a1.-> completion doesn't work before it is instantiated. Look into that. +x Obj a1; a1.-> completion doesn't work before it is instantiated. Look into that. Began working again by itself. Yay! * printStuff(int,float,String) - completion endings have to be appropriate. Right now it's just printStuff(,,). Cursor positioning also needs to be taken care of. Argument list as tooltip if possible? * Sorted list of completion candidates - fields, then methods. It's unsorted presently. *! p5 enhanced stuff in java, how does it fit in with everything else, and edge cases. Possibly add support for them. Offset handling improvements should help here. @@ -28,8 +28,8 @@ Finer details * Need to add offset correction to ASTGenerator and its lookup methods. Or leave it for later? All set to implement Completion List -* Dynamically update the list instead of recreating on every keystroke(new list data, pos, etc.) -* List should get hidden on hitting esc key +x Dynamically update the list instead of recreating on every keystroke(new list data, pos, etc.) +x List should get hidden on hitting esc key Offset Mapping ============== diff --git a/pdex/src/processing/mode/experimental/ASTGenerator.java b/pdex/src/processing/mode/experimental/ASTGenerator.java index 87f7e8718..86f7ff2a5 100644 --- a/pdex/src/processing/mode/experimental/ASTGenerator.java +++ b/pdex/src/processing/mode/experimental/ASTGenerator.java @@ -1751,8 +1751,18 @@ public class ASTGenerator { return null; } + /** + * Give this thing a {@link Name} instance - a {@link SimpleName} from the + * ASTNode for ex, and it tries its level best to locate its declaration in + * the AST. It really does. + * + * @param findMe + * @return + */ @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 take the Recursive Leap of Faith. ASTNode declaringClass = null; ASTNode parent = findMe.getParent(); ASTNode ret = null; @@ -1908,6 +1918,12 @@ public class ASTGenerator { return null; } + /** + * A variation of findDeclaration() but accepts an alternate parent ASTNode + * @param findMe + * @param alternateParent + * @return + */ private static ASTNode findDeclaration2(Name findMe, ASTNode alternateParent) { ASTNode declaringClass = null; ASTNode parent = findMe.getParent();