cleanup
This commit is contained in:
@@ -54,14 +54,16 @@ public abstract class AbstractScoreableProposal implements ICompletionProposalWi
|
||||
return p1.getLabel().compareTo(p2.getLabel());
|
||||
}
|
||||
};
|
||||
|
||||
public abstract double getBaseScore();
|
||||
|
||||
public final double getScore() {
|
||||
return getBaseScore() - deemphasizedBy;
|
||||
}
|
||||
@Override
|
||||
public AbstractScoreableProposal deemphasize(double howmuch) {
|
||||
Assert.isLegal(howmuch>=0.0);
|
||||
deemphasizedBy+= howmuch*DEEMP_VALUE;
|
||||
Assert.isLegal(howmuch >= 0.0);
|
||||
deemphasizedBy += howmuch * DEEMP_VALUE;
|
||||
return this;
|
||||
}
|
||||
public boolean isDeemphasized() {
|
||||
|
||||
@@ -35,6 +35,7 @@ import org.springframework.ide.vscode.boot.java.Annotations;
|
||||
import org.springframework.ide.vscode.boot.java.annotations.AnnotationHierarchies;
|
||||
import org.springframework.ide.vscode.boot.java.handlers.CompletionProvider;
|
||||
import org.springframework.ide.vscode.boot.java.rewrite.RewriteRefactorings;
|
||||
import org.springframework.ide.vscode.boot.java.utils.ASTUtils;
|
||||
import org.springframework.ide.vscode.commons.java.IJavaProject;
|
||||
import org.springframework.ide.vscode.commons.languageserver.completion.ICompletionProposal;
|
||||
import org.springframework.ide.vscode.commons.languageserver.java.JavaProjectFinder;
|
||||
@@ -93,7 +94,7 @@ public class BeanCompletionProvider implements CompletionProvider {
|
||||
}
|
||||
|
||||
IJavaProject project = optionalProject.get();
|
||||
TypeDeclaration topLevelClass = findParentClass(node);
|
||||
TypeDeclaration topLevelClass = ASTUtils.findDeclaringType(node);
|
||||
if (topLevelClass == null) {
|
||||
return;
|
||||
}
|
||||
@@ -136,17 +137,6 @@ public class BeanCompletionProvider implements CompletionProvider {
|
||||
}
|
||||
}
|
||||
|
||||
private static TypeDeclaration findParentClass(ASTNode node) {
|
||||
ASTNode current = node;
|
||||
while (current != null) {
|
||||
if (current instanceof TypeDeclaration) {
|
||||
return (TypeDeclaration) current;
|
||||
}
|
||||
current = current.getParent();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static String getFullyQualifiedName(TypeDeclaration typeDecl) {
|
||||
ITypeBinding binding = typeDecl.resolveBinding();
|
||||
if (binding != null) {
|
||||
|
||||
Reference in New Issue
Block a user