IndentOptions (@NotNull Project project, @NotNull VirtualFile file, @Nullable TextRange formatRange, boolean ignoreDocOptions, @Nullable Processor<? super FileIndentOptionsProvider> providerProcessor) { Document document = FileDocumentManager.getInstance().getCachedDocument(file); boolean isFullReformat = document == null || isFileFullyCoveredByRange(document, formatRange); if (!ignoreDocOptions && !isFullReformat) { IndentOptions options = IndentOptions.retrieveFromAssociatedDocument(document); if (options != null) { FileIndentOptionsProvider provider = options.getFileIndentOptionsProvider(); if (providerProcessor != null && provider != null) { providerProcessor.process(provider); } return options; } } for (FileIndentOptionsProvider provider : FileIndentOptionsProvider.EP_NAME.getExtensionList()) { if (provider.isAllowed(isFullReformat)) { IndentOptions indentOptions = provider.getIndentOptions(project,this, file); if (indentOptions != null) { if (providerProcessor != null) { providerProcessor.process(provider); } indentOptions.setFileIndentOptionsProvider(provider); logIndentOptions(file, provider, indentOptions); return indentOptions; } } } Language language = LanguageUtil.getLanguageForPsi(project, file, file.getFileType()); if (language != null) { IndentOptions options = getIndentOptions(language); if (options != null) { return options; } } return getIndentOptions(file.getFileType()); }