diff options
3 files changed, 43 insertions, 2 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/GenericsCompletionParserTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/GenericsCompletionParserTest.java index 7fd424f957..73d8ee2496 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/GenericsCompletionParserTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/GenericsCompletionParserTest.java @@ -10986,4 +10986,42 @@ public void test0216_Diet() { 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 class X {\n" + + " public X() {\n" + + " }\n" + + " void foo() {\n" + + " int y;\n" + + " <CompleteOnName:foo>;\n" + + " }\n" + + "}\n"; + + checkMethodParse( + str.toCharArray(), + cursorLocation, + expectedCompletionNodeToString, + expectedParentNodeToString, + expectedUnitDisplayString, + completionIdentifier, + expectedReplacedSource, + "full ast"); +} } diff --git a/org.eclipse.jdt.core/buildnotes_jdt-core.html b/org.eclipse.jdt.core/buildnotes_jdt-core.html index f49db99c9e..e111103462 100644 --- a/org.eclipse.jdt.core/buildnotes_jdt-core.html +++ b/org.eclipse.jdt.core/buildnotes_jdt-core.html @@ -48,7 +48,9 @@ Eclipse SDK 3.4M7 - %date% - 3.4 MILESTONE 7 <h2>What's new in this drop</h2> <h3>Problem Reports Fixed</h3> -<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=226918">226918</a> +<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=207631">207631</a> +[Content Assist] Autocompletion fails after use of binary right-shift operators +<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=226918">226918</a> [jsr199] the standard java file manager returned by the Eclipse compiler does not accept non-modifiable iterators as remaining arg to JavaFileManager#handleOption <a name="v_853"></a> diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java index 3a6e404aff..595afca206 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java @@ -3293,8 +3293,9 @@ protected void consumeToken(int token) { 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 { |