Community
Participate
Working Groups
case TokenNameRIGHT_SHIFT: // or fred<X<X>>[(]1, 2)
case TokenNameUNSIGNED_RIGHT_SHIFT: //or Fred<X<X<X>>>[(]1, 2)
if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_SELECTOR) {
int info;
if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER, 1) == K_BINARY_OPERATOR &&
topKnownElementInfo(COMPLETION_OR_ASSIST_PARSER, 1) == GREATER) {
((info = topKnownElementInfo(COMPLETION_OR_ASSIST_PARSER, 1)) == GREATER || info == RIGHT_SHIFT || info == UNSIGNED_RIGHT_SHIFT)) {
// it's not a selector invocation
popElement(K_SELECTOR);
} else {
expectedReplacedSource,
"diet ast");
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=207631
public void test0217_Method() {
String str =
"public class X {\n" +
" void foo() {\n" +
" int y = (x >> (1));\n" +
" foo\n" +
" }" +
"}\n";
String completeBehind = "foo";
int cursorLocation = str.lastIndexOf("foo") + completeBehind.length() - 1;
String expectedCompletionNodeToString = "<CompleteOnName:foo>";
String expectedParentNodeToString = "<NONE>";
String completionIdentifier = "foo";
String expectedReplacedSource = "foo";
// we are not in a constructor then the completion node isn't attached to the ast
String expectedUnitDisplayString =
" public X() {\n" +
" }\n" +
" int y;\n" +
" <CompleteOnName:foo>;\n" +
checkMethodParse(
str.toCharArray(),
cursorLocation,
expectedCompletionNodeToString,
expectedParentNodeToString,
expectedUnitDisplayString,
completionIdentifier,
"full ast");