Search in sources :

Example 1 with OptionalStepDefinitionExtensionPoint

use of org.jetbrains.plugins.cucumber.OptionalStepDefinitionExtensionPoint in project intellij-plugins by JetBrains.

the class CucumberStepsIndex method getStepDefinitionContainers.

public Set<Pair<PsiFile, BDDFrameworkType>> getStepDefinitionContainers(@NotNull final GherkinFile featureFile) {
    Set<Pair<PsiFile, BDDFrameworkType>> result = new HashSet<>();
    for (CucumberJvmExtensionPoint ep : myExtensionMap.values()) {
        // Skip if framework file creation support is optional
        if ((ep instanceof OptionalStepDefinitionExtensionPoint) && !((OptionalStepDefinitionExtensionPoint) ep).participateInStepDefinitionCreation(featureFile)) {
            continue;
        }
        final Collection<? extends PsiFile> psiFiles = ep.getStepDefinitionContainers(featureFile);
        final BDDFrameworkType frameworkType = ep.getStepFileType();
        for (final PsiFile psiFile : psiFiles) {
            result.add(Pair.create(psiFile, frameworkType));
        }
    }
    return result;
}
Also used : CucumberJvmExtensionPoint(org.jetbrains.plugins.cucumber.CucumberJvmExtensionPoint) BDDFrameworkType(org.jetbrains.plugins.cucumber.BDDFrameworkType) PsiFile(com.intellij.psi.PsiFile) OptionalStepDefinitionExtensionPoint(org.jetbrains.plugins.cucumber.OptionalStepDefinitionExtensionPoint) Pair(com.intellij.openapi.util.Pair)

Aggregations

Pair (com.intellij.openapi.util.Pair)1 PsiFile (com.intellij.psi.PsiFile)1 BDDFrameworkType (org.jetbrains.plugins.cucumber.BDDFrameworkType)1 CucumberJvmExtensionPoint (org.jetbrains.plugins.cucumber.CucumberJvmExtensionPoint)1 OptionalStepDefinitionExtensionPoint (org.jetbrains.plugins.cucumber.OptionalStepDefinitionExtensionPoint)1