public class CompletionGenerator extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
CompletionGenerator.ClassMember
A wrapper for java.lang.reflect types.
|
| Modifier and Type | Field and Description |
|---|---|
protected List<CompletionCandidate> |
candidates |
protected String |
lastPredictedPhrase |
| Constructor and Description |
|---|
CompletionGenerator() |
| Modifier and Type | Method and Description |
|---|---|
static CompletionCandidate[] |
checkForTypes(org.eclipse.jdt.core.dom.ASTNode node) |
protected static org.eclipse.jdt.core.dom.ASTNode |
definedIn(org.eclipse.jdt.core.dom.ASTNode node,
String name,
ArrayList<Integer> constrains) |
static CompletionGenerator.ClassMember |
definedIn3rdPartyClass(PreprocessedSketch ps,
CompletionGenerator.ClassMember tehClass,
String memberName) |
static CompletionGenerator.ClassMember |
definedIn3rdPartyClass(PreprocessedSketch ps,
String className,
String memberName) |
static org.eclipse.jdt.core.dom.SimpleType |
extracTypeInfo(org.eclipse.jdt.core.dom.ASTNode node)
Find the SimpleType from FD, SVD, VDS, etc
|
static org.eclipse.jdt.core.dom.Type |
extracTypeInfo2(org.eclipse.jdt.core.dom.ASTNode node) |
protected static DefaultListModel<CompletionCandidate> |
filterPredictions(List<CompletionCandidate> candidates) |
protected static Class<?> |
findClassIfExists(PreprocessedSketch ps,
String className)
Searches for the particular class in the default list of imports as well as
the Sketch classpath
|
protected static org.eclipse.jdt.core.dom.ASTNode |
findClosestNode(int lineNumber,
org.eclipse.jdt.core.dom.ASTNode node) |
protected static org.eclipse.jdt.core.dom.ASTNode |
findClosestParentNode(int lineNumber,
org.eclipse.jdt.core.dom.ASTNode node) |
protected static org.eclipse.jdt.core.dom.ASTNode |
findDeclaration(org.eclipse.jdt.core.dom.Name findMe)
Give this thing a
Name instance - a SimpleName from the
ASTNode for ex, and it tries its level best to locate its declaration in
the AST. |
protected static org.eclipse.jdt.core.dom.ASTNode |
findDeclaration2(org.eclipse.jdt.core.dom.Name findMe,
org.eclipse.jdt.core.dom.ASTNode alternateParent)
A variation of findDeclaration() but accepts an alternate parent ASTNode
|
static Class<?> |
getArrayClass(String elementClass,
ClassLoader classLoader) |
static org.eclipse.jdt.core.dom.ASTNode |
getChildExpression(org.eclipse.jdt.core.dom.ASTNode expression)
For a().abc.a123 this would return a123
|
static int |
getLineNumber(org.eclipse.jdt.core.dom.ASTNode node)
Fetches line number of the node in its CompilationUnit.
|
static ArrayList<CompletionCandidate> |
getMembersForType(PreprocessedSketch ps,
CompletionGenerator.ClassMember tehClass,
String childToLookFor,
boolean noCompare,
boolean staticOnly) |
static ArrayList<CompletionCandidate> |
getMembersForType(PreprocessedSketch ps,
String typeName,
String child,
boolean noCompare,
boolean staticOnly)
Loads classes from .jar files in sketch classpath
|
protected static String |
getNodeAsString(org.eclipse.jdt.core.dom.ASTNode node) |
static org.eclipse.jdt.core.dom.ASTNode |
getParentExpression(org.eclipse.jdt.core.dom.ASTNode expression) |
protected static boolean |
ignorableSuggestionImport(PreprocessedSketch ps,
String impName) |
protected static Class<?> |
loadClass(String className,
ClassLoader classLoader) |
List<CompletionCandidate> |
preparePredictions(PreprocessedSketch ps,
String pdePhrase,
int lineNumber)
The main function that calculates possible code completion candidates
|
static org.eclipse.jdt.core.dom.ASTNode |
resolveExpression(org.eclipse.jdt.core.dom.ASTNode nearestNode,
org.eclipse.jdt.core.dom.ASTNode expression,
boolean noCompare)
Find the parent of the expression in a().b, this would give me the return
type of a(), so that we can find all children of a() begininng with b
|
static CompletionGenerator.ClassMember |
resolveExpression3rdParty(PreprocessedSketch ps,
org.eclipse.jdt.core.dom.ASTNode nearestNode,
org.eclipse.jdt.core.dom.ASTNode astNode,
boolean noCompare)
Finds the type of the expression in foo.bar().a().b, this would give me the
type of b if it exists in return type of a().
|
protected static List<CompletionCandidate> |
trimCandidates(String newWord,
List<CompletionCandidate> candidates) |
protected List<CompletionCandidate> candidates
protected String lastPredictedPhrase
public static CompletionCandidate[] checkForTypes(org.eclipse.jdt.core.dom.ASTNode node)
public static org.eclipse.jdt.core.dom.ASTNode resolveExpression(org.eclipse.jdt.core.dom.ASTNode nearestNode,
org.eclipse.jdt.core.dom.ASTNode expression,
boolean noCompare)
nearestNode - expression - public static CompletionGenerator.ClassMember resolveExpression3rdParty(PreprocessedSketch ps, org.eclipse.jdt.core.dom.ASTNode nearestNode, org.eclipse.jdt.core.dom.ASTNode astNode, boolean noCompare)
nearestNode - astNode - public static Class<?> getArrayClass(String elementClass, ClassLoader classLoader)
public static org.eclipse.jdt.core.dom.ASTNode getChildExpression(org.eclipse.jdt.core.dom.ASTNode expression)
expression - public static org.eclipse.jdt.core.dom.ASTNode getParentExpression(org.eclipse.jdt.core.dom.ASTNode expression)
public static ArrayList<CompletionCandidate> getMembersForType(PreprocessedSketch ps, String typeName, String child, boolean noCompare, boolean staticOnly)
typeName - child - noCompare - public static ArrayList<CompletionCandidate> getMembersForType(PreprocessedSketch ps, CompletionGenerator.ClassMember tehClass, String childToLookFor, boolean noCompare, boolean staticOnly)
protected static Class<?> findClassIfExists(PreprocessedSketch ps, String className)
className - protected static Class<?> loadClass(String className, ClassLoader classLoader)
public static CompletionGenerator.ClassMember definedIn3rdPartyClass(PreprocessedSketch ps, String className, String memberName)
public static CompletionGenerator.ClassMember definedIn3rdPartyClass(PreprocessedSketch ps, CompletionGenerator.ClassMember tehClass, String memberName)
protected static org.eclipse.jdt.core.dom.ASTNode findClosestParentNode(int lineNumber,
org.eclipse.jdt.core.dom.ASTNode node)
protected static org.eclipse.jdt.core.dom.ASTNode findClosestNode(int lineNumber,
org.eclipse.jdt.core.dom.ASTNode node)
public static int getLineNumber(org.eclipse.jdt.core.dom.ASTNode node)
node - protected static org.eclipse.jdt.core.dom.ASTNode findDeclaration(org.eclipse.jdt.core.dom.Name findMe)
Name instance - a SimpleName from the
ASTNode for ex, and it tries its level best to locate its declaration in
the AST. It really does.findMe - protected static org.eclipse.jdt.core.dom.ASTNode findDeclaration2(org.eclipse.jdt.core.dom.Name findMe,
org.eclipse.jdt.core.dom.ASTNode alternateParent)
findMe - alternateParent - protected static boolean ignorableSuggestionImport(PreprocessedSketch ps, String impName)
public static org.eclipse.jdt.core.dom.SimpleType extracTypeInfo(org.eclipse.jdt.core.dom.ASTNode node)
node - public static org.eclipse.jdt.core.dom.Type extracTypeInfo2(org.eclipse.jdt.core.dom.ASTNode node)
protected static org.eclipse.jdt.core.dom.ASTNode definedIn(org.eclipse.jdt.core.dom.ASTNode node,
String name,
ArrayList<Integer> constrains)
protected static String getNodeAsString(org.eclipse.jdt.core.dom.ASTNode node)
protected static List<CompletionCandidate> trimCandidates(String newWord, List<CompletionCandidate> candidates)
public List<CompletionCandidate> preparePredictions(PreprocessedSketch ps, String pdePhrase, int lineNumber)
pdePhrase - line - lineStartNonWSOffset - protected static DefaultListModel<CompletionCandidate> filterPredictions(List<CompletionCandidate> candidates)
Copyright © 2001–2017 Processing Foundation. All rights reserved.