diff --git a/platform/analysis-api/src/com/intellij/codeStyle/CodeStyleFacade.java b/platform/analysis-api/src/com/intellij/codeStyle/CodeStyleFacade.java index 13a56161d5d6..2b402cef00a3 100644 --- a/platform/analysis-api/src/com/intellij/codeStyle/CodeStyleFacade.java +++ b/platform/analysis-api/src/com/intellij/codeStyle/CodeStyleFacade.java @@ -102,9 +102,30 @@ public abstract class CodeStyleFacade { @Deprecated public abstract String getLineSeparator(); - public abstract boolean useSpaceBeforeComma(PsiFile psiFile, Language language); + /** + * Determines whether a comma before space is needed for given {@code PsiFile} in given {@code Language} context. + * + * @param psiFile File to determine settings + * @param language Context language + * @return whether the space before comma is needed + */ + public abstract boolean useSpaceBeforeComma(@NotNull PsiFile psiFile, @NotNull Language language); - public abstract boolean useSpaceAfterComma(PsiFile psiFile, Language language); + /** + * Determines whether a comma after space is needed for given {@code PsiFile} in given {@code Language} context. + * + * @param psiFile File to determine settings + * @param language Context language + * @return whether the space after comma is needed + */ + public abstract boolean useSpaceAfterComma(@NotNull PsiFile psiFile, @NotNull Language language); - public abstract boolean useSpaceAroundAssignmentOperators(PsiFile psiFile, Language language); + /** + * Determines whether assignment operator should be surrounded with spaces for given {@code PsiFile} in given {@code Language} context. + * + * @param psiFile File to determine settings + * @param language Context language + * @return whether to surround assignment operator with spaces + */ + public abstract boolean useSpaceAroundAssignmentOperators(@NotNull PsiFile psiFile, @NotNull Language language); } diff --git a/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeStyleFacadeImpl.java b/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeStyleFacadeImpl.java index 6186ad02e095..355066a09fc6 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeStyleFacadeImpl.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeStyleFacadeImpl.java @@ -107,17 +107,17 @@ public class CodeStyleFacadeImpl extends CodeStyleFacade { } @Override - public boolean useSpaceBeforeComma(PsiFile psiFile, Language language) { + public boolean useSpaceBeforeComma(@NotNull PsiFile psiFile, @NotNull Language language) { return CodeStyle.getLanguageSettings(psiFile, language).SPACE_BEFORE_COMMA; } @Override - public boolean useSpaceAfterComma(PsiFile psiFile, Language language) { + public boolean useSpaceAfterComma(@NotNull PsiFile psiFile, @NotNull Language language) { return CodeStyle.getLanguageSettings(psiFile, language).SPACE_AFTER_COMMA; } @Override - public boolean useSpaceAroundAssignmentOperators(PsiFile psiFile, Language language) { + public boolean useSpaceAroundAssignmentOperators(@NotNull PsiFile psiFile, @NotNull Language language) { return CodeStyle.getLanguageSettings(psiFile, language).SPACE_AROUND_ASSIGNMENT_OPERATORS; } }