Hi,
Let me introduce myself to the list:
I am an eclipse enthusiast and hacker.
I maintain a few open source projects , including a new Eclipse distro,
called EasyEclipse.
First I would like to mention that we ship RDT in EasyEclipse (and
RadRails too ) and I think you guys all did a fantastic job! :-)
I hope you guys are fine with that.
The EasyEclipse project is still in early beta, and you can check the
pages at:
http://easyeclipse.org/site/plugins/rubyeclipse.html
And there is also a full distro that contains RDT, Radrails and more:
http://easyeclipse.org/site/distributions/lamp.html
Feedback and critique is welcomed!
Now I like also to help when possible, and submit patches and
enhancements suggestions on occasion, which leads me to this email....
I wrote a small patch (see attached just for reference) to address the
issue in bug:
http://sourceforge.net/tracker/index.php?func=detail&aid=1477353&group_i
d=50233&atid=459015
While I was at it, I did add a tiny provisional change to support
autoinsert of single content assist proposals...based on a chat on IRC.
Last night, I was readying that patch to submit here, I saw that RDT
0.8.0 was released in GA.
So I though that was cool, because my patch was based on CVS HEAD.
But I was bitten badly by Sf.net.
My patch was completely out of sync with the sources in the release
drop, applying to classes that were worked on and refactored since :-\
Sf.net anonymous pserver seems completely out of sync with HEAD, which
can only be accessed by ssh, and requires you to be a committer.
So here is the patch anyway, and it is worth nothing, and it is
completely stale.
For instance you guys had already added the auto insert capabilities and
refactored the prefs significantly.
So if I could get committer access that would be great.
So that I can submit patches to the list for review without those
annoyances.
You do not know me, so I can promise that I will not commit any code
until you tell me it is OK, but just submit patches here until you think
I am cool to make real commits.
Getting commit rights would allow me to get the *real* CVS HEAD through
ssh and avoid that pitiful adventure!
And resubmit a proposed patch with the proper HEAD references.
Cordially
Keep on rocking
--
Cheers
Philippe
philippe ombredanne | 1 650 799 0949 | pombredanne at nexb.com
nexB - Open by Design (tm) - http://www.nexb.com
http://EasyEclipse.org - [EMAIL PROTECTED]
Index: src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.java
===================================================================
RCS file:
/cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.java,v
retrieving revision 1.4
diff -u -r1.4 PreferencesMessages.java
--- src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.java
30 Mar 2006 02:56:45 -0000 1.4
+++ src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.java
27 Apr 2006 03:03:36 -0000
@@ -52,6 +52,7 @@
public static String TodoTaskInputDialog_error_enterName;
public static String RubyEditorPreferencePage_link_tooltip;
public static String RubyEditorPreferencePage_link;
+ public static String
RubyEditorPreferencePage_insertSingleProposalsAutomatically;
public static String RiPreferencePage_ripath_label;
public static String RiPreferencePage_rdocpath_label;
public static String TodoTaskConfigurationBlock_tasks_default;
Index:
src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.properties
===================================================================
RCS file:
/cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.properties,v
retrieving revision 1.7
diff -u -r1.7 PreferencesMessages.properties
---
src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.properties
30 Mar 2006 02:56:45 -0000 1.7
+++
src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.properties
27 Apr 2006 03:03:36 -0000
@@ -12,6 +12,8 @@
RubyEditorPreferencePage_link=General text editor preferences can be set on
the <a>Text Editors</a> page.
RubyEditorPreferencePage_link_tooltip=Show the shared text editor preferences
+RubyEditorPreferencePage_insertSingleProposalsAutomatically=Insert single code
assist &proposals automatically
+
CodeFormatterPreferencePage_title=Code Formatter
CodeFormatterPreferencePage_description=Sele&ct a profile:
Index:
src/org/rubypeople/rdt/internal/ui/preferences/TextEditorPreferencePage2.java
===================================================================
RCS file:
/cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/TextEditorPreferencePage2.java,v
retrieving revision 1.23
diff -u -r1.23 TextEditorPreferencePage2.java
---
src/org/rubypeople/rdt/internal/ui/preferences/TextEditorPreferencePage2.java
10 Feb 2006 19:52:26 -0000 1.23
+++
src/org/rubypeople/rdt/internal/ui/preferences/TextEditorPreferencePage2.java
27 Apr 2006 03:03:37 -0000
@@ -103,6 +104,8 @@
overlayKeys.add(new
OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.INT,
PreferenceConstants.FORMAT_INDENTATION));
overlayKeys.add(new
OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,
PreferenceConstants.FORMAT_USE_TAB));
+ overlayKeys.add(new
OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,
+
PreferenceConstants.EDITOR_CODEASSIST_INSERT_SINGLE_PROPOSAL_AUTOMATICALLY));
OverlayPreferenceStore.OverlayKey[] keys = new
OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
overlayKeys.toArray(keys);
@@ -138,11 +141,16 @@
PreferencesUtil.createPreferenceDialogOn(shell,
"org.eclipse.ui.preferencePages.GeneralTextEditor", null, null); //$NON-NLS-1$
}
});
-
link.setToolTipText(PreferencesMessages.RubyEditorPreferencePage_link_tooltip);
+
link.setToolTipText(PreferencesMessages.RubyEditorPreferencePage_link_tooltip);
+
+ addCheckBox(appearanceComposite,
+
PreferencesMessages.RubyEditorPreferencePage_insertSingleProposalsAutomatically,
+
PreferenceConstants.EDITOR_CODEASSIST_INSERT_SINGLE_PROPOSAL_AUTOMATICALLY,0);
return appearanceComposite;
}
+
private Control createCodeFormatterPage(Composite parent) {
Composite codeFormatterComposite = new Composite(parent,
SWT.NONE);
Index: src/org/rubypeople/rdt/internal/ui/text/RubyContentAssistPreference.java
===================================================================
RCS file:
/cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/RubyContentAssistPreference.java,v
retrieving revision 1.1
diff -u -r1.1 RubyContentAssistPreference.java
--- src/org/rubypeople/rdt/internal/ui/text/RubyContentAssistPreference.java
20 Jul 2002 03:16:57 -0000 1.1
+++ src/org/rubypeople/rdt/internal/ui/text/RubyContentAssistPreference.java
27 Apr 2006 03:03:37 -0000
@@ -2,6 +2,7 @@
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.text.contentassist.ContentAssistant;
+import org.rubypeople.rdt.ui.PreferenceConstants;
public class RubyContentAssistPreference {
protected static ContentAssistant contentAssistant;
@@ -10,8 +11,9 @@
public static void configure(ContentAssistant aContentAssistant,
IPreferenceStore aPreferenceStore) {
contentAssistant = aContentAssistant;
preferenceStore = aPreferenceStore;
-
+
contentAssistant.enableAutoActivation(true);
contentAssistant.setAutoActivationDelay(500);
+
contentAssistant.enableAutoInsert(preferenceStore.getBoolean(PreferenceConstants.EDITOR_CODEASSIST_INSERT_SINGLE_PROPOSAL_AUTOMATICALLY));
}
}
Index: src/org/rubypeople/rdt/internal/ui/text/ruby/RubyCompletionProcessor.java
===================================================================
RCS file:
/cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyCompletionProcessor.java,v
retrieving revision 1.18
diff -u -r1.18 RubyCompletionProcessor.java
--- src/org/rubypeople/rdt/internal/ui/text/ruby/RubyCompletionProcessor.java
24 Feb 2006 02:02:20 -0000 1.18
+++ src/org/rubypeople/rdt/internal/ui/text/ruby/RubyCompletionProcessor.java
27 Apr 2006 03:03:37 -0000
@@ -247,15 +247,12 @@
IRubyCompletionProposal[] keyWordResults =
getKeywordProposals(documentOffset);
if (keyWordResults.length > 0) {
- List removals = new ArrayList();
-
// update relevance of template proposals that
match with a
// keyword
// give those templates slightly more relevance
than the keyword
// to
// sort them first
- // remove keyword templates that don't have an
equivalent
- // keyword proposal
+ //pombredanne: removed the keyword removal
which is more a pain than a feature.
if (keyWordResults.length > 0) {
outer: for (int k = 0; k <
templateProposals.length; k++) {
TemplateProposal curr =
templateProposals[k];
@@ -269,12 +266,8 @@
continue outer;
}
}
- if (isKeyword(name))
- removals.add(curr);
}
}
-
- result.removeAll(removals);
}
return result;
}
Index: src/org/rubypeople/rdt/ui/PreferenceConstants.java
===================================================================
RCS file:
/cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/PreferenceConstants.java,v
retrieving revision 1.14
diff -u -r1.14 PreferenceConstants.java
--- src/org/rubypeople/rdt/ui/PreferenceConstants.java 30 Mar 2006 03:05:01
-0000 1.14
+++ src/org/rubypeople/rdt/ui/PreferenceConstants.java 27 Apr 2006 03:03:38
-0000
@@ -148,12 +148,22 @@
* <p>
* Value is of type <code>Boolean</code>.
* </p>
- *
+ *
* @since 0.8.0
*/
public final static String EDITOR_SYNC_OUTLINE_ON_CURSOR_MOVE =
"RubyEditor.SyncOutlineOnCursorMove"; //$NON-NLS-1$
/**
+ * A named preference that controls if a single proposal is
automatically
+ * inserted when invoking code assist
+ * <p>
+ * Value is of type <code>Boolean</code>.
+ * </p>
+ * @since 0.8.0
+ */
+ public static final String
EDITOR_CODEASSIST_INSERT_SINGLE_PROPOSAL_AUTOMATICALLY=
"org.rubypeople.rdt.ui.editor.insertsingleproposalauto"; //$NON-NLS-1$
+
+ /**
* A named preference that defines how member elements are ordered by the
* Ruby views using the <code>RubyElementSorter</code>.
* <p>