[find in files] IJPL-186012 keep the validation order and show "validation in progress" as the last state

GitOrigin-RevId: c0dd8cdeda691da885bc22e084b2f7dec94667e8
This commit is contained in:
Vera Petrenkova
2025-06-05 08:57:31 +00:00
committed by intellij-monorepo-bot
parent 928483d2f4
commit f5956ec1e2
2 changed files with 6 additions and 6 deletions
@@ -159,9 +159,6 @@ public final class FindPopupDirectoryChooser extends JPanel {
}
public @Nullable ValidationInfo validate(@NotNull FindModel model) {
if (FindKey.isEnabled() && !myFindPopupPanel.isBackendValidationFinished()) {
return new ValidationInfo(FindBundle.message("find.directory.validation.in.progress")).asWarning();
}
if (FindKey.isEnabled()) return null;
VirtualFile directory = FindInProjectUtil.getDirectory(model);
return getDirectoryValidationInfo(directory != null);
@@ -1498,6 +1498,10 @@ public final class FindPopupPanel extends JBPanel<FindPopupPanel> implements Fin
}
private @Nullable("null means OK") ValidationInfo getValidationInfo(@NotNull FindModel model) {
ValidationInfo scopeValidationInfo = myScopeUI.validate(model, mySelectedScope);
if (scopeValidationInfo != null) {
return scopeValidationInfo;
}
if (!myHelper.canSearchThisString()) {
return new ValidationInfo(FindBundle.message("find.empty.search.text.error"), mySearchComponent);
}
@@ -1555,9 +1559,8 @@ public final class FindPopupPanel extends JBPanel<FindPopupPanel> implements Fin
return new ValidationInfo(FindBundle.message("find.filter.invalid.file.mask.error", mask), header.fileMaskField);
}
}
ValidationInfo scopeValidationInfo = myScopeUI.validate(model, mySelectedScope);
if (scopeValidationInfo != null) {
return scopeValidationInfo;
if (FindKey.isEnabled() && !isBackendValidationFinished()) {
return new ValidationInfo(FindBundle.message("find.directory.validation.in.progress")).asWarning();
}
return null;
}