@@ -89,8 +89,8 @@ public LocatorResponse match(Name name, NodeSetWrapper nodeSet, MatchLocator loc
8989 return toResponse (IMPOSSIBLE_MATCH );
9090 }
9191 if (this .locator .pattern .simpleName == null ) {
92- int v = nodeSet . addMatch ( name , this .locator .pattern .mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH ) ;
93- return toResponse (v , true );
92+ int v = this .locator .pattern .mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH ;
93+ return toResponse (v , false );
9494 }
9595 if ( name instanceof SimpleName sn2 ) {
9696 if ( this .locator .pattern .qualification == null )
@@ -420,7 +420,7 @@ public LocatorResponse resolveLevel(org.eclipse.jdt.core.dom.ASTNode node, IBind
420420 return toResponse (INACCURATE_MATCH );
421421 }
422422 if (binding instanceof ITypeBinding typeBinding ) {
423- if ( node .getParent () instanceof ImportDeclaration id ) {
423+ if ( node .getParent () instanceof ImportDeclaration && ! this . locator . isDeclarationOfReferencedTypesPattern ) {
424424 return resolveLevelForImportBinding (node , typeBinding , locator );
425425 }
426426 int v = resolveLevelForTypeBinding (node , typeBinding , locator );
@@ -533,16 +533,16 @@ public String findImportForString(String s) {
533533
534534 int newLevel = this .resolveLevelForTypeFQN (this .locator .pattern .simpleName ,
535535 this .locator .pattern .qualification , typeBinding , importDiscovery );
536+ if ( this .locator .isDeclarationOfReferencedTypesPattern ) {
537+ return resolveLevelForTypeBindingDeclarationOfReferencedTypes (typeBinding , node , newLevel , locator );
538+ }
536539 if ( newLevel == IMPOSSIBLE_MATCH ) {
537540 String qualNameFromBinding = typeBinding .getQualifiedName ();
538541 int simpleNameMatch = resolveLevelForSimpleName (node , qualNameFromBinding );
539542 if ( simpleNameMatch != -1 ) {
540543 return simpleNameMatch ;
541544 }
542545 }
543- if ( this .locator .isDeclarationOfReferencedTypesPattern ) {
544- return resolveLevelForTypeBindingDeclarationOfReferencedTypes (typeBinding , node , newLevel , locator );
545- }
546546 if ( newLevel == ACCURATE_MATCH && this .locator .pattern .hasTypeArguments () ) {
547547 return resolveLevelForTypeBindingWithTypeArguments (typeBinding , node , newLevel , locator );
548548 }
0 commit comments