if (scope != null && !scope.encloses(targetElement)) {
continue;
}
SourceRange range = new SourceRange(location.getOffset(), location.getLength());
// TODO(scheglov) IndexConstants.DYNAMIC for MatchQuality.NAME
MatchQuality quality = MatchQuality.EXACT;
// MatchQuality quality = element.getResource() != IndexConstants.DYNAMIC
// ? MatchQuality.EXACT : MatchQuality.NAME;
SearchMatch match = new SearchMatch(quality, matchKind, targetElement, range);
match.setQualified(relationship == IndexConstants.IS_REFERENCED_BY_QUALIFIED
|| relationship == IndexConstants.IS_INVOKED_BY_QUALIFIED);