Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 72595 Details for
Bug 150632
[assist] Content Assist and Parameter Hints sometimes don't work for constructor call
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
bug150632_003.txt (text/plain), 4.62 KB, created by
David Audel
on 2007-06-27 09:08:24 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
David Audel
Created:
2007-06-27 09:08:24 EDT
Size:
4.62 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest2.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest2.java,v >retrieving revision 1.43 >diff -u -r1.43 CompletionParserTest2.java >--- src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest2.java 28 Mar 2007 08:26:40 -0000 1.43 >+++ src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest2.java 27 Jun 2007 13:00:11 -0000 >@@ -11479,4 +11479,62 @@ > expectedReplacedSource, > "full ast"); > } >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=150632 >+public void test0172() { >+ >+ String str = >+ "abstract class MatchFilter {\n"+ >+ " private static final String SETTINGS_LAST_USED_FILTERS= \"filters_last_used\"; \n"+ >+ "\n"+ >+ " // works if next line is commented out or moved to after PUBLIC_FILTER\n"+ >+ " public abstract String getName();\n"+ >+ "\n"+ >+ " // content assist at new ModifierFilter(|):\n"+ >+ " private static final MatchFilter PUBLIC_FILTER= new ModifierFilter();\n"+ >+ "}\n"+ >+ "\n"+ >+ "class ModifierFilter extends MatchFilter {\n"+ >+ " private final String fName;\n"+ >+ " public ModifierFilter(String name) {\n"+ >+ " fName= name;\n"+ >+ " }\n"+ >+ " public String getName() {\n"+ >+ " return fName;\n"+ >+ " }\n"+ >+ "}\n"; >+ >+ String completeBehind = "new ModifierFilter("; >+ int cursorLocation = str.lastIndexOf("new ModifierFilter(") + completeBehind.length() - 1; >+ String expectedCompletionNodeToString = "<CompleteOnAllocationExpression:new ModifierFilter()>"; >+ String expectedParentNodeToString = "<NONE>"; >+ String completionIdentifier = ""; >+ String expectedReplacedSource = ""; >+ String expectedUnitDisplayString = >+ "abstract class MatchFilter {\n" + >+ " private static final String SETTINGS_LAST_USED_FILTERS;\n" + >+ " private static final MatchFilter PUBLIC_FILTER = <CompleteOnAllocationExpression:new ModifierFilter()>;\n" + >+ " MatchFilter() {\n" + >+ " }\n" + >+ " <clinit>() {\n" + >+ " }\n" + >+ " public abstract String getName();\n" + >+ "}\n" + >+ "class ModifierFilter extends MatchFilter {\n" + >+ " private final String fName;\n" + >+ " public ModifierFilter(String name) {\n" + >+ " }\n" + >+ " public String getName() {\n" + >+ " }\n" + >+ "}\n"; >+ >+ checkDietParse( >+ str.toCharArray(), >+ cursorLocation, >+ expectedCompletionNodeToString, >+ expectedParentNodeToString, >+ expectedUnitDisplayString, >+ completionIdentifier, >+ expectedReplacedSource, >+ "diet ast"); >+} > } >#P org.eclipse.jdt.core >Index: codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java,v >retrieving revision 1.178 >diff -u -r1.178 CompletionParser.java >--- codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java 26 Apr 2007 11:27:48 -0000 1.178 >+++ codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java 27 Jun 2007 13:00:17 -0000 >@@ -2723,6 +2723,12 @@ > super.consumeMethodHeader(); > pushOnElementStack(K_BLOCK_DELIMITER); > } >+protected void consumeMethodDeclaration(boolean isNotAbstract) { >+ if (!isNotAbstract) { >+ popElement(K_BLOCK_DELIMITER); >+ } >+ super.consumeMethodDeclaration(isNotAbstract); >+} > protected void consumeModifiers() { > super.consumeModifiers(); > // save from stack values >Index: codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java,v >retrieving revision 1.79 >diff -u -r1.79 AssistParser.java >--- codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java 25 Apr 2007 16:59:24 -0000 1.79 >+++ codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java 27 Jun 2007 13:00:18 -0000 >@@ -352,6 +352,12 @@ > super.consumeMethodBody(); > popElement(K_METHOD_DELIMITER); > } >+protected void consumeMethodDeclaration(boolean isNotAbstract) { >+ if (!isNotAbstract) { >+ popElement(K_METHOD_DELIMITER); >+ } >+ super.consumeMethodDeclaration(isNotAbstract); >+} > protected void consumeMethodHeader() { > super.consumeMethodHeader(); > pushOnElementStack(K_METHOD_DELIMITER);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 150632
: 72595