Skip to content

Commit

Permalink
Revert "Handle match files in the order they arrived"
Browse files Browse the repository at this point in the history
This reverts commit a249501.
  • Loading branch information
Rob Stryker committed Dec 10, 2024
1 parent 0615a26 commit e6fe575
Showing 1 changed file with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1452,7 +1452,6 @@ public void acceptAST(org.eclipse.jdt.core.ICompilationUnit source, org.eclipse.
// todo, use a subprogressmonitor or slice it
}, this.progressMonitor);

Collections.sort(nonNullDomIndexes);
for( int x : nonNullDomIndexes ) {
PossibleMatch possibleMatch = possibleMatches[x];
this.currentPossibleMatch = possibleMatch;
Expand Down Expand Up @@ -1513,19 +1512,12 @@ private SearchMatch toMatch(org.eclipse.jdt.core.dom.ASTNode node, int accuracy,
return new FieldDeclarationMatch(DOMASTNodeUtils.getDeclaringJavaElement(node), accuracy,
start, len, getParticipant(), resource);
}
if (node instanceof Type nt) {
IBinding b = DOMASTNodeUtils.getBinding(nt);
if (node instanceof Type) {
IJavaElement element = DOMASTNodeUtils.getEnclosingJavaElement(node);
if (element instanceof LocalVariable) {
element = element.getParent();
}
TypeReferenceMatch ret = new TypeReferenceMatch(element, accuracy, node.getStartPosition(), node.getLength(), DOMASTNodeUtils.insideDocComment(node), getParticipant(), resource);
if( nt.isParameterizedType() ) {
if(((ParameterizedType)nt).typeArguments().size() == 0 ) {
ret.setRaw(true);
}
}
return ret;
return new TypeReferenceMatch(element, accuracy, node.getStartPosition(), node.getLength(), DOMASTNodeUtils.insideDocComment(node), getParticipant(), resource);
}
if (node instanceof org.eclipse.jdt.core.dom.TypeParameter nodeTP) {
IJavaElement element = DOMASTNodeUtils.getEnclosingJavaElement(node);
Expand All @@ -1538,11 +1530,8 @@ private SearchMatch toMatch(org.eclipse.jdt.core.dom.ASTNode node, int accuracy,
// // This fixes some issues but causes even more failures
// return new SearchMatch(enclosing, accuracy, node.getStartPosition(), node.getLength(), getParticipant(), resource);
// }
if (b instanceof ITypeBinding btb) {
TypeReferenceMatch ref = new TypeReferenceMatch(enclosing, accuracy, node.getStartPosition(), node.getLength(), insideDocComment(node), getParticipant(), resource);
if(btb.isRawType())
ref.setRaw(true);
return ref;
if (b instanceof ITypeBinding) {
return new TypeReferenceMatch(enclosing, accuracy, node.getStartPosition(), node.getLength(), insideDocComment(node), getParticipant(), resource);
}
if (b instanceof IVariableBinding variable) {
if (variable.isField()) {
Expand Down

0 comments on commit e6fe575

Please sign in to comment.