FormattingModel (@NotNull FormattingContext formattingContext) { final PsiFile file = formattingContext.getContainingFile(); CodeStyleSettings settings = formattingContext.getCodeStyleSettings(); Block rootBlock = getRootBlock(file, file.getViewProvider(), settings); return new DocumentBasedFormattingModel(rootBlock, formattingContext.getProject(), settings, file.getFileType(), file); }