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 27049 Details for
Bug 49552
[content assist] Code Assist doesn't always complete on symbols
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Complete on symbols R3_1
org.eclipse.jdt.ui.patch (text/plain), 5.00 KB, created by
snowl
on 2005-09-12 16:41:59 EDT
(
hide
)
Description:
Complete on symbols R3_1
Filename:
MIME Type:
Creator:
snowl
Created:
2005-09-12 16:41:59 EDT
Size:
5.00 KB
patch
obsolete
>Index: ui/org/eclipse/jdt/internal/ui/text/java/JavaMethodCompletionProposal.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaMethodCompletionProposal.java,v >retrieving revision 1.11 >diff -u -r1.11 JavaMethodCompletionProposal.java >--- ui/org/eclipse/jdt/internal/ui/text/java/JavaMethodCompletionProposal.java 26 May 2005 12:32:41 -0000 1.11 >+++ ui/org/eclipse/jdt/internal/ui/text/java/JavaMethodCompletionProposal.java 12 Sep 2005 20:30:37 -0000 >@@ -40,7 +40,7 @@ > > public class JavaMethodCompletionProposal extends LazyJavaCompletionProposal { > /** Triggers for method proposals without parameters. Do not modify. */ >- protected final static char[] METHOD_TRIGGERS= new char[] { ';', ',', '.', '\t', '[', ' ' }; >+ protected final static char[] METHOD_TRIGGERS= new char[] { ';', ',', '.', '\t', '[', ' ', '(', '+', '-', '/', '*', '<', '>', '&', '|', '^', '?', ':', '^', '%', ']' }; > /** Triggers for method proposals. Do not modify. */ > protected final static char[] METHOD_WITH_ARGUMENTS_TRIGGERS= new char[] { '(', '-', ' ' }; > >@@ -99,6 +99,18 @@ > } > > public void apply(IDocument document, char trigger, int offset) { >+ >+ String replacement= getReplacementString(); >+ if (replacement != null && replacement.endsWith("()") && trigger == '(') { //$NON-NLS-1$ >+ setCursorPosition(replacement.length() - 1); >+ >+ // Strip off the closing brackets if the user doesn't want them auto-closed. >+ IPreferenceStore preferenceStore= JavaPlugin.getDefault().getPreferenceStore(); >+ if (!preferenceStore.getBoolean(PreferenceConstants.EDITOR_CLOSE_BRACKETS)) { >+ setReplacementString(replacement.substring(0, replacement.length() - 1)); >+ } >+ } >+ > super.apply(document, trigger, offset); > try { > setUpLinkedMode(document, getReplacementString()); >Index: ui/org/eclipse/jdt/ui/text/java/CompletionProposalCollector.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/java/CompletionProposalCollector.java,v >retrieving revision 1.13 >diff -u -r1.13 CompletionProposalCollector.java >--- ui/org/eclipse/jdt/ui/text/java/CompletionProposalCollector.java 2 May 2005 12:54:28 -0000 1.13 >+++ ui/org/eclipse/jdt/ui/text/java/CompletionProposalCollector.java 12 Sep 2005 20:30:39 -0000 >@@ -89,13 +89,15 @@ > private static final boolean DEBUG= "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jdt.ui/debug/ResultCollector")); //$NON-NLS-1$//$NON-NLS-2$ > > /** Triggers for method proposals without parameters. Do not modify. */ >- protected final static char[] METHOD_TRIGGERS= new char[] { ';', ',', '.', '\t', '[', ' ' }; >+ protected final static char[] METHOD_TRIGGERS= new char[] { ';', ',', '.', '\t', '[', ' ', '(', '+', '-', '/', '*', '<', '>', '&', '|', '^', '?', ':', '^', '%', ']' }; > /** Triggers for method proposals. Do not modify. */ > protected final static char[] METHOD_WITH_ARGUMENTS_TRIGGERS= new char[] { '(', '-', ' ' }; > /** Triggers for types. Do not modify. */ > protected final static char[] TYPE_TRIGGERS= new char[] { '.', '\t', '[', '(', ' ' }; > /** Triggers for variables. Do not modify. */ >- protected final static char[] VAR_TRIGGER= new char[] { '\t', ' ', '=', ';', '.' }; >+ protected final static char[] VAR_TRIGGERS= new char[] { '\t', ' ', '=', ';', '.', '+', '-', '/', '*', '<', '>', '&', '|', '^', '~', '?', ':', '%', ')', '}', ']', ',' }; >+ /** Triggers for keywords. */ >+ protected final static char[] KEYWORD_TRIGGERS= new char[] { '\t', ' ', '=', ';', '.', '&', '|', '?', ':', '(', ')', '{', '}', ']', ',', '^' }; > > private final CompletionProposalLabelProvider fLabelProvider= new CompletionProposalLabelProvider(); > private final ImageDescriptorRegistry fRegistry= JavaPlugin.getImageDescriptorRegistry(); >@@ -588,7 +590,7 @@ > if (fJavaProject != null) > javaProposal.setProposalInfo(new FieldProposalInfo(fJavaProject, proposal)); > >- javaProposal.setTriggerCharacters(VAR_TRIGGER); >+ javaProposal.setTriggerCharacters(VAR_TRIGGERS); > > return javaProposal; > } >@@ -599,7 +601,9 @@ > int length= getLength(proposal); > String label= fLabelProvider.createSimpleLabel(proposal); > int relevance= computeRelevance(proposal); >- return new JavaCompletionProposal(completion, start, length, null, label, relevance); >+ JavaCompletionProposal javaProposal= new JavaCompletionProposal(completion, start, length, null, label, relevance); >+ javaProposal.setTriggerCharacters(KEYWORD_TRIGGERS); >+ return javaProposal; > } > > private IJavaCompletionProposal createLabelProposal(CompletionProposal proposal) { >@@ -621,7 +625,7 @@ > int relevance= computeRelevance(proposal); > > final JavaCompletionProposal javaProposal= new JavaCompletionProposal(completion, start, length, image, label, relevance); >- javaProposal.setTriggerCharacters(VAR_TRIGGER); >+ javaProposal.setTriggerCharacters(VAR_TRIGGERS); > return javaProposal; > } >
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 49552
:
27049
|
27078
|
27232