use of org.eclipse.xtext.preferences.MapBasedPreferenceValues in project xtext-xtend by eclipse.
the class XtendAnnotationsFormatterTest method formatMethodParameterTwoAnnotations1.
@Test
public void formatMethodParameterTwoAnnotations1() {
final Procedure1<MapBasedPreferenceValues> _function = (MapBasedPreferenceValues it) -> {
it.<Boolean>put(XbaseFormatterPreferenceKeys.newLineAfterParameterAnnotations, Boolean.valueOf(false));
it.<Boolean>put(XbaseFormatterPreferenceKeys.preserveNewLines, Boolean.valueOf(true));
};
StringConcatenation _builder = new StringConcatenation();
_builder.append("def foo(@Override @Deprecated String p) {");
_builder.newLine();
_builder.append("}");
_builder.newLine();
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("def foo( @Override @Deprecated String p ) { }");
_builder_1.newLine();
this.assertFormattedMember(_function, _builder.toString(), _builder_1);
}
use of org.eclipse.xtext.preferences.MapBasedPreferenceValues in project xtext-xtend by eclipse.
the class XtendAnnotationsFormatterTest method formatMethodTwoAnnotations3.
@Test
public void formatMethodTwoAnnotations3() {
final Procedure1<MapBasedPreferenceValues> _function = (MapBasedPreferenceValues it) -> {
it.<Boolean>put(XbaseFormatterPreferenceKeys.newLineAfterMethodAnnotations, Boolean.valueOf(false));
it.<Boolean>put(XbaseFormatterPreferenceKeys.preserveNewLines, Boolean.valueOf(true));
};
StringConcatenation _builder = new StringConcatenation();
_builder.append("@Override");
_builder.newLine();
_builder.append("@Deprecated");
_builder.newLine();
_builder.append("def foo() {");
_builder.newLine();
_builder.append("}");
_builder.newLine();
this.assertFormattedMember(_function, _builder.toString());
}
use of org.eclipse.xtext.preferences.MapBasedPreferenceValues in project xtext-xtend by eclipse.
the class XtendAnnotationsFormatterTest method formatFieldTwoAnnotations2.
@Test
public void formatFieldTwoAnnotations2() {
final Procedure1<MapBasedPreferenceValues> _function = (MapBasedPreferenceValues it) -> {
it.<Boolean>put(XbaseFormatterPreferenceKeys.newLineAfterFieldAnnotations, Boolean.valueOf(false));
it.<Boolean>put(XbaseFormatterPreferenceKeys.preserveNewLines, Boolean.valueOf(false));
};
StringConcatenation _builder = new StringConcatenation();
_builder.append("@Override @Deprecated int value");
_builder.newLine();
this.assertFormattedMember(_function, _builder.toString());
}
use of org.eclipse.xtext.preferences.MapBasedPreferenceValues in project xtext-xtend by eclipse.
the class XtendAnnotationsFormatterTest method formatConstructorTwoAnnotationsSL1.
@Test
public void formatConstructorTwoAnnotationsSL1() {
final Procedure1<MapBasedPreferenceValues> _function = (MapBasedPreferenceValues it) -> {
it.<Boolean>put(XbaseFormatterPreferenceKeys.newLineAfterConstructorAnnotations, Boolean.valueOf(false));
it.<Boolean>put(XbaseFormatterPreferenceKeys.preserveNewLines, Boolean.valueOf(false));
};
StringConcatenation _builder = new StringConcatenation();
_builder.append("@Override @Deprecated new() {");
_builder.newLine();
_builder.append("}");
_builder.newLine();
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("@Override ");
_builder_1.newLine();
_builder_1.append("@Deprecated ");
_builder_1.newLine();
_builder_1.append("new() {");
_builder_1.newLine();
_builder_1.append("}");
_builder_1.newLine();
this.assertFormattedMember(_function, _builder.toString(), _builder_1);
}
use of org.eclipse.xtext.preferences.MapBasedPreferenceValues in project xtext-xtend by eclipse.
the class XtendAnnotationsFormatterTest method formatClassSingleAnnotationML1.
@Test
public void formatClassSingleAnnotationML1() {
final Procedure1<MapBasedPreferenceValues> _function = (MapBasedPreferenceValues it) -> {
it.<Boolean>put(XbaseFormatterPreferenceKeys.newLineAfterClassAnnotations, Boolean.valueOf(false));
it.<Boolean>put(XbaseFormatterPreferenceKeys.preserveNewLines, Boolean.valueOf(true));
};
StringConcatenation _builder = new StringConcatenation();
_builder.append("package foo");
_builder.newLine();
_builder.newLine();
_builder.append("@Deprecated");
_builder.newLine();
_builder.append("class bar {");
_builder.newLine();
_builder.append("}");
_builder.newLine();
this.assertFormatted(_function, _builder);
}
Aggregations