Search in sources :

Example 96 with ContentAssistProcessorTestBuilder

use of org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder in project xtext-xtend by eclipse.

the class Bug402876Test method testExtensionParameterWithImplicitArgument_01.

@Test
public void testExtensionParameterWithImplicitArgument_01() throws Exception {
    ContentAssistProcessorTestBuilder _newBuilder = this.newBuilder();
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class C {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def void m(int it, extension String s) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.newLine();
    _newBuilder.append(_builder.toString()).assertProposal("charAt").withDisplayString("charAt : char - String.charAt()");
}
Also used : ContentAssistProcessorTestBuilder(org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) AbstractXtendContentAssistBugTest(org.eclipse.xtend.ide.tests.contentassist.AbstractXtendContentAssistBugTest) Test(org.junit.Test)

Example 97 with ContentAssistProcessorTestBuilder

use of org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder in project xtext-xtend by eclipse.

the class Bug402876Test method testExtensionParameterNoArguments_01.

@Test
public void testExtensionParameterNoArguments_01() throws Exception {
    ContentAssistProcessorTestBuilder _newBuilder = this.newBuilder();
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class C {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def void m(extension String s) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.newLine();
    _newBuilder.append(_builder.toString()).assertProposal("subSequence()").withDisplayString("subSequence(int beginIndex, int endIndex) : CharSequence - String");
}
Also used : ContentAssistProcessorTestBuilder(org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) AbstractXtendContentAssistBugTest(org.eclipse.xtend.ide.tests.contentassist.AbstractXtendContentAssistBugTest) Test(org.junit.Test)

Example 98 with ContentAssistProcessorTestBuilder

use of org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder in project xtext-xtend by eclipse.

the class Bug402876Test method testExtensionPrecendence_01.

@Test
public void testExtensionPrecendence_01() throws Exception {
    ContentAssistProcessorTestBuilder _newBuilder = this.newBuilder();
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class C {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def void m(Iterable<String> s) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("s.map<|>");
    _builder.newLine();
    _newBuilder.append(_builder.toString()).assertProposalAtCursor("map[]").withDisplayString("map((T)=>R transformation) : Iterable<R> - IterableExtensions");
}
Also used : ContentAssistProcessorTestBuilder(org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) AbstractXtendContentAssistBugTest(org.eclipse.xtend.ide.tests.contentassist.AbstractXtendContentAssistBugTest) Test(org.junit.Test)

Example 99 with ContentAssistProcessorTestBuilder

use of org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder in project xtext-xtend by eclipse.

the class Bug402876Test method testExtensionPrecendence_03.

@Test
public void testExtensionPrecendence_03() throws Exception {
    ContentAssistProcessorTestBuilder _newBuilder = this.newBuilder();
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class C {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def void m(java.util.List<String> s) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("s.map<|>");
    _builder.newLine();
    _newBuilder.append(_builder.toString()).assertProposalAtCursor("map[]").withDisplayString("map((T)=>R transformation) : List<R> - ListExtensions");
}
Also used : ContentAssistProcessorTestBuilder(org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) AbstractXtendContentAssistBugTest(org.eclipse.xtend.ide.tests.contentassist.AbstractXtendContentAssistBugTest) Test(org.junit.Test)

Example 100 with ContentAssistProcessorTestBuilder

use of org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder in project xtext-xtend by eclipse.

the class Bug402876Test method testExtensionCatchParameter_01.

@Test
public void testExtensionCatchParameter_01() throws Exception {
    ContentAssistProcessorTestBuilder _newBuilder = this.newBuilder();
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class C {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def void m(int it) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("// illegal catch param does not matter");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("try {} catch(extension String s) ");
    _builder.newLine();
    _newBuilder.append(_builder.toString()).assertProposal("charAt").withDisplayString("charAt : char - String.charAt()");
}
Also used : ContentAssistProcessorTestBuilder(org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) AbstractXtendContentAssistBugTest(org.eclipse.xtend.ide.tests.contentassist.AbstractXtendContentAssistBugTest) Test(org.junit.Test)

Aggregations

ContentAssistProcessorTestBuilder (org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder)185 Test (org.junit.Test)184 AbstractXtendContentAssistBugTest (org.eclipse.xtend.ide.tests.contentassist.AbstractXtendContentAssistBugTest)183 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)182 Flaky (org.eclipse.xtext.testing.Flaky)13 ICompletionProposal (org.eclipse.jface.text.contentassist.ICompletionProposal)4 List (java.util.List)1