Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 207631
Collapse All | Expand All

(-)codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java (-1 / +2 lines)
Lines 3293-3300 Link Here
3293
					case TokenNameRIGHT_SHIFT: // or fred<X<X>>[(]1, 2)
3293
					case TokenNameRIGHT_SHIFT: // or fred<X<X>>[(]1, 2)
3294
					case TokenNameUNSIGNED_RIGHT_SHIFT: //or Fred<X<X<X>>>[(]1, 2)
3294
					case TokenNameUNSIGNED_RIGHT_SHIFT: //or Fred<X<X<X>>>[(]1, 2)
3295
						if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_SELECTOR) {
3295
						if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_SELECTOR) {
3296
							int info;
3296
							if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER, 1) == K_BINARY_OPERATOR &&
3297
							if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER, 1) == K_BINARY_OPERATOR &&
3297
									topKnownElementInfo(COMPLETION_OR_ASSIST_PARSER, 1) == GREATER) {
3298
									((info = topKnownElementInfo(COMPLETION_OR_ASSIST_PARSER, 1)) == GREATER || info == RIGHT_SHIFT || info == UNSIGNED_RIGHT_SHIFT)) {
3298
								// it's not a selector invocation
3299
								// it's not a selector invocation
3299
								popElement(K_SELECTOR);
3300
								popElement(K_SELECTOR);
3300
							} else {
3301
							} else {
(-)src/org/eclipse/jdt/core/tests/compiler/parser/GenericsCompletionParserTest.java (+38 lines)
Lines 10986-10989 Link Here
10986
			expectedReplacedSource,
10986
			expectedReplacedSource,
10987
	"diet ast");
10987
	"diet ast");
10988
}
10988
}
10989
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=207631
10990
public void test0217_Method() {
10991
10992
	String str = 
10993
		"public class X {\n" +
10994
		"	void foo() {\n" +
10995
		"      int y = (x >> (1));\n" +
10996
		"      foo\n" +
10997
		"   }" +
10998
		"}\n"; 
10999
11000
	String completeBehind = "foo";
11001
	int cursorLocation = str.lastIndexOf("foo") + completeBehind.length() - 1;
11002
	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
11003
	String expectedParentNodeToString = "<NONE>";
11004
	String completionIdentifier = "foo";
11005
	String expectedReplacedSource = "foo";
11006
	// we are not in a constructor then the completion node isn't attached to the ast
11007
	String expectedUnitDisplayString =
11008
			"public class X {\n" + 
11009
			"  public X() {\n" + 
11010
			"  }\n" + 
11011
			"  void foo() {\n" + 
11012
			"    int y;\n" + 
11013
			"    <CompleteOnName:foo>;\n" + 
11014
			"  }\n" + 
11015
			"}\n";
11016
11017
	checkMethodParse(
11018
			str.toCharArray(),
11019
			cursorLocation,
11020
			expectedCompletionNodeToString,
11021
			expectedParentNodeToString,
11022
			expectedUnitDisplayString,
11023
			completionIdentifier,
11024
			expectedReplacedSource,
11025
			"full ast");
11026
}
10989
}
11027
}

Return to bug 207631