mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't show run "Class not found" run configuration validation errors in dumb mode (IDEA-194201)
This commit is contained in:
+6
-1
@@ -81,7 +81,12 @@ public class JavaRunConfigurationModule extends RunConfigurationModule {
|
||||
final PsiClass psiClass = findClass(className);
|
||||
if (psiClass == null) {
|
||||
throw new RuntimeConfigurationWarning(
|
||||
ExecutionBundle.message("class.not.found.in.module.error.message", className, getModuleName()));
|
||||
ExecutionBundle.message("class.not.found.in.module.error.message", className, getModuleName())) {
|
||||
@Override
|
||||
public boolean shouldShowInDumbMode() {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
return psiClass;
|
||||
}
|
||||
|
||||
+3
@@ -26,6 +26,7 @@ import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.options.ConfigurationException;
|
||||
import com.intellij.openapi.options.SettingsEditor;
|
||||
import com.intellij.openapi.options.SettingsEditorListener;
|
||||
import com.intellij.openapi.project.DumbService;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.ui.DocumentAdapter;
|
||||
import com.intellij.ui.components.JBCheckBox;
|
||||
@@ -202,6 +203,8 @@ public final class SingleConfigurationConfigurable<Config extends RunConfigurati
|
||||
}
|
||||
|
||||
private ValidationResult createValidationResult(RunnerAndConfigurationSettings snapshot, ConfigurationException e) {
|
||||
if (!e.shouldShowInDumbMode() && DumbService.isDumb(getConfiguration().getProject())) return null;
|
||||
|
||||
return new ValidationResult(
|
||||
e.getLocalizedMessage(),
|
||||
e instanceof RuntimeConfigurationException ? e.getTitle() : ExecutionBundle.message("invalid.data.dialog.title"),
|
||||
|
||||
@@ -68,4 +68,12 @@ public class ConfigurationException extends Exception {
|
||||
public void setOriginator(Configurable originator) {
|
||||
myOriginator = originator;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return whether this error should be shown when index isn't complete. Override and return false for errors that
|
||||
* might be caused by inability to find some PSI due to index absence.
|
||||
*/
|
||||
public boolean shouldShowInDumbMode() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user