Community
Participate
Working Groups
... public void ¡Æ1$() { } public void aVeryLongMethodAndWithManyPrefixAlikeMethods() { } public void aMethod() { sigma1dollar<code completion> **for ¡Æ1$** or public void aMethod() { avlmawmpam<code completion> **for aVeryLongMethodAndWithManyPrefixAlikeMethods** When I use the completion proposals, It works well with english charachars, but with some charachar which need composition like Chinese and Japenese charachars as method names and variable names (for readability),It's very bothering to switch between input methods. So an input matcher plugin is needed. To give an example in English, let's say the method name is $ or ¡Æ(It won't work for ¡Æ, but just an example), then I can type "dollar" or "sigma" for completion(or even "d" for $ and "s" for ¡Æ), or for the aVeryLongMethodAndWithManyPrefixAlikeMethods method, I can type "avlmawmpam" for completion. And for Chinese method named "ÖÐÎÄ", I can type "zhongwen"(which presents the accent of the two characters) or "zw"(for short) for completion. It will affect "CompletionEngine.java" which is using CharOperation.prefixEquals and "JavaCompletionProposal.java" which is using startWith. Thanks.
How should the input matcher extension look like? How should it concretely work and who do you think should provide it?
I don't exactly know how the extension point works for I'm just a newbie to Eclipse, But I think Eclipse is just the thing I've been waiting for when I first saw it just a few days ago. To my knowledge, the only way to extend is to make plug ins. So I think it should provide a extension point which will ask for an interface which may include a method "public boolean isMatched(String word, String start)", and many plug ins can have its own result. the result will be the "or" result of all the plug-ins' answers.
Created attachment 2521 [details] org.eclipse.jdt.internal.codeassist.InputMatcher is responsable for managing the plugins which provide input matchers and combine the result.
Created attachment 2522 [details] org.eclipse.jdt.internal.codeassist.InputMatcherPlugin is the interface that input matchers must implement. InputMatcher class delegates the call to the plugins.
Created attachment 2523 [details] org.eclipse.jdt.internal.codeassist.CompletionEngine is using CharOperation.prefixEquals, Changed to InputMethod.prefixEquals all the CharOperation.prefixEquals in it are Changed to InputMethod.prefixEquals
Created attachment 2524 [details] org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposal.startWith is now using InputMatcher.prefixEquals
Created attachment 2525 [details] eclipse\plugins\org.eclipse.jdt.core_2.1.0\plugin.xml adds <extension-point id="inputMatcher" name="%inputMatcher"/> eclipse\plugins\org.eclipse.jdt.core_2.1.0\plugin.xml adds <extension-point id="inputMatcher" name="%inputMatcher"/>
Created attachment 2526 [details] sample plug in which allows type abbreviation of names. for "aVeryLongMethod", you can just type "avlm". new Object().<code completion> you can just type hc for "hashCode"
Created attachment 2547 [details] sample plug in which allows type abbreviation of names.
Created attachment 2548 [details] org.eclipse.jdt.internal.codeassist.InputMatcher is responsable for managing the plugins which provide input matchers and combine the result.
Created attachment 2549 [details] org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposal.startWith is now using InputMatcher.prefixEquals
Created attachment 2550 [details] with AbbreviationInputMatcher, you can type "avlm" for "aVeryLongMethod" Sorry.I can't edit the attachment's obsoletes property. So I upload it just to make the first InputMatcher obsoletes.
Created attachment 7277 [details] patch on org.eclipse.jdt.core project to provide input matcher extension point
Created attachment 7278 [details] patch on org.eclipse.jdt.ui project
Created attachment 7279 [details] sample plug in which allows type abbreviation of names. with this plug in, you can type "avlm" for "aVeryLongMethod"