Lines 9444-9450
Link Here
|
9444 |
" public static int foo;\n" + |
9444 |
" public static int foo;\n" + |
9445 |
"}"); |
9445 |
"}"); |
9446 |
|
9446 |
|
9447 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9447 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true); |
|
|
9448 |
requestor.allowAllRequiredProposals(); |
9448 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
9449 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
9449 |
|
9450 |
|
9450 |
String str = this.workingCopies[0].getSource(); |
9451 |
String str = this.workingCopies[0].getSource(); |
Lines 9452-9459
Link Here
|
9452 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9453 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9453 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9454 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9454 |
|
9455 |
|
|
|
9456 |
int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED; |
9457 |
int start1 = str.lastIndexOf("foo") + "".length(); |
9458 |
int end1 = start1 + "foo".length(); |
9459 |
int start2 = str.lastIndexOf("public class"); |
9460 |
int end2 = start2 + "".length(); |
9455 |
assertResults( |
9461 |
assertResults( |
9456 |
"foo[FIELD_REF]{test.p.ZZZ.foo, Ltest.p.ZZZ;, I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}", |
9462 |
"foo[FIELD_REF]{foo, Ltest.p.ZZZ;, I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" + |
|
|
9463 |
" foo[FIELD_IMPORT]{import static test.p.ZZZ.foo;\n, Ltest.p.ZZZ;, I, foo, null, ["+start2+", "+end2+"], " + (relevance1) + "}", |
9457 |
requestor.getResults()); |
9464 |
requestor.getResults()); |
9458 |
} |
9465 |
} |
9459 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9466 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
Lines 9475-9490
Link Here
|
9475 |
" public static int foo(){}\n" + |
9482 |
" public static int foo(){}\n" + |
9476 |
"}"); |
9483 |
"}"); |
9477 |
|
9484 |
|
9478 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9485 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true); |
|
|
9486 |
requestor.allowAllRequiredProposals(); |
9479 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
9487 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
9480 |
|
9488 |
|
9481 |
String str = this.workingCopies[0].getSource(); |
9489 |
String str = this.workingCopies[0].getSource(); |
9482 |
String completeBehind = "foo"; |
9490 |
String completeBehind = "foo"; |
9483 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9491 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9484 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9492 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9485 |
|
9493 |
|
|
|
9494 |
int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED; |
9495 |
int start1 = str.lastIndexOf("foo") + "".length(); |
9496 |
int end1 = start1 + "foo".length(); |
9497 |
int start2 = str.lastIndexOf("public class"); |
9498 |
int end2 = start2 + "".length(); |
9486 |
assertResults( |
9499 |
assertResults( |
9487 |
"foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}", |
9500 |
"foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" + |
|
|
9501 |
" foo[METHOD_IMPORT]{import static test.p.ZZZ.foo;\n, Ltest.p.ZZZ;, ()I, foo, null, ["+start2+", "+end2+"], " + (relevance1) + "}", |
9488 |
requestor.getResults()); |
9502 |
requestor.getResults()); |
9489 |
} |
9503 |
} |
9490 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9504 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
Lines 9506-9512
Link Here
|
9506 |
" public static int foo;\n" + |
9520 |
" public static int foo;\n" + |
9507 |
"}"); |
9521 |
"}"); |
9508 |
|
9522 |
|
9509 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9523 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true); |
|
|
9524 |
requestor.allowAllRequiredProposals(); |
9510 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ"}); |
9525 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ"}); |
9511 |
|
9526 |
|
9512 |
String str = this.workingCopies[0].getSource(); |
9527 |
String str = this.workingCopies[0].getSource(); |
Lines 9537-9543
Link Here
|
9537 |
" public static int foo(){}\n" + |
9552 |
" public static int foo(){}\n" + |
9538 |
"}"); |
9553 |
"}"); |
9539 |
|
9554 |
|
9540 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9555 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true); |
|
|
9556 |
requestor.allowAllRequiredProposals(); |
9541 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ"}); |
9557 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ"}); |
9542 |
|
9558 |
|
9543 |
String str = this.workingCopies[0].getSource(); |
9559 |
String str = this.workingCopies[0].getSource(); |
Lines 9568-9583
Link Here
|
9568 |
" public static int foo;\n" + |
9584 |
" public static int foo;\n" + |
9569 |
"}"); |
9585 |
"}"); |
9570 |
|
9586 |
|
9571 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9587 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true); |
|
|
9588 |
requestor.allowAllRequiredProposals(); |
9572 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"}); |
9589 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"}); |
9573 |
|
9590 |
|
9574 |
String str = this.workingCopies[0].getSource(); |
9591 |
String str = this.workingCopies[0].getSource(); |
9575 |
String completeBehind = "foo"; |
9592 |
String completeBehind = "foo"; |
9576 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9593 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9577 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9594 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9578 |
|
9595 |
|
|
|
9596 |
int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED; |
9597 |
int start1 = str.lastIndexOf("foo") + "".length(); |
9598 |
int end1 = start1 + "foo".length(); |
9599 |
int start2 = str.lastIndexOf("public class"); |
9600 |
int end2 = start2 + "".length(); |
9579 |
assertResults( |
9601 |
assertResults( |
9580 |
"foo[FIELD_REF]{test.p.ZZZ.foo, Ltest.p.ZZZ;, I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}", |
9602 |
"foo[FIELD_REF]{foo, Ltest.p.ZZZ;, I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" + |
|
|
9603 |
" foo[FIELD_IMPORT]{import static test.p.ZZZ.foo;\n, Ltest.p.ZZZ;, I, foo, null, ["+start2+", "+end2+"], " + (relevance1) + "}", |
9581 |
requestor.getResults()); |
9604 |
requestor.getResults()); |
9582 |
} |
9605 |
} |
9583 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9606 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
Lines 9599-9605
Link Here
|
9599 |
" public static int foo(){}\n" + |
9622 |
" public static int foo(){}\n" + |
9600 |
"}"); |
9623 |
"}"); |
9601 |
|
9624 |
|
9602 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9625 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true); |
|
|
9626 |
requestor.allowAllRequiredProposals(); |
9603 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"}); |
9627 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"}); |
9604 |
|
9628 |
|
9605 |
String str = this.workingCopies[0].getSource(); |
9629 |
String str = this.workingCopies[0].getSource(); |
Lines 9607-9614
Link Here
|
9607 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9631 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9608 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9632 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9609 |
|
9633 |
|
|
|
9634 |
int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED; |
9635 |
int start1 = str.lastIndexOf("foo") + "".length(); |
9636 |
int end1 = start1 + "foo".length(); |
9637 |
int start2 = str.lastIndexOf("public class"); |
9638 |
int end2 = start2 + "".length(); |
9610 |
assertResults( |
9639 |
assertResults( |
9611 |
"foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}", |
9640 |
"foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" + |
|
|
9641 |
" foo[METHOD_IMPORT]{import static test.p.ZZZ.foo;\n, Ltest.p.ZZZ;, ()I, foo, null, ["+start2+", "+end2+"], " + (relevance1) + "}", |
9612 |
requestor.getResults()); |
9642 |
requestor.getResults()); |
9613 |
} |
9643 |
} |
9614 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9644 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
Lines 9631-9637
Link Here
|
9631 |
" public static int foo(){}\n" + |
9661 |
" public static int foo(){}\n" + |
9632 |
"}"); |
9662 |
"}"); |
9633 |
|
9663 |
|
9634 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9664 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true); |
|
|
9665 |
requestor.allowAllRequiredProposals(); |
9635 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
9666 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
9636 |
|
9667 |
|
9637 |
String str = this.workingCopies[0].getSource(); |
9668 |
String str = this.workingCopies[0].getSource(); |
Lines 9639-9646
Link Here
|
9639 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9670 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9640 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9671 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9641 |
|
9672 |
|
|
|
9673 |
int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED; |
9674 |
int start1 = str.lastIndexOf("foo") + "".length(); |
9675 |
int end1 = start1 + "foo".length(); |
9676 |
int start2 = str.lastIndexOf("public class"); |
9677 |
int end2 = start2 + "".length(); |
9642 |
assertResults( |
9678 |
assertResults( |
9643 |
"foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}", |
9679 |
"foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" + |
|
|
9680 |
" foo[METHOD_IMPORT]{import static test.p.ZZZ.foo;\n, Ltest.p.ZZZ;, ()I, foo, null, ["+start2+", "+end2+"], " + (relevance1) + "}", |
9644 |
requestor.getResults()); |
9681 |
requestor.getResults()); |
9645 |
} |
9682 |
} |
9646 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9683 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
Lines 9663-9678
Link Here
|
9663 |
" public static int foo(){}\n" + |
9700 |
" public static int foo(){}\n" + |
9664 |
"}"); |
9701 |
"}"); |
9665 |
|
9702 |
|
9666 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9703 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true); |
|
|
9704 |
requestor.allowAllRequiredProposals(); |
9667 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
9705 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
9668 |
|
9706 |
|
9669 |
String str = this.workingCopies[0].getSource(); |
9707 |
String str = this.workingCopies[0].getSource(); |
9670 |
String completeBehind = "foo"; |
9708 |
String completeBehind = "foo"; |
9671 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9709 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9672 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9710 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9673 |
|
9711 |
|
|
|
9712 |
int start1 = str.lastIndexOf("foo") + "".length(); |
9713 |
int end1 = start1 + "foo".length(); |
9674 |
assertResults( |
9714 |
assertResults( |
9675 |
"foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED +R_NON_RESTRICTED)+"}", |
9715 |
"foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED +R_NON_RESTRICTED)+"}", |
9676 |
requestor.getResults()); |
9716 |
requestor.getResults()); |
9677 |
} |
9717 |
} |
9678 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9718 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
Lines 9695-9701
Link Here
|
9695 |
" public static int foo(){}\n" + |
9735 |
" public static int foo(){}\n" + |
9696 |
"}"); |
9736 |
"}"); |
9697 |
|
9737 |
|
9698 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9738 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true); |
|
|
9739 |
requestor.allowAllRequiredProposals(); |
9699 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"}); |
9740 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"}); |
9700 |
|
9741 |
|
9701 |
String str = this.workingCopies[0].getSource(); |
9742 |
String str = this.workingCopies[0].getSource(); |
Lines 9703-9710
Link Here
|
9703 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9744 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9704 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9745 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9705 |
|
9746 |
|
|
|
9747 |
int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED; |
9748 |
int start1 = str.lastIndexOf("foo") + "".length(); |
9749 |
int end1 = start1 + "foo".length(); |
9750 |
int start2 = str.lastIndexOf("public class"); |
9751 |
int end2 = start2 + "".length(); |
9706 |
assertResults( |
9752 |
assertResults( |
9707 |
"foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}", |
9753 |
"foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" + |
|
|
9754 |
" foo[METHOD_IMPORT]{import static test.p.ZZZ.foo;\n, Ltest.p.ZZZ;, ()I, foo, null, ["+start2+", "+end2+"], " + (relevance1) + "}", |
9708 |
requestor.getResults()); |
9755 |
requestor.getResults()); |
9709 |
} |
9756 |
} |
9710 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9757 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
Lines 9727-9733
Link Here
|
9727 |
" public static int foo(){}\n" + |
9774 |
" public static int foo(){}\n" + |
9728 |
"}"); |
9775 |
"}"); |
9729 |
|
9776 |
|
9730 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9777 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true); |
|
|
9778 |
requestor.allowAllRequiredProposals(); |
9731 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"}); |
9779 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"}); |
9732 |
|
9780 |
|
9733 |
String str = this.workingCopies[0].getSource(); |
9781 |
String str = this.workingCopies[0].getSource(); |
Lines 9735-9742
Link Here
|
9735 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9783 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9736 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9784 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9737 |
|
9785 |
|
|
|
9786 |
int start1 = str.lastIndexOf("foo") + "".length(); |
9787 |
int end1 = start1 + "foo".length(); |
9738 |
assertResults( |
9788 |
assertResults( |
9739 |
"foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
9789 |
"foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED +R_NON_RESTRICTED)+"}", |
9740 |
requestor.getResults()); |
9790 |
requestor.getResults()); |
9741 |
} |
9791 |
} |
9742 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9792 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
Lines 9759-9765
Link Here
|
9759 |
" public static int foo(){}\n" + |
9809 |
" public static int foo(){}\n" + |
9760 |
"}"); |
9810 |
"}"); |
9761 |
|
9811 |
|
9762 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9812 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true); |
|
|
9813 |
requestor.allowAllRequiredProposals(); |
9763 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
9814 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
9764 |
|
9815 |
|
9765 |
String str = this.workingCopies[0].getSource(); |
9816 |
String str = this.workingCopies[0].getSource(); |
Lines 9767-9774
Link Here
|
9767 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9818 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9768 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9819 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9769 |
|
9820 |
|
|
|
9821 |
int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED; |
9822 |
int start1 = str.lastIndexOf("foo") + "".length(); |
9823 |
int end1 = start1 + "foo".length(); |
9824 |
int start2 = str.lastIndexOf("public class"); |
9825 |
int end2 = start2 + "".length(); |
9770 |
assertResults( |
9826 |
assertResults( |
9771 |
"foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}", |
9827 |
"foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" + |
|
|
9828 |
" foo[METHOD_IMPORT]{import static test.p.ZZZ.foo;\n, Ltest.p.ZZZ;, ()I, foo, null, ["+start2+", "+end2+"], " + (relevance1) + "}", |
9772 |
requestor.getResults()); |
9829 |
requestor.getResults()); |
9773 |
} |
9830 |
} |
9774 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9831 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
Lines 9791-9797
Link Here
|
9791 |
" public static int foo(){}\n" + |
9848 |
" public static int foo(){}\n" + |
9792 |
"}"); |
9849 |
"}"); |
9793 |
|
9850 |
|
9794 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9851 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true); |
|
|
9852 |
requestor.allowAllRequiredProposals(); |
9795 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
9853 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
9796 |
|
9854 |
|
9797 |
String str = this.workingCopies[0].getSource(); |
9855 |
String str = this.workingCopies[0].getSource(); |
Lines 9799-9806
Link Here
|
9799 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9857 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9800 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9858 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9801 |
|
9859 |
|
|
|
9860 |
int start1 = str.lastIndexOf("foo") + "".length(); |
9861 |
int end1 = start1 + "foo".length(); |
9802 |
assertResults( |
9862 |
assertResults( |
9803 |
"foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
9863 |
"foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED +R_NON_RESTRICTED)+"}", |
9804 |
requestor.getResults()); |
9864 |
requestor.getResults()); |
9805 |
} |
9865 |
} |
9806 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9866 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
Lines 9823-9829
Link Here
|
9823 |
" public static int foo(){}\n" + |
9883 |
" public static int foo(){}\n" + |
9824 |
"}"); |
9884 |
"}"); |
9825 |
|
9885 |
|
9826 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9886 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true); |
|
|
9887 |
requestor.allowAllRequiredProposals(); |
9827 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"}); |
9888 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"}); |
9828 |
|
9889 |
|
9829 |
String str = this.workingCopies[0].getSource(); |
9890 |
String str = this.workingCopies[0].getSource(); |
Lines 9831-9838
Link Here
|
9831 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9892 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9832 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9893 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9833 |
|
9894 |
|
|
|
9895 |
int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED; |
9896 |
int start1 = str.lastIndexOf("foo") + "".length(); |
9897 |
int end1 = start1 + "foo".length(); |
9898 |
int start2 = str.lastIndexOf("public class"); |
9899 |
int end2 = start2 + "".length(); |
9834 |
assertResults( |
9900 |
assertResults( |
9835 |
"foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}", |
9901 |
"foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" + |
|
|
9902 |
" foo[METHOD_IMPORT]{import static test.p.ZZZ.foo;\n, Ltest.p.ZZZ;, ()I, foo, null, ["+start2+", "+end2+"], " + (relevance1) + "}", |
9836 |
requestor.getResults()); |
9903 |
requestor.getResults()); |
9837 |
} |
9904 |
} |
9838 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9905 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
Lines 9855-9861
Link Here
|
9855 |
" public static int foo(){}\n" + |
9922 |
" public static int foo(){}\n" + |
9856 |
"}"); |
9923 |
"}"); |
9857 |
|
9924 |
|
9858 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9925 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true); |
|
|
9926 |
requestor.allowAllRequiredProposals(); |
9859 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"}); |
9927 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"}); |
9860 |
|
9928 |
|
9861 |
String str = this.workingCopies[0].getSource(); |
9929 |
String str = this.workingCopies[0].getSource(); |
Lines 9863-9870
Link Here
|
9863 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9931 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9864 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9932 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9865 |
|
9933 |
|
|
|
9934 |
int start1 = str.lastIndexOf("foo") + "".length(); |
9935 |
int end1 = start1 + "foo".length(); |
9866 |
assertResults( |
9936 |
assertResults( |
9867 |
"foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
9937 |
"foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED +R_NON_RESTRICTED)+"}", |
9868 |
requestor.getResults()); |
9938 |
requestor.getResults()); |
9869 |
} |
9939 |
} |
9870 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9940 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
Lines 9894-9900
Link Here
|
9894 |
" public static int foo(){}\n" + |
9964 |
" public static int foo(){}\n" + |
9895 |
"}"); |
9965 |
"}"); |
9896 |
|
9966 |
|
9897 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
9967 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true); |
|
|
9968 |
requestor.allowAllRequiredProposals(); |
9898 |
requestor.setFavoriteReferences(new String[]{"test.q.ZZZ2.foo"}); |
9969 |
requestor.setFavoriteReferences(new String[]{"test.q.ZZZ2.foo"}); |
9899 |
|
9970 |
|
9900 |
String str = this.workingCopies[0].getSource(); |
9971 |
String str = this.workingCopies[0].getSource(); |
Lines 9902-9910
Link Here
|
9902 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9973 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9903 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9974 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9904 |
|
9975 |
|
|
|
9976 |
int start1 = str.lastIndexOf("foo") + "".length(); |
9977 |
int end1 = start1 + "foo".length(); |
9905 |
assertResults( |
9978 |
assertResults( |
9906 |
"foo[METHOD_REF]{test.q.ZZZ2.foo(), Ltest.q.ZZZ2;, ()I, foo, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED) + "}\n" + |
9979 |
"foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED) + "}", |
9907 |
"foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
|
|
9908 |
requestor.getResults()); |
9980 |
requestor.getResults()); |
9909 |
} |
9981 |
} |
9910 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
9982 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
Lines 9928-9944
Link Here
|
9928 |
" public static int foo(){}\n" + |
10000 |
" public static int foo(){}\n" + |
9929 |
"}"); |
10001 |
"}"); |
9930 |
|
10002 |
|
9931 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
10003 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true); |
|
|
10004 |
requestor.allowAllRequiredProposals(); |
9932 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
10005 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
9933 |
|
10006 |
|
9934 |
String str = this.workingCopies[0].getSource(); |
10007 |
String str = this.workingCopies[0].getSource(); |
9935 |
String completeBehind = "foo"; |
10008 |
String completeBehind = "foo"; |
9936 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
10009 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9937 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
10010 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9938 |
|
10011 |
|
9939 |
assertResults( |
10012 |
int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED; |
9940 |
"foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED) + "}\n" + |
10013 |
int start1 = str.lastIndexOf("foo") + "".length(); |
9941 |
"Test.foo[TYPE_REF]{foo, test, Ltest.Test$foo;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
10014 |
int end1 = start1 + "foo".length(); |
|
|
10015 |
int start2 = str.lastIndexOf("public class Test"); |
10016 |
int end2 = start2 + "".length(); |
10017 |
assertResults( |
10018 |
"foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], " + (relevance1) + "}\n" + |
10019 |
" foo[METHOD_IMPORT]{import static test.p.ZZZ.foo;\n, Ltest.p.ZZZ;, ()I, foo, null, ["+start2+", "+end2+"], " + (relevance1) + "}\n" + |
10020 |
"Test.foo[TYPE_REF]{foo, test, Ltest.Test$foo;, null, null, ["+start1+", "+end1+"], "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
9942 |
requestor.getResults()); |
10021 |
requestor.getResults()); |
9943 |
} |
10022 |
} |
9944 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
10023 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
Lines 9960-9966
Link Here
|
9960 |
" public static int foo(){}\n" + |
10039 |
" public static int foo(){}\n" + |
9961 |
"}"); |
10040 |
"}"); |
9962 |
|
10041 |
|
9963 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
10042 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true); |
|
|
10043 |
requestor.allowAllRequiredProposals(); |
9964 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
10044 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
9965 |
|
10045 |
|
9966 |
String str = this.workingCopies[0].getSource(); |
10046 |
String str = this.workingCopies[0].getSource(); |
Lines 9968-9976
Link Here
|
9968 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
10048 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
9969 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
10049 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
9970 |
|
10050 |
|
|
|
10051 |
int start1 = str.lastIndexOf("foo") + "".length(); |
10052 |
int end1 = start1 + "foo".length(); |
9971 |
assertResults( |
10053 |
assertResults( |
9972 |
"foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED) + "}\n" + |
10054 |
"foo[METHOD_REF]{foo(), Ltest.Test;, ()V, foo, null, ["+start1+", "+end1+"], "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
9973 |
"foo[METHOD_REF]{foo(), Ltest.Test;, ()V, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
|
|
9974 |
requestor.getResults()); |
10055 |
requestor.getResults()); |
9975 |
} |
10056 |
} |
9976 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
10057 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
Lines 9993-9999
Link Here
|
9993 |
" public static int foo(){}\n" + |
10074 |
" public static int foo(){}\n" + |
9994 |
"}"); |
10075 |
"}"); |
9995 |
|
10076 |
|
9996 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
10077 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true); |
|
|
10078 |
requestor.allowAllRequiredProposals(); |
9997 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
10079 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
9998 |
|
10080 |
|
9999 |
String str = this.workingCopies[0].getSource(); |
10081 |
String str = this.workingCopies[0].getSource(); |
Lines 10001-10009
Link Here
|
10001 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
10083 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
10002 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
10084 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
10003 |
|
10085 |
|
10004 |
assertResults( |
10086 |
int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED; |
10005 |
"foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED) + "}\n" + |
10087 |
int start1 = str.lastIndexOf("foo") + "".length(); |
10006 |
"foo[FIELD_REF]{foo, Ltest.Test;, I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
10088 |
int end1 = start1 + "foo".length(); |
|
|
10089 |
int start2 = str.lastIndexOf("public class"); |
10090 |
int end2 = start2 + "".length(); |
10091 |
assertResults( |
10092 |
"foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" + |
10093 |
" foo[METHOD_IMPORT]{import static test.p.ZZZ.foo;\n, Ltest.p.ZZZ;, ()I, foo, null, ["+start2+", "+end2+"], " + (relevance1) + "}\n"+ |
10094 |
"foo[FIELD_REF]{foo, Ltest.Test;, I, foo, null, ["+start1+", "+end1+"], " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED) + "}", |
10007 |
requestor.getResults()); |
10095 |
requestor.getResults()); |
10008 |
} |
10096 |
} |
10009 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
10097 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
Lines 10026-10032
Link Here
|
10026 |
" public static int foo(){}\n" + |
10114 |
" public static int foo(){}\n" + |
10027 |
"}"); |
10115 |
"}"); |
10028 |
|
10116 |
|
10029 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
10117 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true); |
|
|
10118 |
requestor.allowAllRequiredProposals(); |
10030 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
10119 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
10031 |
|
10120 |
|
10032 |
String str = this.workingCopies[0].getSource(); |
10121 |
String str = this.workingCopies[0].getSource(); |
Lines 10034-10042
Link Here
|
10034 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
10123 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
10035 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
10124 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
10036 |
|
10125 |
|
10037 |
assertResults( |
10126 |
int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED; |
10038 |
"foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED) + "}\n" + |
10127 |
int start1 = str.lastIndexOf("foo") + "".length(); |
10039 |
"foo[LOCAL_VARIABLE_REF]{foo, null, I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
10128 |
int end1 = start1 + "foo".length(); |
|
|
10129 |
int start2 = str.lastIndexOf("public class"); |
10130 |
int end2 = start2 + "".length(); |
10131 |
assertResults( |
10132 |
"foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" + |
10133 |
" foo[METHOD_IMPORT]{import static test.p.ZZZ.foo;\n, Ltest.p.ZZZ;, ()I, foo, null, ["+start2+", "+end2+"], " + (relevance1) + "}\n"+ |
10134 |
"foo[LOCAL_VARIABLE_REF]{foo, null, I, foo, null, ["+start1+", "+end1+"], "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
10040 |
requestor.getResults()); |
10135 |
requestor.getResults()); |
10041 |
} |
10136 |
} |
10042 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
10137 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
Lines 10059-10065
Link Here
|
10059 |
" public static int foo(int i){}\n" + |
10154 |
" public static int foo(int i){}\n" + |
10060 |
"}"); |
10155 |
"}"); |
10061 |
|
10156 |
|
10062 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
10157 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true); |
|
|
10158 |
requestor.allowAllRequiredProposals(); |
10063 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"}); |
10159 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"}); |
10064 |
|
10160 |
|
10065 |
String str = this.workingCopies[0].getSource(); |
10161 |
String str = this.workingCopies[0].getSource(); |
Lines 10067-10075
Link Here
|
10067 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
10163 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
10068 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
10164 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
10069 |
|
10165 |
|
10070 |
assertResults( |
10166 |
int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED; |
10071 |
"foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, ()I, foo, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED) + "}\n" + |
10167 |
int start1 = str.lastIndexOf("foo") + "".length(); |
10072 |
"foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, (I)I, foo, (i), "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}", |
10168 |
int end1 = start1 + "foo".length(); |
|
|
10169 |
int start2 = str.lastIndexOf("public class"); |
10170 |
int end2 = start2 + "".length(); |
10171 |
assertResults( |
10172 |
"foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" + |
10173 |
" foo[METHOD_IMPORT]{import static test.p.ZZZ.foo;\n, Ltest.p.ZZZ;, ()I, foo, null, ["+start2+", "+end2+"], " + (relevance1) + "}\n"+ |
10174 |
"foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, (I)I, foo, (i), ["+start1+", "+end1+"], "+(relevance1)+"}\n" + |
10175 |
" foo[METHOD_IMPORT]{import static test.p.ZZZ.foo;\n, Ltest.p.ZZZ;, (I)I, foo, (i), ["+start2+", "+end2+"], " + (relevance1) + "}", |
10073 |
requestor.getResults()); |
10176 |
requestor.getResults()); |
10074 |
} |
10177 |
} |
10075 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
10178 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
Lines 10091-10097
Link Here
|
10091 |
" public static <T> int foo(){}\n" + |
10194 |
" public static <T> int foo(){}\n" + |
10092 |
"}"); |
10195 |
"}"); |
10093 |
|
10196 |
|
10094 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
10197 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true); |
|
|
10198 |
requestor.allowAllRequiredProposals(); |
10095 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"}); |
10199 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"}); |
10096 |
|
10200 |
|
10097 |
String str = this.workingCopies[0].getSource(); |
10201 |
String str = this.workingCopies[0].getSource(); |
Lines 10099-10106
Link Here
|
10099 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
10203 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
10100 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
10204 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
10101 |
|
10205 |
|
|
|
10206 |
int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED; |
10207 |
int start1 = str.lastIndexOf("foo") + "".length(); |
10208 |
int end1 = start1 + "foo".length(); |
10209 |
int start2 = str.lastIndexOf("public class"); |
10210 |
int end2 = start2 + "".length(); |
10102 |
assertResults( |
10211 |
assertResults( |
10103 |
"foo[METHOD_REF]{test.p.ZZZ.foo(), Ltest.p.ZZZ;, <T:Ljava.lang.Object;>()I, foo, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED)+"}", |
10212 |
"foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, <T:Ljava.lang.Object;>()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" + |
|
|
10213 |
" foo[METHOD_IMPORT]{import static test.p.ZZZ.foo;\n, Ltest.p.ZZZ;, <T:Ljava.lang.Object;>()I, foo, null, ["+start2+", "+end2+"], " + (relevance1) + "}", |
10104 |
requestor.getResults()); |
10214 |
requestor.getResults()); |
10105 |
} |
10215 |
} |
10106 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
10216 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
Lines 10122-10128
Link Here
|
10122 |
" public static int foo(){}\n" + |
10232 |
" public static int foo(){}\n" + |
10123 |
"}"); |
10233 |
"}"); |
10124 |
|
10234 |
|
10125 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
10235 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true); |
|
|
10236 |
requestor.allowAllRequiredProposals(); |
10126 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"}); |
10237 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"}); |
10127 |
|
10238 |
|
10128 |
String str = this.workingCopies[0].getSource(); |
10239 |
String str = this.workingCopies[0].getSource(); |
Lines 10134-10137
Link Here
|
10134 |
"", |
10245 |
"", |
10135 |
requestor.getResults()); |
10246 |
requestor.getResults()); |
10136 |
} |
10247 |
} |
|
|
10248 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
10249 |
public void testFavoriteImports023() throws JavaModelException { |
10250 |
this.workingCopies = new ICompilationUnit[2]; |
10251 |
this.workingCopies[0] = getWorkingCopy( |
10252 |
"/Completion/src3/test/Test.java", |
10253 |
"package test;\n" + |
10254 |
"/** */\n" + |
10255 |
"public class Test {\n" + |
10256 |
" public void method() {\n" + |
10257 |
" foo\n" + |
10258 |
" }\n" + |
10259 |
"}"); |
10260 |
|
10261 |
this.workingCopies[1] = getWorkingCopy( |
10262 |
"/Completion/src3/test/p/ZZZ.java", |
10263 |
"package test.p;\n" + |
10264 |
"public class ZZZ {\n" + |
10265 |
" public static int foo;\n" + |
10266 |
"}"); |
10267 |
|
10268 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true); |
10269 |
requestor.allowAllRequiredProposals(); |
10270 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
10271 |
|
10272 |
String str = this.workingCopies[0].getSource(); |
10273 |
String completeBehind = "foo"; |
10274 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
10275 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
10276 |
|
10277 |
int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED; |
10278 |
int start1 = str.lastIndexOf("foo") + "".length(); |
10279 |
int end1 = start1 + "foo".length(); |
10280 |
int start2 = str.lastIndexOf("/** */"); |
10281 |
int end2 = start2 + "".length(); |
10282 |
assertResults( |
10283 |
"foo[FIELD_REF]{foo, Ltest.p.ZZZ;, I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" + |
10284 |
" foo[FIELD_IMPORT]{import static test.p.ZZZ.foo;\n, Ltest.p.ZZZ;, I, foo, null, ["+start2+", "+end2+"], " + (relevance1) + "}", |
10285 |
requestor.getResults()); |
10286 |
} |
10287 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
10288 |
public void testFavoriteImports024() throws JavaModelException { |
10289 |
this.workingCopies = new ICompilationUnit[2]; |
10290 |
this.workingCopies[0] = getWorkingCopy( |
10291 |
"/Completion/src3/test/Test.java", |
10292 |
"package test;\n" + |
10293 |
"public class Test {\n" + |
10294 |
" public void method() {\n" + |
10295 |
" foo\n" + |
10296 |
" }\n" + |
10297 |
"}"); |
10298 |
|
10299 |
this.workingCopies[1] = getWorkingCopy( |
10300 |
"/Completion/src3/test/p/ZZZ.java", |
10301 |
"package test.p;\n" + |
10302 |
"public class ZZZ {\n" + |
10303 |
" public int foo;\n" + |
10304 |
"}"); |
10305 |
|
10306 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true); |
10307 |
requestor.allowAllRequiredProposals(); |
10308 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
10309 |
|
10310 |
String str = this.workingCopies[0].getSource(); |
10311 |
String completeBehind = "foo"; |
10312 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
10313 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
10314 |
|
10315 |
assertResults( |
10316 |
"", |
10317 |
requestor.getResults()); |
10318 |
} |
10319 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
10320 |
public void testFavoriteImports025() throws JavaModelException { |
10321 |
this.workingCopies = new ICompilationUnit[2]; |
10322 |
this.workingCopies[0] = getWorkingCopy( |
10323 |
"/Completion/src3/test/Test.java", |
10324 |
"package test;\n" + |
10325 |
"public class Test {\n" + |
10326 |
" public void method() {\n" + |
10327 |
" foo\n" + |
10328 |
" }\n" + |
10329 |
"}"); |
10330 |
|
10331 |
this.workingCopies[1] = getWorkingCopy( |
10332 |
"/Completion/src3/test/p/ZZZ.java", |
10333 |
"package test.p;\n" + |
10334 |
"public class ZZZ {\n" + |
10335 |
" public int foo;\n" + |
10336 |
"}"); |
10337 |
|
10338 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true); |
10339 |
requestor.allowAllRequiredProposals(); |
10340 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"}); |
10341 |
|
10342 |
String str = this.workingCopies[0].getSource(); |
10343 |
String completeBehind = "foo"; |
10344 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
10345 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
10346 |
|
10347 |
assertResults( |
10348 |
"", |
10349 |
requestor.getResults()); |
10350 |
} |
10351 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
10352 |
public void testFavoriteImports026() throws JavaModelException { |
10353 |
this.workingCopies = new ICompilationUnit[2]; |
10354 |
this.workingCopies[0] = getWorkingCopy( |
10355 |
"/Completion/src3/test/Test.java", |
10356 |
"package test;\n" + |
10357 |
"public class Test {\n" + |
10358 |
" public void method() {\n" + |
10359 |
" foo\n" + |
10360 |
" }\n" + |
10361 |
"}"); |
10362 |
|
10363 |
this.workingCopies[1] = getWorkingCopy( |
10364 |
"/Completion/src3/test/p/ZZZ.java", |
10365 |
"package test.p;\n" + |
10366 |
"public class ZZZ {\n" + |
10367 |
" public int foo(){return 0;};\n" + |
10368 |
"}"); |
10369 |
|
10370 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true); |
10371 |
requestor.allowAllRequiredProposals(); |
10372 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.*"}); |
10373 |
|
10374 |
String str = this.workingCopies[0].getSource(); |
10375 |
String completeBehind = "foo"; |
10376 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
10377 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
10378 |
|
10379 |
assertResults( |
10380 |
"", |
10381 |
requestor.getResults()); |
10382 |
} |
10383 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
10384 |
public void testFavoriteImports027() throws JavaModelException { |
10385 |
this.workingCopies = new ICompilationUnit[2]; |
10386 |
this.workingCopies[0] = getWorkingCopy( |
10387 |
"/Completion/src3/test/Test.java", |
10388 |
"package test;\n" + |
10389 |
"public class Test {\n" + |
10390 |
" public void method() {\n" + |
10391 |
" foo\n" + |
10392 |
" }\n" + |
10393 |
"}"); |
10394 |
|
10395 |
this.workingCopies[1] = getWorkingCopy( |
10396 |
"/Completion/src3/test/p/ZZZ.java", |
10397 |
"package test.p;\n" + |
10398 |
"public class ZZZ {\n" + |
10399 |
" public int foo(){return 0;};\n" + |
10400 |
"}"); |
10401 |
|
10402 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true); |
10403 |
requestor.allowAllRequiredProposals(); |
10404 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"}); |
10405 |
|
10406 |
String str = this.workingCopies[0].getSource(); |
10407 |
String completeBehind = "foo"; |
10408 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
10409 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
10410 |
|
10411 |
assertResults( |
10412 |
"", |
10413 |
requestor.getResults()); |
10414 |
} |
10415 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
10416 |
public void testFavoriteImports029() throws JavaModelException { |
10417 |
this.workingCopies = new ICompilationUnit[2]; |
10418 |
this.workingCopies[0] = getWorkingCopy( |
10419 |
"/Completion/src3/test/Test.java", |
10420 |
"package test;\n" + |
10421 |
"import test.p.ZZZ;\n" + |
10422 |
"public class Test {\n" + |
10423 |
" public void method() {\n" + |
10424 |
" foo\n" + |
10425 |
" }\n" + |
10426 |
"}"); |
10427 |
|
10428 |
this.workingCopies[1] = getWorkingCopy( |
10429 |
"/Completion/src3/test/p/ZZZ.java", |
10430 |
"package test.p;\n" + |
10431 |
"public class ZZZ {\n" + |
10432 |
" public static int foo(){return 0;};\n" + |
10433 |
"}"); |
10434 |
|
10435 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, true, false, true); |
10436 |
requestor.allowAllRequiredProposals(); |
10437 |
requestor.setFavoriteReferences(new String[]{"test.p.ZZZ.foo"}); |
10438 |
|
10439 |
String str = this.workingCopies[0].getSource(); |
10440 |
String completeBehind = "foo"; |
10441 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
10442 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
10443 |
|
10444 |
int relevance1 = R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME + R_NON_RESTRICTED; |
10445 |
int start1 = str.lastIndexOf("foo") + "".length(); |
10446 |
int end1 = start1 + "foo".length(); |
10447 |
int start2 = str.lastIndexOf("public class"); |
10448 |
int end2 = start2 + "".length(); |
10449 |
assertResults( |
10450 |
"foo[METHOD_REF]{foo(), Ltest.p.ZZZ;, ()I, foo, null, ["+start1+", "+end1+"], "+(relevance1)+"}\n" + |
10451 |
" foo[METHOD_IMPORT]{import static test.p.ZZZ.foo;\n, Ltest.p.ZZZ;, ()I, foo, null, ["+start2+", "+end2+"], " + (relevance1) + "}", |
10452 |
requestor.getResults()); |
10453 |
} |
10137 |
} |
10454 |
} |