use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.
the class OverrideImplementsAnnotationsHandlerImpl method getAnnotations.
@Override
public String[] getAnnotations(Project project) {
final NullableNotNullManager manager = NullableNotNullManager.getInstance(project);
final Collection<String> anns = new ArrayList<>(manager.getNotNulls());
anns.addAll(manager.getNullables());
anns.add(AnnotationUtil.NLS);
final CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(project);
anns.addAll(settings.getRepeatAnnotations());
return ArrayUtil.toStringArray(anns);
}
use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.
the class BindToGenericClassTest method tearDown.
@Override
protected void tearDown() throws Exception {
final CodeStyleSettings currentSettings = CodeStyleSettingsManager.getInstance(myProject).getCurrentSettings();
currentSettings.USE_FQ_CLASS_NAMES = myOldFQNamesSetting;
super.tearDown();
}
use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.
the class BindToGenericClassTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
setupGenericSampleClasses();
final CodeStyleSettings currentSettings = CodeStyleSettingsManager.getInstance(myProject).getCurrentSettings();
myOldFQNamesSetting = currentSettings.USE_FQ_CLASS_NAMES;
currentSettings.USE_FQ_CLASS_NAMES = true;
}
use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.
the class JavaFormatterPerformanceTest method testPerformance2.
public void testPerformance2() throws Exception {
final CodeStyleSettings settings = getSettings();
settings.setDefaultRightMargin(120);
PlatformTestUtil.startPerformanceTest(getTestName(false), 4000, () -> {
try {
doTest();
} catch (Exception e) {
throw new RuntimeException(e);
}
}).cpuBound().useLegacyScaling().assertTiming();
}
use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.
the class JavaFormatterPerformanceTest method testPerformance.
public void testPerformance() throws Exception {
final String name = getTestName(true) + ".java";
final String text = loadFile(name);
final PsiFile file = LightPlatformTestCase.createFile(name, text);
transformAllChildren(SourceTreeToPsiMap.psiElementToTree(file));
final CodeStyleSettings settings = new CodeStyleSettings();
PlatformTestUtil.startPerformanceTest("java formatting", 1000, () -> {
final FormattingModel model = LanguageFormatting.INSTANCE.forContext(file).createModel(file, settings);
((FormatterImpl) FormatterEx.getInstanceEx()).formatWithoutModifications(model.getDocumentModel(), model.getRootBlock(), settings, settings.getIndentOptions(StdFileTypes.JAVA), file.getTextRange());
}).cpuBound().useLegacyScaling().assertTiming();
}
Aggregations