Search in sources :

Example 86 with ContentAssistProcessorTestBuilder

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

the class Bug453271Test method test_13.

@Test
public void test_13() throws Exception {
    ContentAssistProcessorTestBuilder _newBuilder = this.newBuilder();
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class C {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def String getThingyDingy() {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("\'\'");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("static def void m() {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("C.getThin<|>");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    _newBuilder.append(_builder.toString()).assertNoProposalAtCursor("thingyDingy");
}
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 87 with ContentAssistProcessorTestBuilder

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

the class Bug370955Test method test_02.

@Flaky
@Test
public void test_02() throws Exception {
    ContentAssistProcessorTestBuilder _newBuilder = this.newBuilder();
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class C {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def void method(CharSequence c) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("method(c.toString)");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("}\t");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    _newBuilder.append(_builder.toString()).assertTextAtCursorPosition("toString", "toString".length(), "!=", "!==", "+", "->", "<", "<=", "<=>", "==", "===", "=>", ">", ">=", "?:", "toString");
}
Also used : ContentAssistProcessorTestBuilder(org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Flaky(org.eclipse.xtext.testing.Flaky) AbstractXtendContentAssistBugTest(org.eclipse.xtend.ide.tests.contentassist.AbstractXtendContentAssistBugTest) Test(org.junit.Test)

Example 88 with ContentAssistProcessorTestBuilder

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

the class Bug402876Test method testExtensionPrecendence_09.

@Test
public void testExtensionPrecendence_09() throws Exception {
    ContentAssistProcessorTestBuilder _newBuilder = this.newBuilder();
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class C {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <T, R> long map(java.util.AbstractCollection<T> c, (T)=>R f) {} ");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def <T, R> int map(java.util.Collection<T> c, (T)=>R f) {} ");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def void m(java.util.ArrayList<String> s) {");
    _builder.newLine();
    _builder.append("\t\t");
    _builder.append("s.map<|>");
    _builder.newLine();
    _newBuilder.append(_builder.toString()).assertProposalAtCursor("map[]").withDisplayString("map((T)=>R f) : long - C");
}
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 89 with ContentAssistProcessorTestBuilder

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

the class Bug402876Test method testExtensionForLoopParameter_01.

@Test
public void testExtensionForLoopParameter_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("for(extension String s : newArrayList) ");
    _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 90 with ContentAssistProcessorTestBuilder

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

the class Bug402876Test method testInheritedExtensionField_01.

@Test
public void testInheritedExtensionField_01() throws Exception {
    ContentAssistProcessorTestBuilder _newBuilder = this.newBuilder();
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class A {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("protected extension String s");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    _builder.append("class C extends A {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("def void m(int it) {");
    _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)

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