use of com.intellij.execution.configurations.RuntimeConfigurationError in project intellij by bazelbuild.
the class BlazeIntellijPluginConfiguration method checkConfiguration.
@Override
public void checkConfiguration() throws RuntimeConfigurationException {
super.checkConfiguration();
Label label = getTarget();
if (label == null) {
throw new RuntimeConfigurationError("Select a target to run");
}
TargetInfo target = TargetFinder.findTargetInfo(getProject(), label);
if (target == null) {
throw new RuntimeConfigurationError("The selected target does not exist.");
}
if (!IntellijPluginRule.isPluginTarget(target)) {
throw new RuntimeConfigurationError("The selected target is not an intellij_plugin");
}
if (!IdeaJdkHelper.isIdeaJdk(pluginSdk)) {
throw new RuntimeConfigurationError("Select an IntelliJ Platform Plugin SDK");
}
}
use of com.intellij.execution.configurations.RuntimeConfigurationError in project intellij by bazelbuild.
the class BlazeCommandRunConfiguration method checkConfiguration.
@Override
public void checkConfiguration() throws RuntimeConfigurationException {
// Our handler check is not valid when we don't have BlazeProjectData.
if (BlazeProjectDataManager.getInstance(getProject()).getBlazeProjectData() == null) {
throw new RuntimeConfigurationError("Configuration cannot be run until project has been synced.");
}
if (Strings.isNullOrEmpty(targetPattern)) {
throw new RuntimeConfigurationError(String.format("You must specify a %s target expression.", Blaze.buildSystemName(getProject())));
}
if (!targetPattern.startsWith("//")) {
throw new RuntimeConfigurationError("You must specify the full target expression, starting with //");
}
String error = TargetExpression.validate(targetPattern);
if (error != null) {
throw new RuntimeConfigurationError(error);
}
for (BeforeRunTask task : RunManagerCompatUtils.getBeforeRunTasks(this)) {
if (task.getProviderId().equals(BlazeBeforeRunTaskProvider.ID) && !task.isEnabled()) {
throw new RuntimeConfigurationError(String.format("Invalid run configuration: the %s before run task is missing. Please re-run sync " + "to add it back", Blaze.buildSystemName(getProject())));
}
}
handler.checkConfiguration();
}
use of com.intellij.execution.configurations.RuntimeConfigurationError in project go-lang-idea-plugin by go-lang-plugin-org.
the class GoRunConfigurationWithMain method checkFileConfiguration.
protected void checkFileConfiguration() throws RuntimeConfigurationError {
VirtualFile file = findFile(getFilePath());
if (file == null) {
throw new RuntimeConfigurationError("Main file is not specified");
}
PsiFile psiFile = PsiManager.getInstance(getProject()).findFile(file);
if (!(psiFile instanceof GoFile)) {
throw new RuntimeConfigurationError("Main file is invalid");
}
if (!GoRunUtil.isMainGoFile(psiFile)) {
throw new RuntimeConfigurationError("Main file has non-main package or doesn't contain main function");
}
}
Aggregations