use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.
the class FormatterTestCase method defaultSettings.
protected void defaultSettings() {
CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject());
settings.ALIGN_MULTILINE_PARAMETERS = true;
settings.ALIGN_MULTILINE_PARAMETERS_IN_CALLS = false;
settings.ALIGN_MULTILINE_FOR = true;
settings.ALIGN_MULTILINE_BINARY_OPERATION = false;
settings.ALIGN_MULTILINE_TERNARY_OPERATION = false;
settings.ALIGN_MULTILINE_THROWS_LIST = false;
settings.ALIGN_MULTILINE_EXTENDS_LIST = false;
settings.ALIGN_MULTILINE_PARENTHESIZED_EXPRESSION = false;
settings.DO_NOT_INDENT_TOP_LEVEL_CLASS_MEMBERS = false;
getSettings().SPACE_BEFORE_ANOTATION_PARAMETER_LIST = false;
getSettings().SPACE_AROUND_ASSIGNMENT_OPERATORS = true;
getSettings().SPACE_WITHIN_ANNOTATION_PARENTHESES = false;
getSettings().SPACE_AROUND_ASSIGNMENT_OPERATORS = true;
}
use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.
the class PlatformTestCase method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
File tempDir = new File(FileUtilRt.getTempDirectory());
myFilesToDelete.add(tempDir);
if (ourTestCase != null) {
String message = "Previous test " + ourTestCase + " hasn't called tearDown(). Probably overridden without super call.";
ourTestCase = null;
fail(message);
}
IdeaLogger.ourErrorsOccurred = null;
LOG.debug(getClass().getName() + ".setUp()");
initApplication();
myEditorListenerTracker = new EditorListenerTracker();
myThreadTracker = new ThreadTracker();
setUpProject();
storeSettings();
ourTestCase = this;
if (myProject != null) {
ProjectManagerEx.getInstanceEx().openTestProject(myProject);
CodeStyleSettingsManager.getInstance(myProject).setTemporarySettings(new CodeStyleSettings());
InjectedLanguageManagerImpl.pushInjectors(getProject());
}
DocumentCommitThread.getInstance().clearQueue();
UIUtil.dispatchAllInvocationEvents();
}
use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.
the class OverrideImplement15Test method testLongFinalParameterList.
public void testLongFinalParameterList() {
CodeStyleSettings codeStyleSettings = CodeStyleSettingsManager.getSettings(getProject()).clone();
try {
CommonCodeStyleSettings javaSettings = codeStyleSettings.getCommonSettings(JavaLanguage.INSTANCE);
javaSettings.RIGHT_MARGIN = 80;
javaSettings.KEEP_LINE_BREAKS = true;
codeStyleSettings.GENERATE_FINAL_PARAMETERS = true;
javaSettings.METHOD_PARAMETERS_WRAP = CommonCodeStyleSettings.WRAP_ON_EVERY_ITEM;
CodeStyleSettingsManager.getInstance(getProject()).setTemporarySettings(codeStyleSettings);
doTest(false);
} finally {
CodeStyleSettingsManager.getInstance(getProject()).dropTemporarySettings();
}
}
use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.
the class JavaReformatOnTypingTest method useSpacesAroundAssignmentOperator.
private static void useSpacesAroundAssignmentOperator(boolean value, Project project, Language language) {
CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(project);
CommonCodeStyleSettings common = settings.getCommonSettings(language);
common.SPACE_AROUND_ASSIGNMENT_OPERATORS = value;
}
use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.
the class JoinLinesTest method testSubsequentJoiningAndUnexpectedTextRemoval.
public void testSubsequentJoiningAndUnexpectedTextRemoval() throws Exception {
// Inspired by IDEA-65342
CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject());
settings.setDefaultRightMargin(50);
settings.getCommonSettings(JavaLanguage.INSTANCE).CALL_PARAMETERS_WRAP = CommonCodeStyleSettings.WRAP_AS_NEEDED;
doTest(2);
}
Aggregations