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 22596 Details for
Bug 98711
no way to distinguish constructor from method proposals
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Proposed patch
patchjdtcore001.txt (text/plain), 4.36 KB, created by
David Audel
on 2005-06-08 06:18:57 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
David Audel
Created:
2005-06-08 06:18:57 EDT
Size:
4.36 KB
patch
obsolete
>Index: codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java,v >retrieving revision 1.245 >diff -u -r1.245 CompletionEngine.java >--- codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 2 Jun 2005 17:21:25 -0000 1.245 >+++ codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 8 Jun 2005 10:14:17 -0000 >@@ -1894,6 +1894,7 @@ > //proposal.setPackageName(null); > //proposal.setTypeName(null); > proposal.setName(name); >+ proposal.setIsContructor(true); > proposal.setCompletion(completion); > proposal.setFlags(constructor.modifiers); > proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >@@ -2001,6 +2002,7 @@ > //proposal.setPackageName(null); > //proposal.setTypeName(null); > proposal.setName(currentType.sourceName()); >+ proposal.setIsContructor(true); > proposal.setCompletion(completion); > proposal.setFlags(constructor.modifiers); > proposal.setReplaceRange(this.endPosition - this.offset, this.endPosition - this.offset); >Index: codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java,v >retrieving revision 1.4 >diff -u -r1.4 InternalCompletionProposal.java >--- codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java 22 Mar 2005 16:16:21 -0000 1.4 >+++ codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java 8 Jun 2005 10:14:17 -0000 >@@ -48,6 +48,8 @@ > > protected int accessibility = IAccessRule.K_ACCESSIBLE; > >+ protected boolean isConstructor = false; >+ > protected char[][] findMethodParameterNames(char[] signatureType, char[] selector, char[][] paramTypeNames){ > if(signatureType == null) return null; > >@@ -253,4 +255,8 @@ > protected void setAccessibility(int kind) { > this.accessibility = kind; > } >+ >+ protected void setIsContructor(boolean isConstructor) { >+ this.isConstructor = isConstructor; >+ } > } >Index: model/org/eclipse/jdt/core/CompletionProposal.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CompletionProposal.java,v >retrieving revision 1.24 >diff -u -r1.24 CompletionProposal.java >--- model/org/eclipse/jdt/core/CompletionProposal.java 26 Mar 2005 23:39:49 -0000 1.24 >+++ model/org/eclipse/jdt/core/CompletionProposal.java 8 Jun 2005 10:14:19 -0000 >@@ -928,8 +928,10 @@ > * <li><code>KEYWORD</code> - the keyword</li> > * <li><code>LABEL_REF</code> - the name of the label</li> > * <li><code>LOCAL_VARIABLE_REF</code> - the name of the local variable</li> >- * <li><code>METHOD_REF</code> - the name of the method</li> >- * <li><code>METHOD_DECLARATION</code> - the name of the method</li> >+ * <li><code>METHOD_REF</code> - the name of the method. >+ * If the method is a constructor then the type's simple name is returned.</li> >+ * <li><code>METHOD_DECLARATION</code> - the name of the method. >+ * If the method is a constructor then the type's simple name is returned.</li> > * <li><code>VARIABLE_DECLARATION</code> - the name of the variable</li> > * <li><code>POTENTIAL_METHOD_DECLARATION</code> - the name of the method</li> > * </ul> >@@ -1438,4 +1440,26 @@ > public int getAccessibility() { > return this.accessibility; > } >+ >+ /** >+ * Returns whether this proposal is a constructor. >+ * <p> >+ * This field is available for the following kinds of >+ * completion proposals: >+ * <ul> >+ * <li><code>METHOD_REF</code> - return <code>true</code> >+ * if the referenced method is a constructor</li> >+ * <li><code>METHOD_DECLARATION</code> - return <code>true</code> >+ * if the declared method is a constructor</li> >+ * </ul> >+ * For kinds of completion proposals, this method returns >+ * <code>false</code>. >+ * </p> >+ * >+ * @return return <code>true</code> if the proposal is a constructor. >+ * @since 3.1 >+ */ >+ public boolean isConstructor() { >+ return this.isConstructor; >+ } > }
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 Raw
Actions:
View
Attachments on
bug 98711
: 22596