mirror of
https://github.com/processing/processing4.git
synced 2026-02-12 18:10:43 +01:00
Sorted completion list
This commit is contained in:
@@ -16,6 +16,7 @@ import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -714,6 +715,7 @@ public class ASTGenerator {
|
||||
|
||||
}
|
||||
|
||||
Collections.sort(candidates);
|
||||
CompletionCandidate[][] candi = new CompletionCandidate[candidates
|
||||
.size()][1];
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.util.List;
|
||||
import org.eclipse.jdt.core.dom.ASTNode;
|
||||
import org.eclipse.jdt.core.dom.MethodDeclaration;
|
||||
|
||||
public class CompletionCandidate {
|
||||
public class CompletionCandidate implements Comparable<CompletionCandidate>{
|
||||
|
||||
private String definingClass;
|
||||
|
||||
@@ -119,4 +119,12 @@ public class CompletionCandidate {
|
||||
return type;
|
||||
}
|
||||
|
||||
public int compareTo(CompletionCandidate cc) {
|
||||
if(type != cc.getType()){
|
||||
return cc.getType() - type;
|
||||
}
|
||||
|
||||
return (elementName.compareTo(cc.getElementName()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user