use of org.eclipse.xtext.preferences.MapBasedPreferenceValues in project xtext-xtend by eclipse.
the class AnonymousClassFormatterTest method formatSingleMember.
@Test
public void formatSingleMember() {
final Procedure1<MapBasedPreferenceValues> _function = (MapBasedPreferenceValues it) -> {
it.<Boolean>put(XbaseFormatterPreferenceKeys.bracesInNewLine, Boolean.valueOf(false));
};
StringConcatenation _builder = new StringConcatenation();
_builder.append("class Foo {");
_builder.newLine();
_builder.append("\t");
_builder.append("val foo = new Runnable() {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("override run() {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("}");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
this.assertFormatted(_function, _builder);
}
use of org.eclipse.xtext.preferences.MapBasedPreferenceValues in project xtext-xtend by eclipse.
the class AnonymousClassFormatterTest method formatTypeParam.
@Test
public void formatTypeParam() {
final Procedure1<MapBasedPreferenceValues> _function = (MapBasedPreferenceValues it) -> {
it.<Boolean>put(XbaseFormatterPreferenceKeys.bracesInNewLine, Boolean.valueOf(false));
};
StringConcatenation _builder = new StringConcatenation();
_builder.append("class Foo {");
_builder.newLine();
_builder.append("\t");
_builder.append("val foo = new Iterable<String>() {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("override iterator() {");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("null");
_builder.newLine();
_builder.append("\t\t");
_builder.append("}");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
this.assertFormatted(_function, _builder);
}
use of org.eclipse.xtext.preferences.MapBasedPreferenceValues in project xtext-xtend by eclipse.
the class AnonymousClassFormatterTest method formatMultiMember.
@Test
public void formatMultiMember() {
final Procedure1<MapBasedPreferenceValues> _function = (MapBasedPreferenceValues it) -> {
it.<Boolean>put(XbaseFormatterPreferenceKeys.bracesInNewLine, Boolean.valueOf(false));
};
StringConcatenation _builder = new StringConcatenation();
_builder.append("class Foo {");
_builder.newLine();
_builder.append("\t");
_builder.append("val foo = new Runnable() {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("int bar");
_builder.newLine();
_builder.newLine();
_builder.append("\t\t");
_builder.append("override run() {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("}");
_builder.newLine();
_builder.newLine();
_builder.append("\t\t");
_builder.append("def foo(String x) {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("}");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
this.assertFormatted(_function, _builder);
}
use of org.eclipse.xtext.preferences.MapBasedPreferenceValues in project xtext-xtend by eclipse.
the class XtendAnnotationTypeFormatterTest method formatBraces_01.
@Test
public void formatBraces_01() {
final Procedure1<MapBasedPreferenceValues> _function = (MapBasedPreferenceValues it) -> {
it.<Boolean>put(XbaseFormatterPreferenceKeys.bracesInNewLine, Boolean.valueOf(false));
};
StringConcatenation _builder = new StringConcatenation();
_builder.append("package foo");
_builder.newLine();
_builder.newLine();
_builder.append("annotation Bar {");
_builder.newLine();
_builder.append("}");
_builder.newLine();
this.assertFormatted(_function, _builder);
}
use of org.eclipse.xtext.preferences.MapBasedPreferenceValues in project xtext-xtend by eclipse.
the class XtendAnnotationTypeFormatterTest method formatFieldInit02.
@Ignore
@Test
public void formatFieldInit02() {
final Procedure1<MapBasedPreferenceValues> _function = (MapBasedPreferenceValues it) -> {
};
StringConcatenation _builder = new StringConcatenation();
_builder.append("annotation Bar {");
_builder.newLine();
_builder.append("\t");
_builder.append("int foo = 1 + 1");
_builder.newLine();
_builder.append("\t");
_builder.append("int baz = 1 + 1");
_builder.newLine();
_builder.append("}");
_builder.newLine();
this.assertFormatted(_function, _builder);
}
Aggregations