ReformatCodeRunOptions (@NotNull PsiFile file) { Language language = file.getLanguage(); ReformatCodeRunOptions settings = new ReformatCodeRunOptions(getLastTextRangeType()); settings.setOptimizeImports(getLastOptimizeImports()); settings.setRearrangeCode(isRearrangeCode(language)); return settings; }