use of org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder in project xtext-xtend by eclipse.
the class Bug402876Test method testExtensionLocal_02.
@Test
public void testExtensionLocal_02() 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 i) {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("val extension String s = null");
_builder.newLine();
_builder.append("\t\t");
_builder.append("i.");
_builder.newLine();
_newBuilder.append(_builder.toString()).assertProposal("charAt").withDisplayString("charAt : char - String.charAt()");
}
use of org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder in project xtext-xtend by eclipse.
the class Bug402876Test method testExtensionLocal_01.
@Test
public void testExtensionLocal_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 i) {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("val extension String s = null");
_builder.newLine();
_builder.append("\t\t");
_builder.append("i.");
_builder.newLine();
_newBuilder.append(_builder.toString()).assertProposal("subSequence()").withDisplayString("subSequence(int endIndex) : CharSequence - String");
}
use of org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder in project xtext-xtend by eclipse.
the class Bug402876Test method testExtensionParameter_01.
@Test
public void testExtensionParameter_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 i, extension String s) {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("i.");
_builder.newLine();
_newBuilder.append(_builder.toString()).assertProposal("subSequence()").withDisplayString("subSequence(int endIndex) : CharSequence - String");
}
use of org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder in project xtext-xtend by eclipse.
the class Bug427440Test method testStaticMemberPriority.
@Test
public void testStaticMemberPriority() throws Exception {
ContentAssistProcessorTestBuilder _newBuilder = this.newBuilder();
StringConcatenation _builder = new StringConcatenation();
_builder.append("class Test {");
_builder.newLine();
_builder.append("\t");
_builder.append("static def augument() {}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
_builder.newLine();
_builder.append("class Main {");
_builder.newLine();
_builder.append("\t");
_builder.append("def static void main(String[] args) {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("Test.a|");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("}");
_builder.newLine();
final Iterator<ICompletionProposal> proposals = ((List<ICompletionProposal>) Conversions.doWrapArray(_newBuilder.append(_builder.toString()).computeCompletionProposals("|"))).iterator();
this.assertContains(proposals.next(), "augument");
this.assertContains(proposals.next(), "annotatedInterfaces");
this.assertContains(proposals.next(), "annotatedSuperclass");
this.assertContains(proposals.next(), "annotation");
this.assertContains(proposals.next(), "annotations");
this.assertContains(proposals.next(), "anonymousClass");
this.assertContains(proposals.next(), "array");
this.assertContains(proposals.next(), "asSubclass()");
}
use of org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder in project xtext-xtend by eclipse.
the class Bug435043Test method test_21.
@Test
public void test_21() throws Exception {
ContentAssistProcessorTestBuilder _newBuilder = this.newBuilder();
StringConcatenation _builder = new StringConcatenation();
_builder.append("import java.io.*");
_builder.newLine();
_builder.newLine();
_builder.append("class C {");
_builder.newLine();
_builder.append(" ");
_builder.append("static class C2 extends InputStream {");
_builder.newLine();
_builder.append("\t ");
_builder.append("new() {}");
_builder.newLine();
_builder.append("\t ");
_builder.append("<|>");
_builder.newLine();
_builder.append("\t ");
_builder.append("override read() throws IOException {");
_builder.newLine();
_builder.append("\t ");
_builder.append("if(bytes.hasNext) bytes.next else -1");
_builder.newLine();
_builder.append("\t ");
_builder.append("}");
_builder.newLine();
_builder.append(" ");
_builder.append("}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
_newBuilder.append(_builder.toString()).assertProposalDisplayedAtCursor("toString() - Override method from Object");
}
Aggregations