use of com.jetbrains.rest.run.RestRunConfiguration in project intellij-community by JetBrains.
the class DocutilsConfigurationProducer method findExistingByElement.
@Nullable
@Override
protected RunnerAndConfigurationSettings findExistingByElement(Location location, @NotNull List<RunnerAndConfigurationSettings> existingConfigurations, ConfigurationContext context) {
PsiFile script = location.getPsiElement().getContainingFile();
if (script == null) {
return null;
}
final VirtualFile vFile = script.getVirtualFile();
if (vFile == null) {
return null;
}
String path = vFile.getPath();
for (RunnerAndConfigurationSettings configuration : existingConfigurations) {
final String scriptName = ((RestRunConfiguration) configuration.getConfiguration()).getInputFile();
if (FileUtil.toSystemIndependentName(scriptName).equals(FileUtil.toSystemIndependentName(path))) {
return configuration;
}
}
return null;
}
use of com.jetbrains.rest.run.RestRunConfiguration in project intellij-community by JetBrains.
the class SphinxConfigurationProducer method findExistingByElement.
@Nullable
@Override
protected RunnerAndConfigurationSettings findExistingByElement(Location location, @NotNull List<RunnerAndConfigurationSettings> existingConfigurations, ConfigurationContext context) {
PsiElement element = location.getPsiElement();
if (!(element instanceof PsiDirectory))
return null;
final VirtualFile vFile = ((PsiDirectory) element).getVirtualFile();
String path = vFile.getPath();
for (RunnerAndConfigurationSettings configuration : existingConfigurations) {
final String scriptName = ((RestRunConfiguration) configuration.getConfiguration()).getInputFile();
if (FileUtil.toSystemIndependentName(scriptName).equals(FileUtil.toSystemIndependentName(path))) {
return configuration;
}
}
return null;
}
Aggregations