Skip to content

Commit

Permalink
[492072] Regenerated Xtend code
Browse files Browse the repository at this point in the history
Signed-off-by: Karsten Thoms <[email protected]>
  • Loading branch information
Karsten Thoms committed Jan 2, 2017
1 parent 0ebf15d commit 56f1d10
Show file tree
Hide file tree
Showing 253 changed files with 3,446 additions and 8,851 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ public void testSimple1() {
_builder_1.newLine();
_builder_1.append("}");
_builder_1.newLine();
String _string = _builder_1.toString();
String _firstSetGrammarElementsToString = this._contentAssistContextTestHelper.firstSetGrammarElementsToString(this.factory);
Assert.assertEquals(_string, _firstSetGrammarElementsToString);
Assert.assertEquals(_builder_1.toString(), this._contentAssistContextTestHelper.firstSetGrammarElementsToString(this.factory));
}

@Test
Expand Down Expand Up @@ -128,9 +126,7 @@ public void testSimple2() {
_builder_1.newLine();
_builder_1.append("}");
_builder_1.newLine();
String _string = _builder_1.toString();
String _firstSetGrammarElementsToString = this._contentAssistContextTestHelper.firstSetGrammarElementsToString(this.factory);
Assert.assertEquals(_string, _firstSetGrammarElementsToString);
Assert.assertEquals(_builder_1.toString(), this._contentAssistContextTestHelper.firstSetGrammarElementsToString(this.factory));
}

@Test
Expand Down Expand Up @@ -161,9 +157,7 @@ public void testBeginning() {
_builder_1.newLine();
_builder_1.append("}");
_builder_1.newLine();
String _string = _builder_1.toString();
String _firstSetGrammarElementsToString = this._contentAssistContextTestHelper.firstSetGrammarElementsToString(this.factory);
Assert.assertEquals(_string, _firstSetGrammarElementsToString);
Assert.assertEquals(_builder_1.toString(), this._contentAssistContextTestHelper.firstSetGrammarElementsToString(this.factory));
}

@Test
Expand All @@ -190,9 +184,7 @@ public void testCustomEntryPoint() {
_builder_1.newLine();
_builder_1.append("}");
_builder_1.newLine();
String _string = _builder_1.toString();
String _firstSetGrammarElementsToString = this._contentAssistContextTestHelper.firstSetGrammarElementsToString(this.factory);
Assert.assertEquals(_string, _firstSetGrammarElementsToString);
Assert.assertEquals(_builder_1.toString(), this._contentAssistContextTestHelper.firstSetGrammarElementsToString(this.factory));
}

@Test
Expand Down Expand Up @@ -240,8 +232,6 @@ public void testCustomEntryPointBeginning() {
_builder_1.newLine();
_builder_1.append("}");
_builder_1.newLine();
String _string = _builder_1.toString();
String _firstSetGrammarElementsToString = this._contentAssistContextTestHelper.firstSetGrammarElementsToString(this.factory);
Assert.assertEquals(_string, _firstSetGrammarElementsToString);
Assert.assertEquals(_builder_1.toString(), this._contentAssistContextTestHelper.firstSetGrammarElementsToString(this.factory));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.inject.Inject;
import java.util.Map;
import java.util.concurrent.Executors;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.xtend.lib.annotations.Accessors;
import org.eclipse.xtend2.lib.StringConcatenation;
Expand Down Expand Up @@ -67,15 +65,13 @@ private XtextResource parse(final String doc) {
final URI uri = URI.createURI(_plus);
Resource _createResource = this.resFactory.createResource(uri);
final XtextResource res = ((XtextResource) _createResource);
XtextResourceSet _xtextResourceSet = new XtextResourceSet();
EList<Resource> _resources = _xtextResourceSet.getResources();
EList<Resource> _resources = new XtextResourceSet().getResources();
_resources.add(res);
if ((this.entryPoint != null)) {
res.setEntryPoint(this.entryPoint);
}
StringInputStream _stringInputStream = new StringInputStream(doc);
Map<Object, Object> _emptyMap = CollectionLiterals.<Object, Object>emptyMap();
res.load(_stringInputStream, _emptyMap);
res.load(_stringInputStream, CollectionLiterals.<Object, Object>emptyMap());
this.validator.assertNoErrors(res);
return res;
} catch (Throwable _e) {
Expand All @@ -91,10 +87,7 @@ public String firstSetGrammarElementsToString(final ContentAssistContextFactory
factory.setPool(Executors.newCachedThreadPool());
TextRegion _textRegion = new TextRegion(0, 0);
final ContentAssistContext[] ctxs = factory.create(doc, _textRegion, offset, res);
GrammarElementTitleSwitch _grammarElementTitleSwitch = new GrammarElementTitleSwitch();
GrammarElementTitleSwitch _showAssignments = _grammarElementTitleSwitch.showAssignments();
GrammarElementTitleSwitch _showQualified = _showAssignments.showQualified();
final GrammarElementTitleSwitch f = _showQualified.showRule();
final GrammarElementTitleSwitch f = new GrammarElementTitleSwitch().showAssignments().showQualified().showRule();
StringConcatenation _builder = new StringConcatenation();
{
Iterable<Pair<Integer, ContentAssistContext>> _indexed = IterableExtensions.<ContentAssistContext>indexed(((Iterable<? extends ContentAssistContext>)Conversions.doWrapArray(ctxs)));
Expand All @@ -105,12 +98,10 @@ public String firstSetGrammarElementsToString(final ContentAssistContextFactory
_builder.append(" {");
_builder.newLineIfNotEmpty();
{
ContentAssistContext _value = ctx.getValue();
ImmutableList<AbstractElement> _firstSetGrammarElements = _value.getFirstSetGrammarElements();
ImmutableList<AbstractElement> _firstSetGrammarElements = ctx.getValue().getFirstSetGrammarElements();
for(final AbstractElement ele : _firstSetGrammarElements) {
_builder.append("\t");
EClass _eClass = ele.eClass();
String _name = _eClass.getName();
String _name = ele.eClass().getName();
_builder.append(_name, "\t");
_builder.append(": ");
String _apply = f.apply(ele);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ public void testSimple1() {
_builder_1.newLine();
_builder_1.append("}");
_builder_1.newLine();
String _string = _builder_1.toString();
String _firstSetGrammarElementsToString = this._contentAssistContextTestHelper.firstSetGrammarElementsToString(this.factory);
Assert.assertEquals(_string, _firstSetGrammarElementsToString);
Assert.assertEquals(_builder_1.toString(), this._contentAssistContextTestHelper.firstSetGrammarElementsToString(this.factory));
}

@Test
Expand Down Expand Up @@ -104,9 +102,7 @@ public void testSimple2() {
_builder_1.newLine();
_builder_1.append("}");
_builder_1.newLine();
String _string = _builder_1.toString();
String _firstSetGrammarElementsToString = this._contentAssistContextTestHelper.firstSetGrammarElementsToString(this.factory);
Assert.assertEquals(_string, _firstSetGrammarElementsToString);
Assert.assertEquals(_builder_1.toString(), this._contentAssistContextTestHelper.firstSetGrammarElementsToString(this.factory));
}

@Test
Expand All @@ -131,9 +127,7 @@ public void testBeginning() {
_builder_1.newLine();
_builder_1.append("}");
_builder_1.newLine();
String _string = _builder_1.toString();
String _firstSetGrammarElementsToString = this._contentAssistContextTestHelper.firstSetGrammarElementsToString(this.factory);
Assert.assertEquals(_string, _firstSetGrammarElementsToString);
Assert.assertEquals(_builder_1.toString(), this._contentAssistContextTestHelper.firstSetGrammarElementsToString(this.factory));
}

@Test
Expand All @@ -154,9 +148,7 @@ public void testCustomEntryPoint() {
_builder_1.newLine();
_builder_1.append("}");
_builder_1.newLine();
String _string = _builder_1.toString();
String _firstSetGrammarElementsToString = this._contentAssistContextTestHelper.firstSetGrammarElementsToString(this.factory);
Assert.assertEquals(_string, _firstSetGrammarElementsToString);
Assert.assertEquals(_builder_1.toString(), this._contentAssistContextTestHelper.firstSetGrammarElementsToString(this.factory));
}

@Test
Expand All @@ -183,8 +175,6 @@ public void testCustomEntryPointBeginning() {
_builder_1.newLine();
_builder_1.append("}");
_builder_1.newLine();
String _string = _builder_1.toString();
String _firstSetGrammarElementsToString = this._contentAssistContextTestHelper.firstSetGrammarElementsToString(this.factory);
Assert.assertEquals(_string, _firstSetGrammarElementsToString);
Assert.assertEquals(_builder_1.toString(), this._contentAssistContextTestHelper.firstSetGrammarElementsToString(this.factory));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ public void testChain() {
it.setDependencies(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList()));
};
final ProjectDescription d = ObjectExtensions.<ProjectDescription>operator_doubleArrow(_projectDescription_3, _function_3);
this.assertEquals(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(d, c, b, a)), new TopologicalSorter().sortByDependencies(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(a, b, c, d)), ((Procedure1<ProjectDescription>) (ProjectDescription it) -> {
final Procedure1<ProjectDescription> _function_4 = (ProjectDescription it) -> {
Assert.fail();
})));
};
this.assertEquals(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(d, c, b, a)), new TopologicalSorter().sortByDependencies(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(a, b, c, d)), _function_4));
}

@Test
Expand Down Expand Up @@ -84,9 +85,10 @@ public void testDiamond() {
it.setDependencies(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList()));
};
final ProjectDescription d = ObjectExtensions.<ProjectDescription>operator_doubleArrow(_projectDescription_3, _function_3);
this.assertEquals(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(d, c, b, a)), new TopologicalSorter().sortByDependencies(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(a, b, c, d)), ((Procedure1<ProjectDescription>) (ProjectDescription it) -> {
final Procedure1<ProjectDescription> _function_4 = (ProjectDescription it) -> {
Assert.fail();
})));
};
this.assertEquals(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(d, c, b, a)), new TopologicalSorter().sortByDependencies(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(a, b, c, d)), _function_4));
}

@Test
Expand Down Expand Up @@ -115,9 +117,10 @@ public void testDiamond_1() {
it.setDependencies(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList()));
};
final ProjectDescription d = ObjectExtensions.<ProjectDescription>operator_doubleArrow(_projectDescription_3, _function_3);
this.assertEquals(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(d, c, b, a)), new TopologicalSorter().sortByDependencies(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(a, b, c, d)), ((Procedure1<ProjectDescription>) (ProjectDescription it) -> {
final Procedure1<ProjectDescription> _function_4 = (ProjectDescription it) -> {
Assert.fail();
})));
};
this.assertEquals(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(d, c, b, a)), new TopologicalSorter().sortByDependencies(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(a, b, c, d)), _function_4));
}

@Test
Expand All @@ -133,12 +136,14 @@ public void testJustOne() {
it.setName("b");
};
final ProjectDescription b = ObjectExtensions.<ProjectDescription>operator_doubleArrow(_projectDescription_1, _function_1);
this.assertEquals(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(a)), new TopologicalSorter().sortByDependencies(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(a)), ((Procedure1<ProjectDescription>) (ProjectDescription it) -> {
final Procedure1<ProjectDescription> _function_2 = (ProjectDescription it) -> {
Assert.fail();
})));
this.assertEquals(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(b)), new TopologicalSorter().sortByDependencies(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(b)), ((Procedure1<ProjectDescription>) (ProjectDescription it) -> {
};
this.assertEquals(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(a)), new TopologicalSorter().sortByDependencies(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(a)), _function_2));
final Procedure1<ProjectDescription> _function_3 = (ProjectDescription it) -> {
Assert.fail();
})));
};
this.assertEquals(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(b)), new TopologicalSorter().sortByDependencies(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(b)), _function_3));
}

@Test
Expand Down Expand Up @@ -174,9 +179,10 @@ public void testCycle() {
};
final ProjectDescription e = ObjectExtensions.<ProjectDescription>operator_doubleArrow(_projectDescription_4, _function_4);
final ArrayList<ProjectDescription> cyclic = CollectionLiterals.<ProjectDescription>newArrayList();
this.assertEquals(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(e)), new TopologicalSorter().sortByDependencies(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(a, b, c, d, e)), ((Procedure1<ProjectDescription>) (ProjectDescription it) -> {
final Procedure1<ProjectDescription> _function_5 = (ProjectDescription it) -> {
cyclic.add(it);
})));
};
this.assertEquals(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(e)), new TopologicalSorter().sortByDependencies(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(a, b, c, d, e)), _function_5));
this.assertEquals(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(b, d, c, a)), cyclic);
}

Expand All @@ -189,9 +195,10 @@ public void testCycle1() {
};
final ProjectDescription a = ObjectExtensions.<ProjectDescription>operator_doubleArrow(_projectDescription, _function);
final ArrayList<ProjectDescription> cyclic = CollectionLiterals.<ProjectDescription>newArrayList();
this.assertEquals(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList()), new TopologicalSorter().sortByDependencies(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(a)), ((Procedure1<ProjectDescription>) (ProjectDescription it) -> {
final Procedure1<ProjectDescription> _function_1 = (ProjectDescription it) -> {
cyclic.add(it);
})));
};
this.assertEquals(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList()), new TopologicalSorter().sortByDependencies(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(a)), _function_1));
this.assertEquals(Collections.<ProjectDescription>unmodifiableList(CollectionLiterals.<ProjectDescription>newArrayList(a)), cyclic);
}

Expand All @@ -210,7 +217,6 @@ public String asString(final List<ProjectDescription> list) {
final Function1<ProjectDescription, String> _function = (ProjectDescription it) -> {
return it.getName();
};
List<String> _map = ListExtensions.<ProjectDescription, String>map(list, _function);
return IterableExtensions.join(_map, ", ");
return IterableExtensions.join(ListExtensions.<ProjectDescription, String>map(list, _function), ", ");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@
package org.eclipse.xtext.ide.tests.server;

import java.io.File;
import java.net.URI;
import java.nio.file.Path;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.lsp4j.ColoringInformation;
import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.ide.tests.server.AbstractTestLangLanguageServerTest;
Expand Down Expand Up @@ -85,25 +83,19 @@ public void checkColoring() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("MyModel.");
_builder.append(this.fileExtension);
Path _resolve = _path.resolve(_builder.toString());
final File file = _resolve.toFile();
URI _uRI = file.toURI();
final String uri = _uRI.toString();
final File file = _path.resolve(_builder.toString()).toFile();
final String uri = file.toURI().toString();
this.open(uri, ColoringTest.MODEL);
Map<String, List<? extends ColoringInformation>> _coloringParams = this.getColoringParams();
Set<Map.Entry<String, List<? extends ColoringInformation>>> _entrySet = _coloringParams.entrySet();
final Function1<Map.Entry<String, List<? extends ColoringInformation>>, String> _function = (Map.Entry<String, List<? extends ColoringInformation>> it) -> {
String _key = it.getKey();
String _key_1 = it.getKey();
int _lastIndexOf = _key_1.lastIndexOf("/");
int _lastIndexOf = it.getKey().lastIndexOf("/");
int _plus = (_lastIndexOf + 1);
return _key.substring(_plus);
};
final Function1<Map.Entry<String, List<? extends ColoringInformation>>, List<? extends ColoringInformation>> _function_1 = (Map.Entry<String, List<? extends ColoringInformation>> it) -> {
return it.getValue();
};
Map<String, List<? extends ColoringInformation>> _map = IterableExtensions.<Map.Entry<String, List<? extends ColoringInformation>>, String, List<? extends ColoringInformation>>toMap(_entrySet, _function, _function_1);
final String expectation = this.toExpectation(_map);
final String expectation = this.toExpectation(IterableExtensions.<Map.Entry<String, List<? extends ColoringInformation>>, String, List<? extends ColoringInformation>>toMap(this.getColoringParams().entrySet(), _function, _function_1));
StringConcatenation _builder_1 = new StringConcatenation();
String _name = file.getName();
_builder_1.append(_name);
Expand Down
Loading

0 comments on commit 56f1d10

Please sign in to comment.