use of org.eclipse.xtend.ide.refactoring.ExtractMethodRefactoring in project xtext-xtend by eclipse.
the class ExtractMethodIntegrationTest method testTemplateExpression_05.
@Test
public void testTemplateExpression_05() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("class Foo {");
_builder.newLine();
_builder.append("\t");
_builder.append("def foo(String value) \'");
_builder.append("\'\'");
_builder.newLine();
_builder.append("\t\t");
_builder.append("Hello ");
_builder.append("�", "\t\t");
_builder.append("$ /* prefix */ value /* postfix */ $");
_builder.append("�", "\t\t");
_builder.append("!");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("\'");
_builder.append("\'\'");
_builder.newLine();
_builder.append("}");
_builder.newLine();
final Procedure1<ExtractMethodRefactoring> _function = (ExtractMethodRefactoring it) -> {
};
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("class Foo {");
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.append("def foo(String value) \'");
_builder_1.append("\'\'");
_builder_1.newLine();
_builder_1.append("\t\t");
_builder_1.append("Hello ");
_builder_1.append("�", "\t\t");
_builder_1.append("bar(value)");
_builder_1.append("�", "\t\t");
_builder_1.append("!");
_builder_1.newLineIfNotEmpty();
_builder_1.append("\t");
_builder_1.append("\'");
_builder_1.append("\'\'");
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.append("def bar(String value) {");
_builder_1.newLine();
_builder_1.append("\t\t ");
_builder_1.append("/* prefix */ value /* postfix */ ");
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.append("}");
_builder_1.newLine();
_builder_1.append("}");
_builder_1.newLine();
this.assertAfterExtract(_builder, _function, _builder_1);
}
use of org.eclipse.xtend.ide.refactoring.ExtractMethodRefactoring in project xtext-xtend by eclipse.
the class ExtractMethodIntegrationTest method testTemplateExpression_19.
@Test
public void testTemplateExpression_19() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("class Foo {");
_builder.newLine();
_builder.append("\t");
_builder.append("def foo(boolean a) \'");
_builder.append("\'\'");
_builder.newLine();
_builder.append("\t\t");
_builder.append("$");
_builder.append("�", "\t\t");
_builder.append("IF a");
_builder.append("�", "\t\t");
_builder.newLineIfNotEmpty();
_builder.append("\t\t\t");
_builder.append("�", "\t\t\t");
_builder.append("1");
_builder.append("�", "\t\t\t");
_builder.newLineIfNotEmpty();
_builder.append("\t\t");
_builder.append("�", "\t\t");
_builder.append("ELSE");
_builder.append("�", "\t\t");
_builder.newLineIfNotEmpty();
_builder.append("\t\t\t");
_builder.append("�", "\t\t\t");
_builder.append("2");
_builder.append("�", "\t\t\t");
_builder.newLineIfNotEmpty();
_builder.append("\t\t");
_builder.append("�", "\t\t");
_builder.append("ENDIF");
_builder.append("�", "\t\t");
_builder.append("$");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("\'");
_builder.append("\'\'");
_builder.newLine();
_builder.append("}");
_builder.newLine();
final Procedure1<ExtractMethodRefactoring> _function = (ExtractMethodRefactoring it) -> {
};
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("class Foo {");
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.append("def foo(boolean a) \'");
_builder_1.append("\'\'");
_builder_1.newLine();
_builder_1.append("\t\t");
_builder_1.append("�", "\t\t");
_builder_1.append("bar(a)");
_builder_1.append("�", "\t\t");
_builder_1.newLineIfNotEmpty();
_builder_1.append("\t");
_builder_1.append("\'");
_builder_1.append("\'\'");
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.append("def bar(boolean a)");
_builder_1.newLine();
_builder_1.append("\t\t");
_builder_1.append("\'");
_builder_1.append("\'\'");
_builder_1.append("�", "\t\t");
_builder_1.append("IF a");
_builder_1.append("�", "\t\t");
_builder_1.newLineIfNotEmpty();
_builder_1.append("\t\t\t");
_builder_1.append("�", "\t\t\t");
_builder_1.append("1");
_builder_1.append("�", "\t\t\t");
_builder_1.newLineIfNotEmpty();
_builder_1.append("\t\t");
_builder_1.append("�", "\t\t");
_builder_1.append("ELSE");
_builder_1.append("�", "\t\t");
_builder_1.newLineIfNotEmpty();
_builder_1.append("\t\t\t");
_builder_1.append("�", "\t\t\t");
_builder_1.append("2");
_builder_1.append("�", "\t\t\t");
_builder_1.newLineIfNotEmpty();
_builder_1.append("\t\t");
_builder_1.append("�", "\t\t");
_builder_1.append("ENDIF");
_builder_1.append("�", "\t\t");
_builder_1.append("\'");
_builder_1.append("\'\'");
_builder_1.newLineIfNotEmpty();
_builder_1.append("\t");
_builder_1.newLine();
_builder_1.append("}");
_builder_1.newLine();
this.assertAfterExtract(_builder, _function, _builder_1);
}
use of org.eclipse.xtend.ide.refactoring.ExtractMethodRefactoring in project xtext-xtend by eclipse.
the class ExtractMethodIntegrationTest method test_Bug_453376_2.
@Test
public void test_Bug_453376_2() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("class Foo {");
_builder.newLine();
_builder.append("\t");
_builder.append("def foo() {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("$val x = 1$");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
final Procedure1<ExtractMethodRefactoring> _function = (ExtractMethodRefactoring it) -> {
};
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("class Foo {");
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.append("def foo() {");
_builder_1.newLine();
_builder_1.append("\t\t");
_builder_1.append("bar()");
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.append("}");
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.append("def bar() {");
_builder_1.newLine();
_builder_1.append("\t\t");
_builder_1.append("val x = 1");
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.append("}");
_builder_1.newLine();
_builder_1.append("}");
_builder_1.newLine();
this.assertAfterExtract(_builder, _function, _builder_1);
}
use of org.eclipse.xtend.ide.refactoring.ExtractMethodRefactoring in project xtext-xtend by eclipse.
the class ExtractMethodIntegrationTest method testTemplateExpression_02.
@Test
public void testTemplateExpression_02() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("class Foo {");
_builder.newLine();
_builder.append("\t");
_builder.append("def foo(String value) \'");
_builder.append("\'\'");
_builder.newLine();
_builder.append("\t\t");
_builder.append("$Hello ");
_builder.append("�", "\t\t");
_builder.append(" /* prefix */ value /* postfix */ ");
_builder.append("�", "\t\t");
_builder.append("!$");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("\'");
_builder.append("\'\'");
_builder.newLine();
_builder.append("}");
_builder.newLine();
final Procedure1<ExtractMethodRefactoring> _function = (ExtractMethodRefactoring it) -> {
};
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("class Foo {");
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.append("def foo(String value) \'");
_builder_1.append("\'\'");
_builder_1.append("�", "\t");
_builder_1.append("bar(value)");
_builder_1.append("�", "\t");
_builder_1.append("\'");
_builder_1.append("\'\'");
_builder_1.newLineIfNotEmpty();
_builder_1.append("\t");
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.append("def bar(String value)");
_builder_1.newLine();
_builder_1.append("\t\t");
_builder_1.append("\'");
_builder_1.append("\'\'");
_builder_1.newLine();
_builder_1.append("\t\t\t");
_builder_1.append("Hello ");
_builder_1.append("�", "\t\t\t");
_builder_1.append(" /* prefix */ value /* postfix */ ");
_builder_1.append("�", "\t\t\t");
_builder_1.append("!");
_builder_1.newLineIfNotEmpty();
_builder_1.append("\t\t");
_builder_1.append("\'");
_builder_1.append("\'\'");
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.newLine();
_builder_1.append("}");
_builder_1.newLine();
this.assertAfterExtract(_builder, _function, _builder_1);
}
use of org.eclipse.xtend.ide.refactoring.ExtractMethodRefactoring in project xtext-xtend by eclipse.
the class ExtractMethodIntegrationTest method testTemplateExpression_18.
@Test
public void testTemplateExpression_18() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("class Foo {");
_builder.newLine();
_builder.append("\t");
_builder.append("def foo(int i) \'");
_builder.append("\'\'");
_builder.newLine();
_builder.append("\t\t");
_builder.append("$");
_builder.append("�", "\t\t");
_builder.append("FOR j : 1 .. i");
_builder.append("�", "\t\t");
_builder.newLineIfNotEmpty();
_builder.append("\t\t\t");
_builder.append("�", "\t\t\t");
_builder.append("j");
_builder.append("�", "\t\t\t");
_builder.newLineIfNotEmpty();
_builder.append("\t\t");
_builder.append("�", "\t\t");
_builder.append("ENDFOR");
_builder.append("�", "\t\t");
_builder.append("$");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("\'");
_builder.append("\'\'");
_builder.newLine();
_builder.append("}");
_builder.newLine();
final Procedure1<ExtractMethodRefactoring> _function = (ExtractMethodRefactoring it) -> {
};
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("class Foo {");
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.append("def foo(int i) \'");
_builder_1.append("\'\'");
_builder_1.newLine();
_builder_1.append("\t\t");
_builder_1.append("�", "\t\t");
_builder_1.append("bar(i)");
_builder_1.append("�", "\t\t");
_builder_1.newLineIfNotEmpty();
_builder_1.append("\t");
_builder_1.append("\'");
_builder_1.append("\'\'");
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.append("def bar(int i)");
_builder_1.newLine();
_builder_1.append("\t\t");
_builder_1.append("\'");
_builder_1.append("\'\'");
_builder_1.append("�", "\t\t");
_builder_1.append("FOR j : 1 .. i");
_builder_1.append("�", "\t\t");
_builder_1.newLineIfNotEmpty();
_builder_1.append("\t\t\t");
_builder_1.append("�", "\t\t\t");
_builder_1.append("j�");
_builder_1.newLineIfNotEmpty();
_builder_1.append("\t\t");
_builder_1.append("�", "\t\t");
_builder_1.append("ENDFOR");
_builder_1.append("�", "\t\t");
_builder_1.append("\'");
_builder_1.append("\'\'");
_builder_1.newLineIfNotEmpty();
_builder_1.append("\t");
_builder_1.newLine();
_builder_1.append("}");
_builder_1.newLine();
this.assertAfterExtract(_builder, _function, _builder_1);
}
Aggregations