NlsInfo (@NotNull Project project, @NotNull UExpression expression, @Nullable String value, @NotNull Set<? super PsiModifierListOwner> nonNlsTargets, boolean onTheFly, boolean ignoreForAllButNls) { if (ignoreForNonAlpha && value != null && !StringUtil.containsAlphaCharacters(value)) { return NlsInfo.nonLocalized(); } if (isSuppressedByComment(project, expression)) { return NlsInfo.nonLocalized(); } if (value != null && myCachedLiteralPattern != null && myCachedLiteralPattern.matcher(value).matches()) { return NlsInfo.nonLocalized(); } List<UExpression> usages = findIndirectUsages(expression, true); if (usages.isEmpty()) { usages = Collections.singletonList(expression); } for (UExpression usage : usages) { NlsInfo info = NlsInfo.forExpression(usage); switch (info.getNlsStatus()) { case YES -> { return info; } case UNSURE -> { if (ignoreForAllButNls) { break; } if (shouldIgnoreUsage(project, value, nonNlsTargets, usage)) { break; } if (!onTheFly) { //keep only potential annotation candidate nonNlsTargets.clear(); } ContainerUtil.addIfNotNull(nonNlsTargets, ((NlsInfo.NlsUnspecified)info).getAnnotationCandidate()); return NlsInfo.localized(); } case NO -> {} } } return NlsInfo.nonLocalized(); }