use of org.jetbrains.plugins.cucumber.psi.GherkinScenarioOutline in project intellij-plugins by JetBrains.
the class GherkinInplaceRenamer method finish.
@Override
public void finish(boolean success) {
super.finish(success);
if (success) {
final PsiNamedElement newVariable = getVariable();
if (newVariable != null) {
final GherkinScenarioOutline scenario = PsiTreeUtil.getParentOfType(newVariable, GherkinScenarioOutline.class);
if (scenario != null) {
final CodeStyleManager csManager = CodeStyleManager.getInstance(newVariable.getProject());
csManager.reformat(scenario);
}
}
}
}
use of org.jetbrains.plugins.cucumber.psi.GherkinScenarioOutline in project intellij-plugins by JetBrains.
the class CucumberMissedExamplesInspection method buildVisitor.
@NotNull
@Override
public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, final boolean isOnTheFly) {
return new GherkinElementVisitor() {
@Override
public void visitScenarioOutline(GherkinScenarioOutline outline) {
super.visitScenarioOutline(outline);
final GherkinExamplesBlockImpl block = PsiTreeUtil.getChildOfType(outline, GherkinExamplesBlockImpl.class);
if (block == null) {
ASTNode[] keyword = outline.getNode().getChildren(GherkinTokenTypes.KEYWORDS);
if (keyword.length > 0) {
holder.registerProblem(outline, keyword[0].getTextRange().shiftRight(-outline.getTextOffset()), CucumberBundle.message("inspection.missed.example.msg.name"), new CucumberCreateExamplesSectionFix());
}
}
}
};
}
Aggregations