mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-01 06:51:17 +07:00
[Formatter] Provided ability to skip building injected blocks by setting AbstractBlock "myBuildInjectedBlocks" flag.
[JavaFormatter] If this flag is set no "InjectedLanguageUtil.hasInjections" check will be performed, which dramatically improves performance of formatter-based indent detector.
This commit is contained in:
@@ -176,7 +176,8 @@ public abstract class AbstractJavaBlock extends AbstractBlock implements JavaBlo
|
||||
if (isStatement(child, child.getTreeParent())) {
|
||||
return new CodeBlockBlock(child, wrap, alignment, actualIndent, settings, javaSettings);
|
||||
}
|
||||
if (child instanceof PsiComment &&
|
||||
if (isBuildInjectedBlocks() &&
|
||||
child instanceof PsiComment &&
|
||||
child instanceof PsiLanguageInjectionHost &&
|
||||
InjectedLanguageUtil.hasInjections((PsiLanguageInjectionHost)child)) {
|
||||
return new CommentWithInjectionBlock(child, wrap, alignment, indent, settings, javaSettings);
|
||||
|
||||
Reference in New Issue
Block a user