@Override public void checkReplacementPattern(Project project, ReplaceOptions options) { final CompiledPattern compiledPattern = PatternCompiler.compilePattern(project, options.getMatchOptions()); if (compiledPattern == null) { return; } final NodeIterator it = compiledPattern.getNodes(); if (!it.hasNext()) { return; } final PsiElement root = it.current().getParent(); if (!checkOptionalChildren(root) || !checkErrorElements(root)) { throw new UnsupportedPatternException(": Partial and expression patterns are not supported"); } }