diff --git a/platform/core-api/src/com/intellij/psi/codeStyle/CodeStyleManager.java b/platform/core-api/src/com/intellij/psi/codeStyle/CodeStyleManager.java index d95a36261fd5..1ec14c92b581 100644 --- a/platform/core-api/src/com/intellij/psi/codeStyle/CodeStyleManager.java +++ b/platform/core-api/src/com/intellij/psi/codeStyle/CodeStyleManager.java @@ -267,7 +267,14 @@ public abstract class CodeStyleManager { public abstract void performActionWithFormatterDisabled(ThrowableRunnable r) throws T; public abstract T performActionWithFormatterDisabled(Computable r); - + + /** + * Retrieves the current formatting mode. + * + * @param project The current project used to obtain {@code CodeStyleManager} instance. + * @return The current formatting mode. + * @see FormattingMode + */ public static FormattingMode getCurrentFormattingMode(@NotNull Project project) { if (!project.isDisposed()) { CodeStyleManager instance = getInstance(project); diff --git a/platform/core-api/src/com/intellij/psi/codeStyle/FormattingModeAwareIndentAdjuster.java b/platform/core-api/src/com/intellij/psi/codeStyle/FormattingModeAwareIndentAdjuster.java index 2e2ad1bccab5..a27a5807270b 100644 --- a/platform/core-api/src/com/intellij/psi/codeStyle/FormattingModeAwareIndentAdjuster.java +++ b/platform/core-api/src/com/intellij/psi/codeStyle/FormattingModeAwareIndentAdjuster.java @@ -19,8 +19,22 @@ import com.intellij.formatting.FormattingMode; import com.intellij.openapi.editor.Document; import org.jetbrains.annotations.NotNull; +/** + * Used to differentiate between line indent adjustment on a new line after Enter and explicit indent adjustment action. + * + * @see FormattingMode + * @see CodeStyleManager + */ public interface FormattingModeAwareIndentAdjuster { + /** + * Adjust line indent at document offset using {@code mode}. + * + * @param document The document to adjust line indent in. + * @param offset The offset in the document. + * @param mode The mode: {@link FormattingMode#ADJUST_INDENT} or {@link FormattingMode#ADJUST_INDENT_ON_ENTER} + * @return Adjusted offset. + */ int adjustLineIndent(@NotNull final Document document, final int offset, FormattingMode mode); FormattingMode getCurrentFormattingMode();