private BlockWithParent getRealBlockParent() { BlockWithParent parent = getParent(); while (parent instanceof DataLanguageBlockWrapper && ((DataLanguageBlockWrapper) parent).getOriginal() instanceof SyntheticBlock) { parent = parent.getParent(); } return parent; }
private BlockWithParent getRealBlockParent() { // if we can follow the chain of synthetic parent blocks, and if we end up // at a real DataLanguage block (i.e. the synthetic blocks didn't lead to an DustFormatterBlock), // we're a child of a templated language node and need an indent BlockWithParent parent = getParent(); while (parent instanceof DataLanguageBlockWrapper && ((DataLanguageBlockWrapper) parent).getOriginal() instanceof SyntheticBlock) { parent = parent.getParent(); } return parent; }
private static boolean isSynthetic(BlockWithParent block) { return block instanceof DataLanguageBlockWrapper && ((DataLanguageBlockWrapper) block) .getOriginal() instanceof SyntheticBlock; }