You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
(41) |
Apr
(9) |
May
|
Jun
|
Jul
(39) |
Aug
(38) |
Sep
(135) |
Oct
(220) |
Nov
(75) |
Dec
(74) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(44) |
Feb
(160) |
Mar
(49) |
Apr
(69) |
May
(40) |
Jun
(52) |
Jul
(47) |
Aug
(51) |
Sep
(19) |
Oct
(22) |
Nov
(36) |
Dec
(76) |
| 2007 |
Jan
(154) |
Feb
(165) |
Mar
(186) |
Apr
(143) |
May
(175) |
Jun
(133) |
Jul
(203) |
Aug
(177) |
Sep
(136) |
Oct
|
Nov
|
Dec
|
|
From: Christopher W. <caw...@us...> - 2006-02-10 19:50:29
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/text In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9146/src/org/rubypeople/rdt/ui/text Added Files: RubySourceViewerConfiguration.java Log Message: move to externally visible package --- NEW FILE: RubySourceViewerConfiguration.java --- package org.rubypeople.rdt.ui.text; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.text.DefaultInformationControl; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.IInformationControl; import org.eclipse.jface.text.IInformationControlCreator; import org.eclipse.jface.text.ITextDoubleClickStrategy; import org.eclipse.jface.text.ITextHover; import org.eclipse.jface.text.contentassist.ContentAssistant; import org.eclipse.jface.text.contentassist.IContentAssistant; import org.eclipse.jface.text.formatter.IContentFormatter; import org.eclipse.jface.text.formatter.MultiPassContentFormatter; import org.eclipse.jface.text.presentation.IPresentationReconciler; import org.eclipse.jface.text.presentation.PresentationReconciler; import org.eclipse.jface.text.reconciler.IReconciler; import org.eclipse.jface.text.rules.DefaultDamagerRepairer; import org.eclipse.jface.text.rules.ITokenScanner; import org.eclipse.jface.text.source.IAnnotationHover; import org.eclipse.jface.text.source.ISourceViewer; import org.eclipse.jface.util.Assert; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.editors.text.EditorsUI; import org.eclipse.ui.editors.text.TextSourceViewerConfiguration; import org.eclipse.ui.texteditor.ChainedPreferenceStore; import org.eclipse.ui.texteditor.ITextEditor; import org.rubypeople.rdt.internal.ui.RubyPlugin; import org.rubypeople.rdt.internal.ui.rubyeditor.RubyAbstractEditor; import org.rubypeople.rdt.internal.ui.rubyeditor.RubyEditor; import org.rubypeople.rdt.internal.ui.rubyeditor.RubySourceViewer; import org.rubypeople.rdt.internal.ui.text.HTMLTextPresenter; import org.rubypeople.rdt.internal.ui.text.IRubyColorConstants; import org.rubypeople.rdt.internal.ui.text.IRubyPartitions; import org.rubypeople.rdt.internal.ui.text.PreferencesAdapter; import org.rubypeople.rdt.internal.ui.text.RubyAnnotationHover; import org.rubypeople.rdt.internal.ui.text.RubyCommentScanner; import org.rubypeople.rdt.internal.ui.text.RubyContentAssistPreference; import org.rubypeople.rdt.internal.ui.text.RubyDoubleClickSelector; import org.rubypeople.rdt.internal.ui.text.RubyPartitionScanner; import org.rubypeople.rdt.internal.ui.text.RubyReconciler; import org.rubypeople.rdt.internal.ui.text.RubyTextTools; import org.rubypeople.rdt.internal.ui.text.comment.CommentFormattingStrategy; import org.rubypeople.rdt.internal.ui.text.ruby.AbstractRubyScanner; import org.rubypeople.rdt.internal.ui.text.ruby.RubyCodeScanner; import org.rubypeople.rdt.internal.ui.text.ruby.RubyCompletionProcessor; import org.rubypeople.rdt.internal.ui.text.ruby.RubyFormattingStrategy; import org.rubypeople.rdt.internal.ui.text.ruby.RubyReconcilingStrategy; import org.rubypeople.rdt.internal.ui.text.ruby.SingleTokenRubyCodeScanner; import org.rubypeople.rdt.internal.ui.text.ruby.hover.RubyCodeTextHover; public class RubySourceViewerConfiguration extends TextSourceViewerConfiguration { protected RubyTextTools textTools; protected ITextEditor fTextEditor; private RubyCodeTextHover fRubyTextHover; /** * The document partitioning. * * @since 0.8.0 */ private String fDocumentPartitioning; /** * The color manager. * * @since 0.8.0 */ private IColorManager fColorManager; protected AbstractRubyScanner fCodeScanner; protected AbstractRubyScanner fMultilineCommentScanner, fSinglelineCommentScanner, fStringScanner; private SingleTokenRubyCodeScanner fRegexpScanner; private SingleTokenRubyCodeScanner fCommandScanner; private RubyDoubleClickSelector fRubyDoubleClickSelector; /** * Creates a new Ruby source viewer configuration for viewers in the given * editor using the given preference store, the color manager and the * specified document partitioning. * <p> * Creates a Ruby source viewer configuration in the new setup without text * tools. Clients are allowed to call * {@link RubySourceViewerConfiguration#handlePropertyChangeEvent(PropertyChangeEvent)} * and disallowed to call * {@link RubySourceViewerConfiguration#getPreferenceStore()} on the * resulting Ruby source viewer configuration. * </p> * * @param colorManager * the color manager * @param preferenceStore * the preference store, can be read-only * @param editor * the editor in which the configured viewer(s) will reside, or * <code>null</code> if none * @param partitioning * the document partitioning for this configuration, or * <code>null</code> for the default partitioning * @since 3.0 */ public RubySourceViewerConfiguration(IColorManager colorManager, IPreferenceStore preferenceStore, ITextEditor editor, String partitioning) { super(preferenceStore); fColorManager = colorManager; fTextEditor = editor; fDocumentPartitioning = partitioning; initializeScanners(); } /** * Creates a new Ruby source viewer configuration for viewers in the given * editor using the given Ruby tools. * * @param tools * the Ruby text tools to be used * @param editor * the editor in which the configured viewer(s) will reside, or * <code>null</code> if none * @see RubyTextTools * @deprecated As of 0.8.0, replaced by * {@link RubySourceViewerConfiguration#JavaSourceViewerConfiguration(IColorManager, IPreferenceStore, ITextEditor, String)} */ public RubySourceViewerConfiguration(RubyTextTools tools, RubyAbstractEditor editor) { super(createPreferenceStore(tools)); textTools = tools; fColorManager = tools.getColorManager(); fCodeScanner = (AbstractRubyScanner) textTools.getCodeScanner(); fMultilineCommentScanner = (AbstractRubyScanner) textTools.getMultilineCommentScanner(); fSinglelineCommentScanner = (AbstractRubyScanner) textTools.getSinglelineCommentScanner(); fStringScanner = (AbstractRubyScanner) textTools.getStringScanner(); fRegexpScanner = (SingleTokenRubyCodeScanner) textTools.getRegexpScanner(); fCommandScanner = (SingleTokenRubyCodeScanner) textTools.getCommandScanner(); fTextEditor = editor; } /* * @see SourceViewerConfiguration#getContentFormatter(ISourceViewer) */ public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) { final MultiPassContentFormatter formatter= new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), IDocument.DEFAULT_CONTENT_TYPE); formatter.setMasterStrategy(new RubyFormattingStrategy()); formatter.setSlaveStrategy(new CommentFormattingStrategy(), IRubyPartitions.RUBY_DOC); formatter.setSlaveStrategy(new CommentFormattingStrategy(), IRubyPartitions.RUBY_SINGLE_LINE_COMMENT); formatter.setSlaveStrategy(new CommentFormattingStrategy(), IRubyPartitions.RUBY_MULTI_LINE_COMMENT); return formatter; } /** * Determines whether the preference change encoded by the given event * changes the behavior of one of its contained components. * * @param event * the event to be investigated * @return <code>true</code> if event causes a behavioral change * @since 0.8.0 */ public boolean affectsTextPresentation(PropertyChangeEvent event) { return fCodeScanner.affectsBehavior(event) || fMultilineCommentScanner.affectsBehavior(event) || fSinglelineCommentScanner.affectsBehavior(event) || fStringScanner.affectsBehavior(event) || fRegexpScanner.affectsBehavior(event) || fCommandScanner.affectsBehavior(event); } /** * Adapts the behavior of the contained components to the change * encoded in the given event. * <p> * Clients are not allowed to call this method if the old setup with * text tools is in use. * </p> * * @param event the event to which to adapt * @see RubySourceViewerConfiguration#RubySourceViewerConfiguration(IColorManager, IPreferenceStore, ITextEditor, String) * @since 0.8.0 */ public void handlePropertyChangeEvent(PropertyChangeEvent event) { Assert.isTrue(isNewSetup()); if (fCodeScanner.affectsBehavior(event)) fCodeScanner.adaptToPreferenceChange(event); if (fMultilineCommentScanner.affectsBehavior(event)) fMultilineCommentScanner.adaptToPreferenceChange(event); if (fSinglelineCommentScanner.affectsBehavior(event)) fSinglelineCommentScanner.adaptToPreferenceChange(event); if (fStringScanner.affectsBehavior(event)) fStringScanner.adaptToPreferenceChange(event); if (fRegexpScanner.affectsBehavior(event)) fRegexpScanner.adaptToPreferenceChange(event); if (fCommandScanner.affectsBehavior(event)) fCommandScanner.adaptToPreferenceChange(event); } /** * Creates and returns a preference store which combines the preference * stores from the text tools and which is read-only. * * @param rubyTextTools * the Ruby text tools * @return the combined read-only preference store * @since 0.8.0 */ private static final IPreferenceStore createPreferenceStore(RubyTextTools rubyTextTools) { Assert.isNotNull(rubyTextTools); IPreferenceStore generalTextStore = EditorsUI.getPreferenceStore(); if (rubyTextTools.getCorePreferenceStore() == null) return new ChainedPreferenceStore(new IPreferenceStore[] { rubyTextTools.getPreferenceStore(), generalTextStore}); return new ChainedPreferenceStore(new IPreferenceStore[] { rubyTextTools.getPreferenceStore(), new PreferencesAdapter(rubyTextTools.getCorePreferenceStore()), generalTextStore}); } /** * Initializes the scanners. * * @since 3.0 */ private void initializeScanners() { Assert.isTrue(isNewSetup()); fCodeScanner = new RubyCodeScanner(getColorManager(), fPreferenceStore); fMultilineCommentScanner = new RubyCommentScanner(getColorManager(), fPreferenceStore, IRubyColorConstants.RUBY_MULTI_LINE_COMMENT); fSinglelineCommentScanner = new RubyCommentScanner(getColorManager(), fPreferenceStore, IRubyColorConstants.RUBY_SINGLE_LINE_COMMENT); fStringScanner = new SingleTokenRubyCodeScanner(getColorManager(), fPreferenceStore, IRubyColorConstants.RUBY_STRING); fRegexpScanner = new SingleTokenRubyCodeScanner(getColorManager(), fPreferenceStore, IRubyColorConstants.RUBY_REGEXP); fCommandScanner = new SingleTokenRubyCodeScanner(getColorManager(), fPreferenceStore, IRubyColorConstants.RUBY_COMMAND); } /** * @return <code>true</code> iff the new setup without text tools is in * use. * * @since 3.0 */ private boolean isNewSetup() { return textTools == null; } /** * Returns the color manager for this configuration. * * @return the color manager */ protected IColorManager getColorManager() { return fColorManager; } public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) { PresentationReconciler reconciler = new PresentationReconciler(); reconciler.setDocumentPartitioning(IRubyPartitions.RUBY_PARTITIONING); DefaultDamagerRepairer dr = new DefaultDamagerRepairer(getCodeScanner()); reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE); reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE); dr = new DefaultDamagerRepairer(getSinglelineCommentScanner()); reconciler.setDamager(dr, RubyPartitionScanner.RUBY_SINGLE_LINE_COMMENT); reconciler.setRepairer(dr, RubyPartitionScanner.RUBY_SINGLE_LINE_COMMENT); dr = new DefaultDamagerRepairer(getMultilineCommentScanner()); reconciler.setDamager(dr, RubyPartitionScanner.RUBY_MULTI_LINE_COMMENT); reconciler.setRepairer(dr, RubyPartitionScanner.RUBY_MULTI_LINE_COMMENT); dr = new DefaultDamagerRepairer(getStringScanner()); reconciler.setDamager(dr, RubyPartitionScanner.RUBY_STRING); reconciler.setRepairer(dr, RubyPartitionScanner.RUBY_STRING); dr = new DefaultDamagerRepairer(getRegexpScanner()); reconciler.setDamager(dr, RubyPartitionScanner.RUBY_REGULAR_EXPRESSION); reconciler.setRepairer(dr, RubyPartitionScanner.RUBY_REGULAR_EXPRESSION); dr = new DefaultDamagerRepairer(getCommandScanner()); reconciler.setDamager(dr, RubyPartitionScanner.RUBY_COMMAND); reconciler.setRepairer(dr, RubyPartitionScanner.RUBY_COMMAND); return reconciler; } private ITokenScanner getCommandScanner() { return fCommandScanner; } protected ITokenScanner getCodeScanner() { return fCodeScanner; } protected ITokenScanner getMultilineCommentScanner() { return fMultilineCommentScanner; } protected ITokenScanner getSinglelineCommentScanner() { return fSinglelineCommentScanner; } protected ITokenScanner getStringScanner() { return fStringScanner; } protected ITokenScanner getRegexpScanner() { return fRegexpScanner; } public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) { return new String[] { IDocument.DEFAULT_CONTENT_TYPE, RubyPartitionScanner.RUBY_MULTI_LINE_COMMENT, RubyPartitionScanner.RUBY_STRING, RubyPartitionScanner.RUBY_SINGLE_LINE_COMMENT}; } /* * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getConfiguredDocumentPartitioning(org.eclipse.jface.text.source.ISourceViewer) * @since 0.8.0 */ public String getConfiguredDocumentPartitioning(ISourceViewer sourceViewer) { if (fDocumentPartitioning != null) return fDocumentPartitioning; return super.getConfiguredDocumentPartitioning(sourceViewer); } public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { ContentAssistant contentAssistant = new ContentAssistant(); contentAssistant.setContentAssistProcessor(new RubyCompletionProcessor(getEditor()), IDocument.DEFAULT_CONTENT_TYPE); contentAssistant.setProposalPopupOrientation(ContentAssistant.PROPOSAL_OVERLAY); contentAssistant.setContextInformationPopupOrientation(ContentAssistant.CONTEXT_INFO_ABOVE); RubyContentAssistPreference.configure(contentAssistant, getPreferenceStore()); return contentAssistant; } /* * @see SourceViewerConfiguration#getAnnotationHover(ISourceViewer) */ public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) { return new RubyAnnotationHover(RubyAnnotationHover.VERTICAL_RULER_HOVER); } /* * @see SourceViewerConfiguration#getInformationControlCreator(ISourceViewer) * @since 2.0 */ public IInformationControlCreator getInformationControlCreator(ISourceViewer sourceViewer) { return new IInformationControlCreator() { public IInformationControl createInformationControl(Shell parent) { return new DefaultInformationControl(parent, SWT.NONE, new HTMLTextPresenter(true)); } }; } /** * Returns the editor in which the configured viewer(s) will reside. * * @return the enclosing editor */ protected ITextEditor getEditor() { return fTextEditor; } protected IPreferenceStore getPreferenceStore() { return RubyPlugin.getDefault().getPreferenceStore(); } public String[] getDefaultPrefixes(ISourceViewer sourceViewer, String contentType) { return new String[] { "#", ""}; } /* * (non-Javadoc) * * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getReconciler(org.eclipse.jface.text.source.ISourceViewer) */ public IReconciler getReconciler(ISourceViewer sourceViewer) { RubyReconciler reconciler = new RubyReconciler(fTextEditor, new RubyReconcilingStrategy( (RubyAbstractEditor) fTextEditor), true); reconciler.setIsIncrementalReconciler(false); reconciler.setIsAllowedToModifyDocument(false); reconciler.setProgressMonitor(new NullProgressMonitor()); reconciler.setDelay(500); return reconciler; } public String[] getIndentPrefixes(ISourceViewer sourceViewer, String contentType) { if (!(fTextEditor instanceof RubyEditor)) { return super.getIndentPrefixes(sourceViewer, contentType); } if (sourceViewer instanceof RubySourceViewer) { RubySourceViewer viewer = (RubySourceViewer) sourceViewer; if (viewer.isTabReplacing()) { return new String[] { viewer.getIndentString(), "\t", " "}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } } return super.getIndentPrefixes(sourceViewer, contentType); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) { if (fRubyDoubleClickSelector == null) { fRubyDoubleClickSelector= new RubyDoubleClickSelector(); } return fRubyDoubleClickSelector; } public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) { if (fRubyTextHover == null) { fRubyTextHover = new RubyCodeTextHover(); } return fRubyTextHover; } } |
|
From: Christopher W. <caw...@us...> - 2006-02-10 19:50:27
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9146/src/org/rubypeople/rdt/internal/ui/text Removed Files: RubySourceViewerConfiguration.java Log Message: move to externally visible package --- RubySourceViewerConfiguration.java DELETED --- |
|
From: Christopher W. <caw...@us...> - 2006-02-10 18:35:43
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/icons/full/ctool16 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7109/icons/full/ctool16 Removed Files: ruby_method_pro.gif ruby_method.gif ruby_method_pub.gif Log Message: remove old unused icon files --- ruby_method_pub.gif DELETED --- --- ruby_method.gif DELETED --- --- ruby_method_pro.gif DELETED --- |
|
From: Christopher W. <caw...@us...> - 2006-02-10 18:35:20
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6789/src/org/rubypeople/rdt/core Modified Files: RubyCore.java Log Message: changes to work with all the other stuff I've done Index: RubyCore.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyCore.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** RubyCore.java 13 Dec 2005 20:07:47 -0000 1.28 --- RubyCore.java 10 Feb 2006 18:35:09 -0000 1.29 *************** *** 34,44 **** import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.ISchedulingRule; - import org.eclipse.core.runtime.preferences.DefaultScope; import org.eclipse.core.runtime.preferences.IEclipsePreferences; - import org.eclipse.core.runtime.preferences.InstanceScope; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; import org.rubypeople.rdt.internal.core.BatchOperation; import org.rubypeople.rdt.internal.core.DefaultWorkingCopyOwner; import org.rubypeople.rdt.internal.core.RubyModel; import org.rubypeople.rdt.internal.core.RubyModelManager; --- 34,43 ---- import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.ISchedulingRule; import org.eclipse.core.runtime.preferences.IEclipsePreferences; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; import org.rubypeople.rdt.internal.core.BatchOperation; import org.rubypeople.rdt.internal.core.DefaultWorkingCopyOwner; + import org.rubypeople.rdt.internal.core.RubyCorePreferenceInitializer; import org.rubypeople.rdt.internal.core.RubyModel; import org.rubypeople.rdt.internal.core.RubyModelManager; *************** *** 176,179 **** --- 175,193 ---- public static final String CORE_ENCODING = PLUGIN_ID + ".encoding"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * + * @see #getDefaultOptions() + * @since 0.8.0 + */ + public static final String INSERT = "insert"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * + * @see #getDefaultOptions() + * @since 0.8.0 + */ + public static final String DO_NOT_INSERT = "do not insert"; //$NON-NLS-1$ + private SymbolIndex symbolIndex; private ISymbolFinder symbolFinder; *************** *** 205,242 **** public void start(BundleContext context) throws Exception { super.start(context); ! // init preferences ! initializeDefaultPreferences(); ! ! // Listen to instance preferences node removal from parent in order to ! // refresh stored one ! IEclipsePreferences.INodeChangeListener listener = new IEclipsePreferences.INodeChangeListener() { ! ! public void added(IEclipsePreferences.NodeChangeEvent event) { ! // do nothing ! } ! ! public void removed(IEclipsePreferences.NodeChangeEvent event) { ! if (event.getChild() == preferencesLookup[PREF_INSTANCE]) { ! preferencesLookup[PREF_INSTANCE] = new InstanceScope().getNode(PLUGIN_ID); ! } ! } ! }; ! ((IEclipsePreferences) getInstancePreferences().parent()).addNodeChangeListener(listener); ! ! // Listen to default preferences node removal from parent in order to ! // refresh stored one ! listener = new IEclipsePreferences.INodeChangeListener() { ! ! public void added(IEclipsePreferences.NodeChangeEvent event) { ! // do nothing ! } ! ! public void removed(IEclipsePreferences.NodeChangeEvent event) { ! if (event.getChild() == preferencesLookup[PREF_DEFAULT]) { ! preferencesLookup[PREF_DEFAULT] = new DefaultScope().getNode(PLUGIN_ID); ! } ! } ! }; ! ((IEclipsePreferences) getDefaultPreferences().parent()).addNodeChangeListener(listener); RubyParser.setDebugging(isDebugOptionTrue(RUBY_PARSER_DEBUG_OPTION)); --- 219,223 ---- public void start(BundleContext context) throws Exception { super.start(context); ! RubyModelManager.getRubyModelManager().startup(); RubyParser.setDebugging(isDebugOptionTrue(RUBY_PARSER_DEBUG_OPTION)); *************** *** 252,255 **** --- 233,251 ---- } + /* + * (non-Javadoc) Shutdown the JavaCore plug-in. <p> De-registers the + * RubyModelManager as a resource changed listener and save participant. <p> + * + * @see org.eclipse.core.runtime.Plugin#stop(BundleContext) + */ + public void stop(BundleContext context) throws Exception { + try { + RubyModelManager.getRubyModelManager().shutdown(); + } finally { + // ensure we call super.stop as the last thing + super.stop(context); + } + } + private boolean isDebugOptionTrue(String option) { String optionText = Platform.getDebugOption(option); *************** *** 276,316 **** } - /* - * Initializes the default preferences settings for this plug-in. - */ - protected void initializeDefaultPreferences() { - // Init and store default and instance preferences - IEclipsePreferences defaultPreferences = getDefaultPreferences(); - - // Override some compiler defaults - defaultPreferences.put(COMPILER_TASK_TAGS, DEFAULT_TASK_TAGS); - defaultPreferences.put(COMPILER_TASK_PRIORITIES, DEFAULT_TASK_PRIORITIES); - defaultPreferences.put(COMPILER_TASK_CASE_SENSITIVE, ENABLED); - } - public static void trace(String message) { if (getPlugin().isDebugging()) System.out.println(message); } - /** - * @since 3.1 - */ - public static IEclipsePreferences getDefaultPreferences() { - if (preferencesLookup[PREF_DEFAULT] == null) { - preferencesLookup[PREF_DEFAULT] = new DefaultScope().getNode(PLUGIN_ID); - } - return preferencesLookup[PREF_DEFAULT]; - } - - /** - * @since 3.1 - */ - public static IEclipsePreferences getInstancePreferences() { - if (preferencesLookup[PREF_INSTANCE] == null) { - preferencesLookup[PREF_INSTANCE] = new InstanceScope().getNode(PLUGIN_ID); - } - return preferencesLookup[PREF_INSTANCE]; - } - public static void log(Exception e) { String msg = e.getMessage(); --- 272,279 ---- *************** *** 649,651 **** --- 612,618 ---- return (RubyCore) getPlugin(); } + + public static boolean isRubyLikeFileName(String name) { + return name.endsWith(".rb") || name.endsWith(".rbw"); + } } \ No newline at end of file |
|
From: Christopher W. <caw...@us...> - 2006-02-10 18:34:55
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6659/src/org/rubypeople/rdt/core Added Files: Flags.java Log Message: new class for holding and comparing visibility flags --- NEW FILE: Flags.java --- package org.rubypeople.rdt.core; public class Flags { public static boolean isPublic(int flags) { return flags == IMethod.PUBLIC; } public static boolean isProtected(int flags) { return flags == IMethod.PROTECTED; } public static boolean isPrivate(int modifierFlags) { return modifierFlags == IMethod.PRIVATE; } } |
|
From: Christopher W. <caw...@us...> - 2006-02-10 18:34:41
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6558 Modified Files: plugin.xml Log Message: use a preference initializer Index: plugin.xml =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/plugin.xml,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** plugin.xml 20 Dec 2005 20:10:04 -0000 1.36 --- plugin.xml 10 Feb 2006 18:34:30 -0000 1.37 *************** *** 101,103 **** --- 101,111 ---- </extension> + <!-- =================================================================================== --> + <!-- Extension: Eclipse preferences initializer --> + <!-- =================================================================================== --> + <extension + point="org.eclipse.core.runtime.preferences"> + <initializer class="org.rubypeople.rdt.internal.core.RubyCorePreferenceInitializer"/> + </extension> + </plugin> |
|
From: Christopher W. <caw...@us...> - 2006-02-10 18:34:40
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6558/src/org/rubypeople/rdt/internal/core Added Files: RubyCorePreferenceInitializer.java Log Message: use a preference initializer --- NEW FILE: RubyCorePreferenceInitializer.java --- package org.rubypeople.rdt.internal.core; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.Map; import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; import org.eclipse.core.runtime.preferences.DefaultScope; import org.eclipse.core.runtime.preferences.IEclipsePreferences; import org.rubypeople.rdt.core.RubyCore; import org.rubypeople.rdt.core.formatter.DefaultCodeFormatterConstants; public class RubyCorePreferenceInitializer extends AbstractPreferenceInitializer { public void initializeDefaultPreferences() { // Get options names set HashSet optionNames = RubyModelManager.getRubyModelManager().optionNames; Map defaultOptionsMap = new HashMap(); // Override some compiler defaults defaultOptionsMap.put(RubyCore.COMPILER_TASK_TAGS, RubyCore.DEFAULT_TASK_TAGS); defaultOptionsMap.put(RubyCore.COMPILER_TASK_PRIORITIES, RubyCore.DEFAULT_TASK_PRIORITIES); defaultOptionsMap.put(RubyCore.COMPILER_TASK_CASE_SENSITIVE, RubyCore.ENABLED); // encoding setting comes from resource plug-in optionNames.add(RubyCore.CORE_ENCODING); // Formatter settings Map codeFormatterOptionsMap = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); // code // formatter // defaults for (Iterator iter = codeFormatterOptionsMap.entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); String optionName = (String) entry.getKey(); defaultOptionsMap.put(optionName, entry.getValue()); optionNames.add(optionName); } // Store default values to default preferences IEclipsePreferences defaultPreferences = new DefaultScope().getNode(RubyCore.PLUGIN_ID); for (Iterator iter = defaultOptionsMap.entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); String optionName = (String) entry.getKey(); defaultPreferences.put(optionName, (String) entry.getValue()); optionNames.add(optionName); } } } |
|
From: Christopher W. <caw...@us...> - 2006-02-10 18:33:59
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6088/src/org/rubypeople/rdt/internal/core/parser Modified Files: TaskParser.java Log Message: take a Map of options (instead of IEclipsePrefences) to make us more like JDT (and able to handle project specific settings) Index: TaskParser.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/TaskParser.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TaskParser.java 6 Aug 2005 22:57:32 -0000 1.7 --- TaskParser.java 10 Feb 2006 18:33:49 -0000 1.8 *************** *** 10,18 **** import java.util.Collections; import java.util.List; import java.util.StringTokenizer; import org.eclipse.core.resources.IMarker; import org.eclipse.core.runtime.CoreException; - import org.eclipse.core.runtime.preferences.IEclipsePreferences; import org.rubypeople.rdt.core.RubyCore; --- 10,18 ---- import java.util.Collections; import java.util.List; + import java.util.Map; import java.util.StringTokenizer; import org.eclipse.core.resources.IMarker; import org.eclipse.core.runtime.CoreException; import org.rubypeople.rdt.core.RubyCore; *************** *** 28,36 **** private List tasks; ! public TaskParser(IEclipsePreferences preferences) { ! String caseSensitive = preferences.get(RubyCore.COMPILER_TASK_CASE_SENSITIVE, RubyCore.ENABLED); ! if (caseSensitive == RubyCore.ENABLED) fCaseSensitive = true; ! String tags = preferences.get(RubyCore.COMPILER_TASK_TAGS, RubyCore.DEFAULT_TASK_TAGS); ! String priorities = preferences.get(RubyCore.COMPILER_TASK_PRIORITIES, RubyCore.DEFAULT_TASK_PRIORITIES); fTags = tokenize(tags, ","); fPriorities = convertPriorities(tokenize(priorities, ",")); --- 28,36 ---- private List tasks; ! public TaskParser(Map preferences) { ! String caseSensitive = getString(preferences, RubyCore.COMPILER_TASK_CASE_SENSITIVE, RubyCore.ENABLED); ! if (caseSensitive.equals(RubyCore.ENABLED)) fCaseSensitive = true; ! String tags = getString(preferences, RubyCore.COMPILER_TASK_TAGS, RubyCore.DEFAULT_TASK_TAGS); ! String priorities = getString(preferences, RubyCore.COMPILER_TASK_PRIORITIES, RubyCore.DEFAULT_TASK_PRIORITIES); fTags = tokenize(tags, ","); fPriorities = convertPriorities(tokenize(priorities, ",")); *************** *** 38,42 **** } ! private int[] convertPriorities(String[] stringPriorities) { int priorities[] = new int[stringPriorities.length]; for (int i = 0; i < stringPriorities.length; i++) { --- 38,49 ---- } ! private String getString(Map preferences, String key, String def) { ! if (preferences == null) return def; ! String answer = (String) preferences.get(key); ! if (answer == null) return def; ! return answer; ! } ! ! private int[] convertPriorities(String[] stringPriorities) { int priorities[] = new int[stringPriorities.length]; for (int i = 0; i < stringPriorities.length; i++) { |
|
From: Christopher W. <caw...@us...> - 2006-02-10 18:33:58
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6088/src/org/rubypeople/rdt/internal/core/builder Modified Files: TaskCompiler.java Log Message: take a Map of options (instead of IEclipsePrefences) to make us more like JDT (and able to handle project specific settings) Index: TaskCompiler.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/TaskCompiler.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TaskCompiler.java 13 Oct 2005 23:56:06 -0000 1.2 --- TaskCompiler.java 10 Feb 2006 18:33:49 -0000 1.3 *************** *** 27,31 **** public TaskCompiler(IMarkerManager markerManager) { ! this(markerManager, new TaskParser(RubyCore.getInstancePreferences())); } --- 27,31 ---- public TaskCompiler(IMarkerManager markerManager) { ! this(markerManager, new TaskParser(RubyCore.getOptions())); } |
|
From: Christopher W. <caw...@us...> - 2006-02-10 18:33:27
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5947/src/org/rubypeople/rdt/internal/core/util Modified Files: Util.java Log Message: add method for generating hashCodes (for IRubyElements) Index: Util.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/Util.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Util.java 13 Dec 2005 19:59:47 -0000 1.5 --- Util.java 10 Feb 2006 18:33:18 -0000 1.6 *************** *** 312,314 **** --- 312,322 ---- } + /** + * Combines two hash codes to make a new one. + */ + public static int combineHashCodes(int hashCode1, int hashCode2) { + return hashCode1 * 17 + hashCode2; + } + + } |
|
From: Christopher W. <caw...@us...> - 2006-02-10 18:33:14
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/formatter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5671/src/org/rubypeople/rdt/internal/formatter Added Files: DefaultCodeFormatterOptions.java Log Message: new code formatting options --- NEW FILE: DefaultCodeFormatterOptions.java --- package org.rubypeople.rdt.internal.formatter; import java.util.HashMap; import java.util.Map; import org.rubypeople.rdt.core.RubyCore; import org.rubypeople.rdt.core.formatter.DefaultCodeFormatterConstants; public class DefaultCodeFormatterOptions { private static final int DEFAULT_INDENT_SIZE = 4; private static final int DEFAULT_TAB_SIZE = 4; public static final int TAB = 1; public static final int SPACE = 2; public static final int MIXED = 4; public int indentation_size; public int tab_char; public int tab_size; public int comment_line_length; public static DefaultCodeFormatterOptions getDefaultSettings() { DefaultCodeFormatterOptions options = new DefaultCodeFormatterOptions(); options.setDefaultSettings(); return options; } public static DefaultCodeFormatterOptions getEclipseDefaultSettings() { DefaultCodeFormatterOptions options = new DefaultCodeFormatterOptions(); options.setEclipseDefaultSettings(); return options; } public static DefaultCodeFormatterOptions getRubyConventionsSettings() { DefaultCodeFormatterOptions options = new DefaultCodeFormatterOptions(); options.setRubyConventionsSettings(); return options; } private DefaultCodeFormatterOptions() { // cannot be instantiated } public DefaultCodeFormatterOptions(Map settings) { setDefaultSettings(); if (settings == null) return; set(settings); } public void setDefaultSettings() { this.tab_char = TAB; this.tab_size = DEFAULT_TAB_SIZE; this.indentation_size = DEFAULT_INDENT_SIZE; } public void setEclipseDefaultSettings() { setRubyConventionsSettings(); } public void setRubyConventionsSettings() { setDefaultSettings(); this.tab_char = SPACE; this.tab_size = 2; this.indentation_size = 2; } public Map getMap() { Map options = new HashMap(); options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, Integer.toString(this.comment_line_length)); options.put(DefaultCodeFormatterConstants.FORMATTER_INDENTATION_SIZE, Integer .toString(this.indentation_size)); switch (this.tab_char) { case SPACE: options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, RubyCore.SPACE); break; case TAB: options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, RubyCore.TAB); break; case MIXED: options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, DefaultCodeFormatterConstants.MIXED); break; } options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, Integer .toString(this.tab_size)); return options; } public void set(Map settings) { final Object commentLineLengthOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH); if (commentLineLengthOption != null) { try { this.comment_line_length = Integer.parseInt((String) commentLineLengthOption); } catch (NumberFormatException e) { this.comment_line_length = 80; } catch(ClassCastException e) { this.comment_line_length = 80; } } final Object indentationSizeOption = settings .get(DefaultCodeFormatterConstants.FORMATTER_INDENTATION_SIZE); if (indentationSizeOption != null) { try { this.indentation_size = Integer.parseInt((String) indentationSizeOption); } catch (NumberFormatException e) { this.indentation_size = DEFAULT_INDENT_SIZE; } catch (ClassCastException e) { this.indentation_size = DEFAULT_INDENT_SIZE; } } final Object tabSizeOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE); if (tabSizeOption != null) { try { this.tab_size = Integer.parseInt((String) tabSizeOption); } catch (NumberFormatException e) { this.tab_size = DEFAULT_TAB_SIZE; } catch (ClassCastException e) { this.tab_size = DEFAULT_TAB_SIZE; } } final Object useTabOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR); if (useTabOption != null) { if (RubyCore.TAB.equals(useTabOption)) { this.tab_char = TAB; } else if (RubyCore.SPACE.equals(useTabOption)) { this.tab_char = SPACE; } else { this.tab_char = MIXED; } } } } |
|
From: Christopher W. <caw...@us...> - 2006-02-10 18:32:51
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/formatter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5591/src/org/rubypeople/rdt/internal/formatter Modified Files: AbstractBlockMarker.java IndentationState.java Log Message: chnages to make our old code formatter compatible with the new formatting options Index: IndentationState.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/formatter/IndentationState.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IndentationState.java 11 Apr 2003 22:12:10 -0000 1.1 --- IndentationState.java 10 Feb 2006 18:32:41 -0000 1.2 *************** *** 1,4 **** --- 1,5 ---- package org.rubypeople.rdt.internal.formatter; + public class IndentationState { private int lastIndentation ; *************** *** 9,20 **** private int indentation ; private String unformattedText ; - private char fillCharacter ; ! public IndentationState(String unformattedText, int indentationLength, int offset, char fillCharacter) { this.unformattedText = unformattedText ; this.indentationLength = indentationLength ; ! this.fillCharacter = fillCharacter ; ! this.offset = offset ; ! indentationLevel = 0 ; pos = 0 ; this.calculateIndentation() ; --- 10,19 ---- private int indentation ; private String unformattedText ; ! public IndentationState(String unformattedText, int indentationLength, int offset, int initialIndentLevel) { this.unformattedText = unformattedText ; this.indentationLength = indentationLength ; ! this.offset = offset; ! indentationLevel = initialIndentLevel; pos = 0 ; this.calculateIndentation() ; *************** *** 36,45 **** } ! public void calculateIndentation() { indentation = offset + indentationLength * indentationLevel ; } - - - public int getIndentation() { --- 35,41 ---- } ! public void calculateIndentation() { indentation = offset + indentationLength * indentationLevel ; } public int getIndentation() { *************** *** 101,116 **** return lastIndentation ; } - - protected String getIndentationString() { - if (indentation <= 0) { - return ""; - } - char[] chars = new char[indentation]; - for (int i = 0; i < indentation; i++) { - chars[i] = fillCharacter; - } - return new String(chars); - } - } --- 97,100 ---- Index: AbstractBlockMarker.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/formatter/AbstractBlockMarker.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AbstractBlockMarker.java 11 Apr 2003 22:12:10 -0000 1.1 --- AbstractBlockMarker.java 10 Feb 2006 18:32:41 -0000 1.2 *************** *** 1,4 **** --- 1,8 ---- package org.rubypeople.rdt.internal.formatter; + import java.util.Map; + + import org.rubypeople.rdt.core.formatter.Indents; + public abstract class AbstractBlockMarker { protected int pos; *************** *** 34,40 **** } ! public void appendIndentedLine(StringBuffer sb, IndentationState state, String originalLine, String strippedLine) { ! ! sb.append(state.getIndentationString()); sb.append(strippedLine); } --- 38,48 ---- } ! public void appendIndentedLine(StringBuffer sb, IndentationState state, String originalLine, String strippedLine, Map options) { ! String spaces = ""; ! for (int i = 0; i < state.getOffset(); i++) { ! spaces+= " "; ! } ! sb.append(spaces); ! sb.append(Indents.createIndentString(state.getIndentationLevel(), options)); sb.append(strippedLine); } |
|
From: Christopher W. <caw...@us...> - 2006-02-10 18:32:27
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/formatter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5406/src/org/rubypeople/rdt/internal/formatter Added Files: OldCodeFormatter.java Removed Files: CodeFormatter.java Log Message: rename our existing formatter (because we're gearing up for creating abrand new AST based code formatter) --- NEW FILE: OldCodeFormatter.java --- package org.rubypeople.rdt.internal.formatter; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; import org.eclipse.core.runtime.Platform; import org.eclipse.text.edits.ReplaceEdit; import org.eclipse.text.edits.TextEdit; import org.rubypeople.rdt.core.RubyCore; import org.rubypeople.rdt.core.formatter.CodeFormatter; import org.rubypeople.rdt.core.formatter.DefaultCodeFormatterConstants; import org.rubypeople.rdt.core.formatter.Indents; public class OldCodeFormatter extends CodeFormatter { private final static String BLOCK_BEGIN_RE = "(class|module|def|if|unless|case|while|until|for|begin|do)"; private final static String BLOCK_MID_RE = "(else|elsif|when|rescue|ensure)"; private final static String BLOCK_END_RE = "(end)"; private final static String DELIMITER_RE = "[?$/(){}#\\`.:\\]\\[]"; private final static String[] LITERAL_BEGIN_LITERALS = { "\"", "'", "=begin", "%[Qqrxw]?.", "/", "<<[\\-]?[']?[a-zA-Z_]+[']?"}; private final static String[] LITERAL_END_RES = { "[^\\\\](\\\\\\\\)*\"", "[^\\\\](\\\\\\\\)*'", "=end", "", "", ""}; private final int BLOCK_BEGIN_PAREN = 2; private final int BLOCK_MID_PAREN = 5; private final int BLOCK_END_PAREN = 8; private final int LITERAL_BEGIN_PAREN = 10; private static Pattern MODIFIER_RE; private static Pattern OPERATOR_RE; private static Pattern NON_BLOCK_DO_RE; private static String LITERAL_BEGIN_RE; // automatically concatenated from // LITERAL_BEGIN_LITERALS private static Pattern[] LITERAL_END_RES_COMPILED; static { LITERAL_END_RES_COMPILED = new Pattern[LITERAL_END_RES.length]; for (int i = 0; i < LITERAL_END_RES.length; i++) { try { LITERAL_END_RES_COMPILED[i] = Pattern.compile(LITERAL_END_RES[i]); } catch (PatternSyntaxException e) { System.out.println(e); } } StringBuffer sb = new StringBuffer(); sb.append("("); for (int i = 0; i < LITERAL_BEGIN_LITERALS.length; i++) { sb.append(LITERAL_BEGIN_LITERALS[i]); if (i < LITERAL_BEGIN_LITERALS.length - 1) { sb.append("|"); } } sb.append(")"); LITERAL_BEGIN_RE = sb.toString(); try { MODIFIER_RE = Pattern.compile("if|unless|while|until|rescue"); OPERATOR_RE = Pattern.compile("[\\-,.+*/%&|\\^~=<>:]"); NON_BLOCK_DO_RE = Pattern.compile("(^|[\\s])(while|until|for|rescue)[\\s]"); } catch (PatternSyntaxException e) { System.out.println(e); } } private DefaultCodeFormatterOptions preferences; private Map options; public OldCodeFormatter() { this(new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants .getRubyConventionsSettings()), null); } public OldCodeFormatter(DefaultCodeFormatterOptions preferences) { this(preferences, null); } public OldCodeFormatter(DefaultCodeFormatterOptions defaultCodeFormatterOptions, Map options) { if (options != null) { this.options = options; this.preferences = new DefaultCodeFormatterOptions(options); } else { this.options = RubyCore.getOptions(); this.preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants .getRubyConventionsSettings()); } if (defaultCodeFormatterOptions != null) { this.preferences.set(defaultCodeFormatterOptions.getMap()); } } public OldCodeFormatter(Map options) { this(null, options); } /** * @deprecated As of 0.8.0 we're moving to use CodeFormatters that spit out TextEdits. * @param unformatted * @return */ public synchronized String formatString(String unformatted) { AbstractBlockMarker firstAbstractBlockMarker = this.createBlockMarkerList(unformatted); if (isDebug()) { firstAbstractBlockMarker.print(); } try { return this.formatString(unformatted, firstAbstractBlockMarker); } catch (PatternSyntaxException ex) { return unformatted; } } private boolean isDebug() { String codeFormatterOption = Platform.getDebugOption(RubyCore.PLUGIN_ID + "/codeformatter"); boolean isDebug = codeFormatterOption == null ? false : codeFormatterOption .equalsIgnoreCase("true"); return isDebug; } protected String formatString(String unformatted, AbstractBlockMarker abstractBlockMarker) throws PatternSyntaxException { Pattern pat = Pattern.compile("\n"); String[] lines = pat.split(unformatted); IndentationState state = null; StringBuffer formatted = new StringBuffer(); Pattern whitespacePattern = Pattern.compile("^[\t ]*"); for (int i = 0; i < lines.length; i++) { String line = lines[i]; int initialIndentLevel = Indents.measureIndentUnits(line, preferences.tab_size, preferences.indentation_size); Matcher whitespaceMatcher = whitespacePattern.matcher(lines[i]); whitespaceMatcher.find(); int leadingWhitespace = whitespaceMatcher.end(0); if (state == null) { state = new IndentationState(unformatted, preferences.indentation_size, leadingWhitespace, initialIndentLevel); } state.incPos(leadingWhitespace); String strippedLine = lines[i].substring(leadingWhitespace); AbstractBlockMarker newBlockMarker = this.findNextBlockMarker(abstractBlockMarker, state.getPos(), state); if (newBlockMarker != null) { newBlockMarker.indentBeforePrint(state); newBlockMarker.appendIndentedLine(formatted, state, lines[i], strippedLine, options); state.saveIndentation(); newBlockMarker.indentAfterPrint(state); abstractBlockMarker = newBlockMarker; } else { abstractBlockMarker.appendIndentedLine(formatted, state, lines[i], strippedLine, options); } if (i != lines.length - 1) { formatted.append("\n"); } state.incPos(strippedLine.length() + 1); } if (unformatted.lastIndexOf("\n") == unformatted.length() - 1) { formatted.append("\n"); } return formatted.toString(); } private AbstractBlockMarker findNextBlockMarker(AbstractBlockMarker abstractBlockMarker, int pos, IndentationState state) { AbstractBlockMarker startBlockMarker = abstractBlockMarker; while (abstractBlockMarker.getNext() != null && abstractBlockMarker.getNext().getPos() <= pos) { if (abstractBlockMarker != startBlockMarker) { abstractBlockMarker.indentBeforePrint(state); abstractBlockMarker.indentAfterPrint(state); } abstractBlockMarker = abstractBlockMarker.getNext(); } return startBlockMarker == abstractBlockMarker ? null : abstractBlockMarker; } protected AbstractBlockMarker createBlockMarkerList(String unformatted) { Pattern pat = null; try { pat = Pattern.compile("(^|[\\s]|;)" + BLOCK_BEGIN_RE + "($|[\\s]|" + DELIMITER_RE + ")|(^|[\\s])" + BLOCK_MID_RE + "($|[\\s]|" + DELIMITER_RE + ")|(^|[\\s]|;)" + BLOCK_END_RE + "($|[\\s]|;)|" + LITERAL_BEGIN_RE + "|" + DELIMITER_RE); } catch (PatternSyntaxException e) { System.out.println(e); } int pos = 0; AbstractBlockMarker lastBlockMarker = new NeutralMarker("start", 0); AbstractBlockMarker firstBlockMarker = lastBlockMarker; Matcher re = pat.matcher(unformatted); while (pos != -1 && re.find(pos)) { AbstractBlockMarker newBlockMarker = null; if (re.group(BLOCK_BEGIN_PAREN) != null) { pos = re.end(BLOCK_BEGIN_PAREN); String blockBeginStr = re.group(BLOCK_BEGIN_PAREN); if (MODIFIER_RE.matcher(blockBeginStr).matches() && !this.isRubyExprBegin(unformatted, re.start(BLOCK_BEGIN_PAREN), "modifier")) { continue; } if (blockBeginStr.equals("do") && this.isNonBlockDo(unformatted, re.start(BLOCK_BEGIN_PAREN))) { continue; } newBlockMarker = new BeginBlockMarker(re.group(BLOCK_BEGIN_PAREN), re .start(BLOCK_BEGIN_PAREN)); } else if (re.group(BLOCK_MID_PAREN) != null) { pos = re.end(BLOCK_MID_PAREN); newBlockMarker = new MidBlockMarker(re.group(BLOCK_MID_PAREN), re .start(BLOCK_MID_PAREN)); } else if (re.group(BLOCK_END_PAREN) != null) { pos = re.end(BLOCK_END_PAREN); newBlockMarker = new EndBlockMarker(re.group(BLOCK_END_PAREN), re .start(BLOCK_END_PAREN)); } else if (re.group(LITERAL_BEGIN_PAREN) != null) { pos = re.end(LITERAL_BEGIN_PAREN); String matchedLiteralBegin = re.group(LITERAL_BEGIN_PAREN); if (matchedLiteralBegin.startsWith("%")) { int delimitChar = matchedLiteralBegin.charAt(matchedLiteralBegin.length() - 1); boolean expand = matchedLiteralBegin.charAt(1) != 'q'; if (delimitChar == '[') { pos = this.forwardString(unformatted, pos, '[', ']', expand); } else if (delimitChar == '(') { pos = this.forwardString(unformatted, pos, '(', ')', expand); } else if (delimitChar == '{') { pos = this.forwardString(unformatted, pos, '{', '}', expand); } else if (delimitChar == '<') { pos = this.forwardString(unformatted, pos, '<', '>', expand); } else { pos = unformatted.indexOf(delimitChar, pos); } } else if (matchedLiteralBegin.startsWith("/")) { // we do not consider reg exp over multiple lines. Therefore // a reg exp over // mutliple lines might get formatted. On the other hand // code between // two division slashes on several lines is being formatted. // We could avoid that // behaviour only if we could make a difference between // slashes for division and // slashes for regular expressions. int posClosingSlash = this.forwardString(unformatted, pos, ' ', "/", true); if (posClosingSlash == pos) { continue; } int posNextLine = unformatted.indexOf("\n", pos); if (posNextLine != -1 && posClosingSlash > posNextLine) { continue; } pos = posClosingSlash; } else if (matchedLiteralBegin.startsWith("'")) { if (pos > 1 && unformatted.charAt(pos - 2) == '$') { continue; } pos = this.forwardString(unformatted, pos, ' ', "'", true); } else if (matchedLiteralBegin.startsWith("<<")) { int startId = 2; int endId = matchedLiteralBegin.length(); boolean isMinus = (matchedLiteralBegin.charAt(startId) == '-'); if (isMinus) { startId += 1; } if (startId < matchedLiteralBegin.length() - 1 && matchedLiteralBegin.charAt(startId) == '\'') { startId += 1; endId -= 1; } String reStr = (isMinus ? "" : "\n") + matchedLiteralBegin.substring(startId, endId); try { Pattern idSearch = Pattern.compile(reStr); Matcher matcher = idSearch.matcher(unformatted); if (matcher.find(pos)) { pos = matcher.end(0); } else { pos = -1; } } catch (PatternSyntaxException e1) { continue; } } else { for (int i = 0; i < LITERAL_BEGIN_LITERALS.length; i++) { if (LITERAL_BEGIN_LITERALS[i].equals(matchedLiteralBegin)) { Pattern matchEnd = LITERAL_END_RES_COMPILED[i]; pos = -1; Matcher tmpMatch = matchEnd.matcher(unformatted); if (tmpMatch.find(re.end(LITERAL_BEGIN_PAREN) - 1)) { pos = tmpMatch.end(0); } break; } } } newBlockMarker = new NoFormattingMarker(matchedLiteralBegin, re .start(LITERAL_BEGIN_PAREN)); if (pos != -1) { lastBlockMarker.setNext(newBlockMarker); lastBlockMarker = newBlockMarker; newBlockMarker = new NeutralMarker("", pos); } } else { String delimiter = re.group(0); if (delimiter.equals("#")) { pos = unformatted.indexOf("\n", re.end(0)); continue; } else if (delimiter.equals("{")) { newBlockMarker = new BeginBlockMarker("{", re.start(0)); } else if (delimiter.equals("}")) { newBlockMarker = new EndBlockMarker("}", re.start(0)); } else if (delimiter.equals("(")) { newBlockMarker = new FixLengthMarker("(", re.start(0)); } else if (delimiter.equals(")")) { newBlockMarker = new NeutralMarker(")", re.start(0)); } pos = re.end(0); } if (newBlockMarker == null) { continue; } if (lastBlockMarker != null) { lastBlockMarker.setNext(newBlockMarker); } lastBlockMarker = newBlockMarker; } return firstBlockMarker; } /* * (defun ruby-forward-string (term &optional end no-error expand) (let ((n * 1) (c (string-to-char term)) (re (if expand (concat * "[^\\]\\(\\\\\\\\\\)*\\([" term "]\\|\\(#{\\)\\)") (concat * "[^\\]\\(\\\\\\\\\\)*[" term "]")))) (while (and (re-search-forward re * end no-error) (if (match-beginning 3) (ruby-forward-string "}{" end * no-error nil) (> (setq n (if (eq (char-before (point)) c) (1- n) (1+ n))) * 0))) (forward-char -1)) (cond ((zerop n)) (no-error nil) (error * "unterminated string")))) */ protected int forwardString(String unformatted, int pos, char opening, char closing, boolean expand) { return this.forwardString(unformatted, pos, opening, "\\" + opening + "\\" + closing, expand); } protected int forwardString(String unformatted, int pos, char opening, String term, boolean expand) { int n = 1; try { Pattern pat = Pattern.compile(expand ? "[" + term + "]|(#\\{)" : "[" + term + "]"); Matcher re = pat.matcher(unformatted); while (re.find(pos) && n > 0) { if (re.group(1) != null) { pos = this.forwardString(unformatted, re.end(1), '{', "\\{\\}", expand); } else { pos = re.end(0); if (pos > 2 && unformatted.charAt(pos - 2) == '\\' && unformatted.charAt(pos - 3) != '\\') { continue; } if (re.group(0).charAt(0) == opening) { n += 1; } else { n -= 1; } } } } catch (PatternSyntaxException e) { // TODO Auto-generated catch block e.printStackTrace(); } return pos; } /* * (defun ruby-expr-beg (&optional option) (save-excursion (store-match-data * nil) (skip-chars-backward " \t") (cond ((bolp) t) ((looking-at "\\?") (or * (bolp) (forward-char -1)) (not (looking-at "\\sw"))) (t (forward-char -1) * (or (looking-at ruby-operator-re) (looking-at "[\\[({,;]") (and (not (eq * option 'modifier)) (looking-at "[!?]")) (and (looking-at ruby-symbol-re) * (skip-chars-backward ruby-symbol-chars) (cond ((or (looking-at * ruby-block-beg-re) (looking-at ruby-block-op-re) (looking-at * ruby-block-mid-re)) (goto-char (match-end 0)) (looking-at "\\>")) (t (and * (not (eq option 'expr-arg)) (looking-at "[a-zA-Z][a-zA-z0-9_]* +/[^ * \t]")))))))))) */ protected int skipCharsBackward(String unformatted, int pos) { // skipCharsBackward returns the position of the first char which is not // tab or space left from pos and is in the // same line as pos do { if (pos == 0) { return 0; } if (unformatted.charAt(pos - 1) == '\n') { return pos; } pos -= 1; } while (unformatted.charAt(pos) == '\t' || unformatted.charAt(pos) == ' '); return pos; } protected int backToIndentation(String unformatted, int pos) { do { if (pos == 0) { return 0; } if (unformatted.charAt(pos - 1) == '\n') { break; } pos -= 1; } while (true); while (unformatted.charAt(pos) == '\t' || unformatted.charAt(pos) == ' ') { pos += 1; if (pos == unformatted.length()) { break; } } return pos; } protected int posOfLineStart(String unformatted, int pos) { do { if (pos == 0) { return 0; } if (unformatted.charAt(pos - 1) == '\n') { break; } pos -= 1; } while (true); return pos; } protected boolean matchREBackward(String str, Pattern re) { int pos = str.length() - 1; while (pos >= 0) { if (str.charAt(pos) == ';') { return false; } if (re.matcher(str).find(pos)) { return true; } pos -= 1; } return false; } protected boolean isRubyExprBegin(String unformatted, int pos, String option) { int firstNonSpaceCharInLine = this.skipCharsBackward(unformatted, pos); if (firstNonSpaceCharInLine == 0 || unformatted.charAt(firstNonSpaceCharInLine - 1) == '\n') { return true; } char c = unformatted.charAt(firstNonSpaceCharInLine); if (c == ';') { return true; } String c_str = "" + c; if (OPERATOR_RE.matcher(c_str).matches()) { return true; } return false; } protected boolean isNonBlockDo(String unformatted, int pos) { int lineStart = this.posOfLineStart(unformatted, pos); return this.matchREBackward(unformatted.substring(lineStart, pos), NON_BLOCK_DO_RE); } public TextEdit format(int kind, String source, int offset, int length, int indentationLevel, String lineSeparator) { String newText = formatString(source.substring(offset, length)); return new ReplaceEdit(offset, length, newText); } } --- CodeFormatter.java DELETED --- |
|
From: Christopher W. <caw...@us...> - 2006-02-10 18:31:48
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5182/src/org/rubypeople/rdt/core Modified Files: IType.java Log Message: modify a method to receive a new arg Index: IType.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IType.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IType.java 12 Mar 2005 15:30:03 -0000 1.1 --- IType.java 10 Feb 2006 18:31:38 -0000 1.2 *************** *** 33,37 **** public interface IType extends IRubyElement, IMember { ! public RubyMethod getMethod(String name); /** --- 33,37 ---- public interface IType extends IRubyElement, IMember { ! public RubyMethod getMethod(String name, String[] parameterNames); /** *************** *** 136,138 **** --- 136,140 ---- String[] getIncludedModuleNames() throws RubyModelException; + public boolean isMember() throws RubyModelException; + } \ No newline at end of file |
|
From: Christopher W. <caw...@us...> - 2006-02-10 18:31:13
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4904/src/org/rubypeople/rdt/core Added Files: ToolFactory.java Log Message: class to export a CodeFormatter --- NEW FILE: ToolFactory.java --- package org.rubypeople.rdt.core; import java.util.Map; import org.rubypeople.rdt.core.formatter.CodeFormatter; import org.rubypeople.rdt.internal.formatter.OldCodeFormatter; public class ToolFactory { /** * Create an instance of the built-in code formatter. * * @param options - * the options map to use for formatting with the default code * formatter. Recognized options are documented on * <code>RubyCore#getDefaultOptions()</code>. If set to * <code>null</code>, then use the current settings from * <code>RubyCore#getOptions</code>. * @return an instance of the built-in code formatter * @see OldCodeFormatter * @see RubyCore#getOptions() * @since 0.8.0 */ public static CodeFormatter createCodeFormatter(Map options) { if (options == null) options = RubyCore.getOptions(); return new OldCodeFormatter(options); } } |
|
From: Christopher W. <caw...@us...> - 2006-02-10 18:30:45
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4755/src/org/rubypeople/rdt/core Modified Files: IRubyElement.java Log Message: rename LOCAL_VAR to LOCAL_VARIABLE, remove the SINGLETON_METHOD constant (use IMethod.isSingleton()) Index: IRubyElement.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IRubyElement.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** IRubyElement.java 12 Jul 2005 00:03:09 -0000 1.5 --- IRubyElement.java 10 Feb 2006 18:30:37 -0000 1.6 *************** *** 42,51 **** public static final int CLASS_VAR = 8; public static final int INSTANCE_VAR = 9; ! public static final int LOCAL_VAR = 10; public static final int BLOCK = 11; public static final int DYNAMIC_VAR = 12; public static final int FIELD = 13; public static final int IMPORT_CONTAINER = 14; - public static final int SINGLETON_METHOD = 15; /** --- 42,50 ---- public static final int CLASS_VAR = 8; public static final int INSTANCE_VAR = 9; ! public static final int LOCAL_VARIABLE = 10; public static final int BLOCK = 11; public static final int DYNAMIC_VAR = 12; public static final int FIELD = 13; public static final int IMPORT_CONTAINER = 14; /** |
|
From: Christopher W. <caw...@us...> - 2006-02-10 18:30:04
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4093/src/org/rubypeople/rdt/core Modified Files: IMethod.java Log Message: add new interface methods for determining if a method is a constructor, a singleton, and getting the parameter names Index: IMethod.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IMethod.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IMethod.java 12 Mar 2005 15:30:03 -0000 1.1 --- IMethod.java 10 Feb 2006 18:29:51 -0000 1.2 *************** *** 38,40 **** --- 38,46 ---- public int getVisibility() throws RubyModelException; + public boolean isConstructor(); + + public String[] getParameterNames() throws RubyModelException; + + public boolean isSingleton(); + } \ No newline at end of file |
|
From: Christopher W. <caw...@us...> - 2006-02-10 18:29:30
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3759/src/org/rubypeople/rdt/internal/core Modified Files: RubySingletonMethod.java RubyElementDelta.java RubyType.java RubyModelManager.java RubyScriptStructureBuilder.java RubyScriptProblemFinder.java RubyElement.java RubyLocalVar.java RubyElementDeltaBuilder.java RubyProject.java RubyMethod.java Log Message: add hashCode methods - I kept running into wacky problems where RubyElementDelats were interpreted wrongly (because we had defined equals() but not hashCode() and the items compared where in HashMaps) Index: RubyMethod.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyMethod.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RubyMethod.java 12 Mar 2005 15:30:04 -0000 1.3 --- RubyMethod.java 10 Feb 2006 18:29:16 -0000 1.4 *************** *** 25,32 **** package org.rubypeople.rdt.internal.core; - import org.rubypeople.rdt.core.IRubyElement; import org.rubypeople.rdt.core.IMethod; import org.rubypeople.rdt.core.IType; import org.rubypeople.rdt.core.RubyModelException; /** --- 25,33 ---- package org.rubypeople.rdt.internal.core; import org.rubypeople.rdt.core.IMethod; + import org.rubypeople.rdt.core.IRubyElement; import org.rubypeople.rdt.core.IType; import org.rubypeople.rdt.core.RubyModelException; + import org.rubypeople.rdt.internal.core.util.Util; /** *************** *** 36,44 **** public class RubyMethod extends NamedMember implements IMethod { ! /** * @param name */ ! public RubyMethod(RubyElement parent, String name) { super(parent, name); } --- 37,48 ---- public class RubyMethod extends NamedMember implements IMethod { ! private String[] parameterNames; ! ! /** * @param name */ ! public RubyMethod(RubyElement parent, String name, String[] parameterNames) { super(parent, name); + this.parameterNames = parameterNames; } *************** *** 58,62 **** // FIXME We need to send more info than the method name. Number of // params? ! return ((IType) primaryParent).getMethod(this.name); } --- 62,66 ---- // FIXME We need to send more info than the method name. Number of // params? ! return ((IType) primaryParent).getMethod(this.name, parameterNames); } *************** *** 69,72 **** --- 73,87 ---- return super.equals(o); } + + /** + * @see org.rubypeople.rdt.internal.core.RubyElement#hashCode() + */ + public int hashCode() { + int hash = super.hashCode(); + for (int i = 0, length = parameterNames.length; i < length; i++) { + hash = Util.combineHashCodes(hash, parameterNames[i].hashCode()); + } + return hash; + } /* *************** *** 76,80 **** */ public IType getDeclaringType() { ! // TODO Auto-generated method stub return null; } --- 91,96 ---- */ public IType getDeclaringType() { ! IRubyElement parent = getParent(); ! if (parent instanceof IType) return (IType) parent; return null; } *************** *** 90,92 **** --- 106,116 ---- } + public String[] getParameterNames() throws RubyModelException { + return parameterNames; + } + + public boolean isSingleton() { + return false; + } + } \ No newline at end of file Index: RubyProject.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** RubyProject.java 13 Dec 2005 19:58:55 -0000 1.17 --- RubyProject.java 10 Feb 2006 18:29:16 -0000 1.18 *************** *** 188,191 **** --- 188,195 ---- return this.project.equals(other.getProject()); } + + public int hashCode() { + return this.project.hashCode(); + } public boolean exists() { Index: RubyScriptStructureBuilder.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** RubyScriptStructureBuilder.java 7 Feb 2006 15:57:52 -0000 1.16 --- RubyScriptStructureBuilder.java 10 Feb 2006 18:29:16 -0000 1.17 *************** *** 181,185 **** if( name.equals("initialize") ) visibility = Visibility.PROTECTED; ! RubyMethod method = new RubyMethod( getCurrentType(), name ); modelStack.push( method ); --- 181,187 ---- if( name.equals("initialize") ) visibility = Visibility.PROTECTED; ! // TODO Find the existing method and steal it's parameter names ! String[] parameterNames = new String[0]; ! RubyMethod method = new RubyMethod( getCurrentType(), name, parameterNames ); modelStack.push( method ); *************** *** 695,699 **** RubyElement type = getCurrentType(); ! RubyMethod method = new RubyMethod(type, name); modelStack.push(method); --- 697,702 ---- RubyElement type = getCurrentType(); ! String[] parameterNames = getArgs(iVisited.getArgsNode()); ! RubyMethod method = new RubyMethod(type, name, parameterNames); modelStack.push(method); *************** *** 702,706 **** RubyMethodElementInfo info = new RubyMethodElementInfo(); ! info.setArgumentNames(getArgs(iVisited.getArgsNode())); // TODO Set more information info.setVisibility(convertVisibility(visibility)); --- 705,709 ---- RubyMethodElementInfo info = new RubyMethodElementInfo(); ! info.setArgumentNames(parameterNames); // TODO Set more information info.setVisibility(convertVisibility(visibility)); *************** *** 792,798 **** Visibility visibility = currentVisibility; // Get the type of the current parent element RubyElement type = getCurrentType(); ! RubyMethod method = new RubySingletonMethod(type, name); modelStack.push(method); --- 795,803 ---- Visibility visibility = currentVisibility; + String[] parameterNames = getArgs(iVisited.getArgsNode()); + // Get the type of the current parent element RubyElement type = getCurrentType(); ! RubyMethod method = new RubySingletonMethod(type, name, parameterNames); modelStack.push(method); *************** *** 807,811 **** setKeywordRange("def", pos, info, name); ! info.setArgumentNames(getArgs(iVisited.getArgsNode())); info.setVisibility(convertVisibility(visibility)); --- 812,816 ---- setKeywordRange("def", pos, info, name); ! info.setArgumentNames(parameterNames); info.setVisibility(convertVisibility(visibility)); *************** *** 1124,1128 **** public Instruction visitLocalAsgnNode(LocalAsgnNode iVisited) { handleNode(iVisited); ! RubyLocalVar var = new RubyLocalVar(modelStack.peek(), iVisited.getName()); modelStack.push(var); --- 1129,1136 ---- public Instruction visitLocalAsgnNode(LocalAsgnNode iVisited) { handleNode(iVisited); ! ! int start = iVisited.getPosition().getStartOffset() - iVisited.getName().length() + 1; ! int end = start + iVisited.getName().length(); ! RubyLocalVar var = new RubyLocalVar(modelStack.peek(), iVisited.getName(), start, end); modelStack.push(var); *************** *** 1132,1139 **** RubyFieldElementInfo info = new RubyFieldElementInfo(); info.setTypeName(estimateValueType(iVisited.getValueNode())); ! ! // TODO Set the info! ISourcePosition pos = iVisited.getPosition(); ! setTokenRange( pos, info, iVisited.getName() ); infoStack.push(info); --- 1140,1146 ---- RubyFieldElementInfo info = new RubyFieldElementInfo(); info.setTypeName(estimateValueType(iVisited.getValueNode())); ! ISourcePosition pos = iVisited.getPosition(); ! setTokenRange( pos, info, iVisited.getName() ); infoStack.push(info); Index: RubyModelManager.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelManager.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** RubyModelManager.java 14 Dec 2005 03:03:29 -0000 1.6 --- RubyModelManager.java 10 Feb 2006 18:29:16 -0000 1.7 *************** *** 20,25 **** --- 20,29 ---- import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Preferences; + import org.eclipse.core.runtime.content.IContentTypeManager.ContentTypeChangeEvent; + import org.eclipse.core.runtime.content.IContentTypeManager.IContentTypeChangeListener; + import org.eclipse.core.runtime.preferences.DefaultScope; import org.eclipse.core.runtime.preferences.IEclipsePreferences; import org.eclipse.core.runtime.preferences.IPreferencesService; + import org.eclipse.core.runtime.preferences.InstanceScope; import org.rubypeople.rdt.core.ILoadpathEntry; import org.rubypeople.rdt.core.IParent; *************** *** 39,43 **** * */ ! public class RubyModelManager { private static final String BUFFER_MANAGER_DEBUG = RubyCore.PLUGIN_ID + "/debug/buffermanager"; //$NON-NLS-1$ --- 43,47 ---- * */ ! public class RubyModelManager implements IContentTypeChangeListener { private static final String BUFFER_MANAGER_DEBUG = RubyCore.PLUGIN_ID + "/debug/buffermanager"; //$NON-NLS-1$ *************** *** 115,118 **** --- 119,134 ---- /** + * Update the classpath variable cache + */ + public static class EclipsePreferencesListener implements IEclipsePreferences.IPreferenceChangeListener { + /** + * @see org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener#preferenceChange(org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent) + */ + public void preferenceChange(IEclipsePreferences.PreferenceChangeEvent event) { + // TODO Listen for loadpath changes! + } + } + + /** * Constructs a new RubyModelManager */ *************** *** 127,130 **** --- 143,185 ---- return MANAGER; } + + /** + * Initialize preferences lookups for JavaCore plugin. + */ + public void initializePreferences() { + + // Create lookups + preferencesLookup[PREF_INSTANCE] = new InstanceScope().getNode(RubyCore.PLUGIN_ID); + preferencesLookup[PREF_DEFAULT] = new DefaultScope().getNode(RubyCore.PLUGIN_ID); + + // Listen to instance preferences node removal from parent in order to refresh stored one + IEclipsePreferences.INodeChangeListener listener = new IEclipsePreferences.INodeChangeListener() { + public void added(IEclipsePreferences.NodeChangeEvent event) { + // do nothing + } + public void removed(IEclipsePreferences.NodeChangeEvent event) { + if (event.getChild() == preferencesLookup[PREF_INSTANCE]) { + preferencesLookup[PREF_INSTANCE] = new InstanceScope().getNode(RubyCore.PLUGIN_ID); + preferencesLookup[PREF_INSTANCE].addPreferenceChangeListener(new EclipsePreferencesListener()); + } + } + }; + ((IEclipsePreferences) preferencesLookup[PREF_INSTANCE].parent()).addNodeChangeListener(listener); + preferencesLookup[PREF_INSTANCE].addPreferenceChangeListener(new EclipsePreferencesListener()); + + // Listen to default preferences node removal from parent in order to refresh stored one + listener = new IEclipsePreferences.INodeChangeListener() { + public void added(IEclipsePreferences.NodeChangeEvent event) { + // do nothing + } + public void removed(IEclipsePreferences.NodeChangeEvent event) { + if (event.getChild() == preferencesLookup[PREF_DEFAULT]) { + preferencesLookup[PREF_DEFAULT] = new DefaultScope().getNode(RubyCore.PLUGIN_ID); + } + } + }; + ((IEclipsePreferences) preferencesLookup[PREF_DEFAULT].parent()).addNodeChangeListener(listener); + } + /** *************** *** 581,584 **** --- 636,642 ---- // request state folder creation (workaround 19885) RubyCore.getPlugin().getStateLocation(); + + // Initialize eclipse preferences + initializePreferences(); // Listen to preference changes *************** *** 591,594 **** --- 649,655 ---- RubyCore.getPlugin().getPluginPreferences().addPropertyChangeListener(propertyListener); + // Listen to content-type changes + Platform.getContentTypeManager().addContentTypeChangeListener(this); + final IWorkspace workspace = ResourcesPlugin.getWorkspace(); workspace.addResourceChangeListener(this.deltaState, *************** *** 660,662 **** --- 721,728 ---- } + public void contentTypeChanged(ContentTypeChangeEvent event) { + // TODO Change our classes which determine if a file is "Ruby-like" + //Util.resetRubyLikeExtensions(); + } + } Index: RubySingletonMethod.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubySingletonMethod.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RubySingletonMethod.java 12 Jul 2005 00:03:06 -0000 1.1 --- RubySingletonMethod.java 10 Feb 2006 18:29:16 -0000 1.2 *************** *** 31,47 **** * @param parent * @param name */ ! public RubySingletonMethod(RubyElement parent, String name) { ! super(parent, name); ! // TODO Auto-generated constructor stub } ! /* ! * (non-Javadoc) ! * @see org.rubypeople.rdt.core.IRubyElement#getElementType() ! */ ! public int getElementType(){ ! return RubyElement.SINGLETON_METHOD; ! } } --- 31,43 ---- * @param parent * @param name + * @param parameterNames */ ! public RubySingletonMethod(RubyElement parent, String name, String[] parameterNames) { ! super(parent, name, parameterNames); } ! public boolean isSingleton() { ! return true; ! } } Index: RubyType.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyType.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RubyType.java 12 Mar 2005 15:30:03 -0000 1.4 --- RubyType.java 10 Feb 2006 18:29:16 -0000 1.5 *************** *** 60,63 **** --- 60,70 ---- return info.getIncludedModuleNames(); } + + /** + * @see IType#isMember() + */ + public boolean isMember() { + return getDeclaringType() != null; + } /* *************** *** 87,92 **** } ! public RubyMethod getMethod(String name) { ! return new RubyMethod(this, name); } --- 94,99 ---- } ! public RubyMethod getMethod(String name, String[] parameterNames) { ! return new RubyMethod(this, name, parameterNames); } *************** *** 135,139 **** case IRubyElement.CLASS_VAR: case IRubyElement.BLOCK: ! case IRubyElement.LOCAL_VAR: case IRubyElement.METHOD: return ((IMember) primaryParent).getType(this.name, this.occurrenceCount); --- 142,146 ---- case IRubyElement.CLASS_VAR: case IRubyElement.BLOCK: ! case IRubyElement.LOCAL_VARIABLE: case IRubyElement.METHOD: return ((IMember) primaryParent).getType(this.name, this.occurrenceCount); Index: RubyElement.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyElement.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RubyElement.java 13 Dec 2005 19:58:55 -0000 1.5 --- RubyElement.java 10 Feb 2006 18:29:16 -0000 1.6 *************** *** 43,46 **** --- 43,47 ---- import org.rubypeople.rdt.core.ISourceReference; import org.rubypeople.rdt.core.RubyModelException; + import org.rubypeople.rdt.internal.core.util.Util; /** *************** *** 64,68 **** /** ! * Returns true if this handle represents the same Java element as the given * handle. By default, two handles represent the same element if they are * identical or if they represent the same type of element, have equal --- 65,69 ---- /** ! * Returns true if this handle represents the same Ruby element as the given * handle. By default, two handles represent the same element if they are * identical or if they represent the same type of element, have equal *************** *** 237,240 **** --- 238,252 ---- } + /** + * Returns the hash code for this Ruby element. By default, + * the hash code for an element is a combination of its name + * and parent's hash code. Elements with other requirements must + * override this method. + */ + public int hashCode() { + if (this.parent == null) return super.hashCode(); + return Util.combineHashCodes(getElementName().hashCode(), this.parent.hashCode()); + } + /* * (non-Javadoc) *************** *** 399,404 **** /** * Returns the info for this handle. If this element is not already open, it ! * and all of its parents are opened. Does not return null. NOTE: BinaryType ! * infos are NOT rooted under RubyElementInfo. * * @exception RubyModelException --- 411,415 ---- /** * Returns the info for this handle. If this element is not already open, it ! * and all of its parents are opened. Does not return null. * * @exception RubyModelException Index: RubyLocalVar.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyLocalVar.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RubyLocalVar.java 10 Mar 2005 04:10:31 -0000 1.3 --- RubyLocalVar.java 10 Feb 2006 18:29:16 -0000 1.4 *************** *** 29,32 **** --- 29,33 ---- import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.IProgressMonitor; + import org.rubypeople.rdt.internal.core.util.Util; /** *************** *** 36,43 **** public class RubyLocalVar extends RubyField { /** * @param name */ ! public RubyLocalVar(RubyElement parent, String name) { super(parent, name); } --- 37,47 ---- public class RubyLocalVar extends RubyField { + private int start; + private int end; + /** * @param name */ ! public RubyLocalVar(RubyElement parent, String name, int start, int end) { super(parent, name); } *************** *** 49,53 **** */ public int getElementType() { ! return RubyElement.LOCAL_VAR; } --- 53,57 ---- */ public int getElementType() { ! return RubyElement.LOCAL_VARIABLE; } *************** *** 60,63 **** --- 64,80 ---- return null; } + + public int hashCode() { + return Util.combineHashCodes(this.parent.hashCode(), this.start); + } + + public boolean equals(Object o) { + if (!(o instanceof RubyLocalVar)) return false; + RubyLocalVar other = (RubyLocalVar)o; + return + this.start == other.start + && this.end == other.end + && super.equals(o); + } protected void generateInfos(Object info, HashMap newElements, IProgressMonitor pm) { Index: RubyElementDeltaBuilder.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyElementDeltaBuilder.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RubyElementDeltaBuilder.java 24 Dec 2005 01:43:57 -0000 1.2 --- RubyElementDeltaBuilder.java 10 Feb 2006 18:29:16 -0000 1.3 *************** *** 34,43 **** /** ! * The java element handle */ ! IRubyElement javaElement; /** ! * The maximum depth in the java element children we should look into */ int maxDepth = Integer.MAX_VALUE; --- 34,43 ---- /** ! * The ruby element handle */ ! IRubyElement rubyElement; /** ! * The maximum depth in the ruby element children we should look into */ int maxDepth = Integer.MAX_VALUE; *************** *** 88,109 **** /** ! * Creates a java element comparator on a java element looking as deep as * necessary. */ ! public RubyElementDeltaBuilder(IRubyElement javaElement) { ! this.javaElement = javaElement; this.initialize(); ! this.recordElementInfo(javaElement, (RubyModel) this.javaElement.getRubyModel(), 0); } /** ! * Creates a java element comparator on a java element looking only * 'maxDepth' levels deep. */ ! public RubyElementDeltaBuilder(IRubyElement javaElement, int maxDepth) { ! this.javaElement = javaElement; this.maxDepth = maxDepth; this.initialize(); ! this.recordElementInfo(javaElement, (RubyModel) this.javaElement.getRubyModel(), 0); } --- 88,109 ---- /** ! * Creates a ruby element comparator on a ruby element looking as deep as * necessary. */ ! public RubyElementDeltaBuilder(IRubyElement rubyElement) { ! this.rubyElement = rubyElement; this.initialize(); ! this.recordElementInfo(rubyElement, (RubyModel) this.rubyElement.getRubyModel(), 0); } /** ! * Creates a ruby element comparator on a ruby element looking only * 'maxDepth' levels deep. */ ! public RubyElementDeltaBuilder(IRubyElement rubyElement, int maxDepth) { ! this.rubyElement = rubyElement; this.maxDepth = maxDepth; this.initialize(); ! this.recordElementInfo(rubyElement, (RubyModel) this.rubyElement.getRubyModel(), 0); } *************** *** 122,133 **** /** ! * Builds the java element deltas between the old content of the compilation ! * unit and its new content. */ public void buildDeltas() { ! this.recordNewPositions(this.javaElement, 0); ! this.findAdditions(this.javaElement, 0); this.findDeletions(); ! this.findChangesInPositioning(this.javaElement, 0); this.trimDelta(this.delta); if (this.delta.getAffectedChildren().length == 0) { --- 122,133 ---- /** ! * Builds the ruby element deltas between the old content of the ruby script ! * and its new content. */ public void buildDeltas() { ! this.recordNewPositions(this.rubyElement, 0); ! this.findAdditions(this.rubyElement, 0); this.findDeletions(); ! this.findChangesInPositioning(this.rubyElement, 0); this.trimDelta(this.delta); if (this.delta.getAffectedChildren().length == 0) { *************** *** 271,281 **** this.oldPositions = new HashMap(20); this.newPositions = new HashMap(20); ! this.putOldPosition(this.javaElement, new ListItem(null, null)); ! this.putNewPosition(this.javaElement, new ListItem(null, null)); ! this.delta = new RubyElementDelta(javaElement); ! // if building a delta on a compilation unit or below, // it's a fine grained delta ! if (javaElement.getElementType() >= IRubyElement.SCRIPT) { this.delta.fineGrained(); } --- 271,281 ---- this.oldPositions = new HashMap(20); this.newPositions = new HashMap(20); ! this.putOldPosition(this.rubyElement, new ListItem(null, null)); ! this.putNewPosition(this.rubyElement, new ListItem(null, null)); ! this.delta = new RubyElementDelta(rubyElement); ! // if building a delta on a ruby script or below, // it's a fine grained delta ! if (rubyElement.getElementType() >= IRubyElement.SCRIPT) { this.delta.fineGrained(); } *************** *** 343,347 **** RubyElementInfo info = (RubyElementInfo) RubyModelManager.getRubyModelManager().getInfo( element); ! if (info == null) // no longer in the java model. return; this.putElementInfo(element, info); --- 343,347 ---- RubyElementInfo info = (RubyElementInfo) RubyModelManager.getRubyModelManager().getInfo( element); ! if (info == null) // no longer in the ruby model. return; this.putElementInfo(element, info); Index: RubyScriptProblemFinder.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptProblemFinder.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** RubyScriptProblemFinder.java 1 Oct 2005 23:01:01 -0000 1.6 --- RubyScriptProblemFinder.java 10 Feb 2006 18:29:16 -0000 1.7 *************** *** 11,18 **** import org.eclipse.core.resources.IFile; import org.eclipse.core.runtime.IProgressMonitor; - import org.eclipse.core.runtime.preferences.IEclipsePreferences; import org.jruby.lexer.yacc.SyntaxException; import org.rubypeople.rdt.core.IProblemRequestor; - import org.rubypeople.rdt.core.RubyCore; import org.rubypeople.rdt.core.parser.IProblem; import org.rubypeople.rdt.internal.core.parser.Error; --- 11,16 ---- *************** *** 28,53 **** // DSC convert to ImmediateWarnings ! public static void process(RubyScript script, char[] charContents, IProblemRequestor problemRequestor, IProgressMonitor pm) { ! RdtWarnings warnings = new RdtWarnings(); ! RubyParser parser = new RubyParser(warnings); ! String contents = new String(charContents); ! try { ! parser.parse((IFile) script.getUnderlyingResource(), new StringReader(contents)); ! } catch (SyntaxException e) { ! problemRequestor.acceptProblem(new Error(e.getPosition(), "Syntax Error")); ! } ! IEclipsePreferences preferences = RubyCore.getInstancePreferences(); ! TaskParser taskParser = new TaskParser(preferences); ! taskParser.parse(contents); ! List problems = new ArrayList(); ! problems.addAll(warnings.getWarnings()); ! problems.addAll(taskParser.getTasks()); ! for (Iterator iter = problems.iterator(); iter.hasNext();) { ! IProblem problem = (IProblem) iter.next(); ! problemRequestor.acceptProblem(problem); ! } ! } } --- 26,51 ---- // DSC convert to ImmediateWarnings ! public static void process(RubyScript script, char[] charContents, ! IProblemRequestor problemRequestor, IProgressMonitor pm) { ! RdtWarnings warnings = new RdtWarnings(); ! RubyParser parser = new RubyParser(warnings); ! String contents = new String(charContents); ! try { ! parser.parse((IFile) script.getUnderlyingResource(), new StringReader(contents)); ! } catch (SyntaxException e) { ! problemRequestor.acceptProblem(new Error(e.getPosition(), "Syntax Error")); ! } ! TaskParser taskParser = new TaskParser(script.getRubyProject().getOptions(true)); ! taskParser.parse(contents); ! List problems = new ArrayList(); ! problems.addAll(warnings.getWarnings()); ! problems.addAll(taskParser.getTasks()); ! for (Iterator iter = problems.iterator(); iter.hasNext();) { ! IProblem problem = (IProblem) iter.next(); ! problemRequestor.acceptProblem(problem); ! } ! } } Index: RubyElementDelta.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyElementDelta.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RubyElementDelta.java 13 Dec 2005 19:58:55 -0000 1.1 --- RubyElementDelta.java 10 Feb 2006 18:29:16 -0000 1.2 *************** *** 30,34 **** * The AST created during the last reconcile operation. Non-null only iff: - * in a POST_RECONCILE event - an AST was requested during the last ! * reconcile operation - the changed element is an ICompilationUnit in * working copy mode */ --- 30,34 ---- * The AST created during the last reconcile operation. Non-null only iff: - * in a POST_RECONCILE event - an AST was requested during the last ! * reconcile operation - the changed element is an IRubyScript in * working copy mode */ |
|
From: Christopher W. <caw...@us...> - 2006-02-10 18:28:16
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/META-INF In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3075/META-INF Modified Files: MANIFEST.MF Log Message: export the new core.formatter package Index: MANIFEST.MF =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/META-INF/MANIFEST.MF,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** MANIFEST.MF 5 Feb 2006 14:24:02 -0000 1.14 --- MANIFEST.MF 10 Feb 2006 18:28:02 -0000 1.15 *************** *** 38,41 **** --- 38,42 ---- org.jruby.util.collections, org.rubypeople.rdt.core, + org.rubypeople.rdt.core.formatter, org.rubypeople.rdt.core.parser, org.rubypeople.rdt.internal.core, |
|
From: Christopher W. <caw...@us...> - 2006-02-10 18:27:53
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/formatter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2863/src/org/rubypeople/rdt/core/formatter Added Files: Indents.java CodeFormatter.java DefaultCodeFormatterConstants.java Log Message: Create a new abstract class CodeFormatter that all formatters should extends from. We're starting to move towards a JDT like formatter... --- NEW FILE: CodeFormatter.java --- /******************************************************************************* * Copyright (c) 2000, 2004 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.core.formatter; import org.eclipse.text.edits.TextEdit; /** * Specification for a generic source code formatter. * * @since 0.8.0 */ public abstract class CodeFormatter { /** * Unknown kind */ public static final int K_UNKNOWN = 0x00; /** * Kind used to format an expression */ public static final int K_EXPRESSION = 0x01; /** * Kind used to format a set of statements */ public static final int K_STATEMENTS = 0x02; /** * Kind used to format a set of class body declarations */ public static final int K_CLASS_BODY_DECLARATIONS = 0x04; /** * Kind used to format a ruby script */ public static final int K_RUBY_SCRIPT = 0x08; /** * Kind used to format a single-line comment * @since 0.8.0 */ public static final int K_SINGLE_LINE_COMMENT = 0x10; /** * Kind used to format a multi-line comment * @since 0.8.0 */ public static final int K_MULTI_LINE_COMMENT = 0x20; /** * Kind used to format a Javadoc comment * @since 0.8.0 */ public static final int K_RUBY_DOC = 0x40; /** * Format <code>source</code>, * and returns a text edit that correspond to the difference between the given string and the formatted string. * It returns null if the given string cannot be formatted. * * If the offset position is matching a whitespace, the result can include whitespaces. It would be up to the * caller to get rid of preceeding whitespaces. * * @param kind Use to specify the kind of the code snippet to format. It can be any of these: * K_EXPRESSION, K_STATEMENTS, K_CLASS_BODY_DECLARATIONS, K_RUBY_SCRIPT, K_UNKNOWN, * K_SINGLE_LINE_COMMENT, K_MULTI_LINE_COMMENT, K_RUBY_DOC * @param source the source to format * @param offset the given offset to start recording the edits (inclusive). * @param length the given length to stop recording the edits (exclusive). * @param indentationLevel the initial indentation level, used * to shift left/right the entire source fragment. An initial indentation * level of zero or below has no effect. * @param lineSeparator the line separator to use in formatted source, * if set to <code>null</code>, then the platform default one will be used. * @return the text edit * @throws IllegalArgumentException if offset is lower than 0, length is lower than 0 or * length is greater than source length. */ public abstract TextEdit format(int kind, String source, int offset, int length, int indentationLevel, String lineSeparator); } --- NEW FILE: Indents.java --- package org.rubypeople.rdt.core.formatter; import java.util.Map; import org.eclipse.jface.text.Assert; import org.rubypeople.rdt.core.RubyCore; public class Indents { private Indents() { } /** * Returns the tab width as configured in the given map. * @param options the map to get the formatter settings from. Use {@link org.eclipse.jdt.core.IJavaProject#getOptions(boolean)} to * get the most current project options. * @return the tab width */ public static int getTabWidth(Map options) { if (options == null) { throw new IllegalArgumentException(); } return getIntValue(options, DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, 4); } /** * Returns the tab width as configured in the given map. * @param options the map to get the formatter settings from. Use {@link org.eclipse.jdt.core.IJavaProject#getOptions(boolean)} to * get the most current project options. * @return the indent width */ public static int getIndentWidth(Map options) { if (options == null) { throw new IllegalArgumentException(); } int tabWidth=getTabWidth(options); boolean isMixedMode= DefaultCodeFormatterConstants.MIXED.equals(options.get(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR)); if (isMixedMode) { return getIntValue(options, DefaultCodeFormatterConstants.FORMATTER_INDENTATION_SIZE, tabWidth); } return tabWidth; } private static int getIntValue(Map options, String key, int def) { try { return Integer.parseInt((String) options.get(key)); } catch (NumberFormatException e) { return def; } } /** * Returns the indentation of the given line in indentation units. Odd spaces are * not counted. This method only analyzes the content of <code>line</code> up to the first * non-whitespace character. * * @param line the string to measure the indent of * @param tabWidth the width of one tab character in space equivalents * @param indentWidth the width of one indentation unit in space equivalents * @return the number of indentation units that line is indented by */ public static int measureIndentUnits(CharSequence line, int tabWidth, int indentWidth) { if (indentWidth <= 0 || tabWidth < 0 || line == null) { throw new IllegalArgumentException(); } int visualLength= measureIndentInSpaces(line, tabWidth); return visualLength / indentWidth; } /** * Creates a string that represents the given number of indentation units. * The returned string can contain tabs and/or spaces depending on the core * formatter preferences. * * @param indentationUnits the number of indentation units to generate * @param options the options to get the formatter settings from. Use {@link org.eclipse.jdt.core.IJavaProject#getOptions(boolean)} to * get the most current project options. * @return the indent string */ public static String createIndentString(int indentationUnits, Map options) { if (options == null || indentationUnits < 0) { throw new IllegalArgumentException(); } String tabChar= getStringValue(options, DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, RubyCore.TAB); final int tabs, spaces; if (RubyCore.SPACE.equals(tabChar)) { tabs= 0; spaces= indentationUnits * getIndentWidth(options); } else if (RubyCore.TAB.equals(tabChar)) { // indentWidth == tabWidth tabs= indentationUnits; spaces= 0; } else if (DefaultCodeFormatterConstants.MIXED.equals(tabChar)){ int tabWidth= getTabWidth(options); int spaceEquivalents= indentationUnits * getIndentWidth(options); if (tabWidth > 0) { tabs= spaceEquivalents / tabWidth; spaces= spaceEquivalents % tabWidth; } else { tabs= 0; spaces= spaceEquivalents; } } else { // new indent type not yet handled Assert.isTrue(false); return null; } StringBuffer buffer= new StringBuffer(tabs + spaces); for(int i= 0; i < tabs; i++) buffer.append('\t'); for(int i= 0; i < spaces; i++) buffer.append(' '); return buffer.toString(); } private static String getStringValue(Map options, String key, String def) { Object value= options.get(key); if (value instanceof String) return (String) value; return def; } /** * Returns the indentation of the given line in space equivalents. * Tab characters are counted using the given <code>tabWidth</code> and every other indent * character as one. This method analyzes the content of <code>line</code> up to the first * non-whitespace character. * * @param line the string to measure the indent of * @param tabWidth the width of one tab in space equivalents * @return the measured indent width in space equivalents */ public static int measureIndentInSpaces(CharSequence line, int tabWidth) { if (tabWidth < 0 || line == null) { throw new IllegalArgumentException(); } int length= 0; int max= line.length(); for (int i= 0; i < max; i++) { char ch= line.charAt(i); if (ch == '\t') { int reminder= length % tabWidth; length += tabWidth - reminder; } else if (isIndentChar(ch)) { length++; } else { return length; } } return length; } /** * Returns the leading indentation string of the given line. Note that the * returned string need not be equal to the leading whitespace as odd spaces * are not considered part of the indentation. * * @param line * the line to scan * @param tabWidth * the size of one tab in space equivalents * @param indentWidth * the width of one indentation unit in space equivalents * @return the indent part of <code>line</code>, but no odd spaces */ public static String extractIndentString(String line, int tabWidth, int indentWidth) { if (tabWidth < 0 || indentWidth <= 0 || line == null) { throw new IllegalArgumentException(); } int size = line.length(); int end = 0; int spaceEquivs = 0; int characters = 0; for (int i = 0; i < size; i++) { char c = line.charAt(i); if (c == '\t') { int remainder = spaceEquivs % tabWidth; spaceEquivs += tabWidth - remainder; characters++; } else if (isIndentChar(c)) { spaceEquivs++; characters++; } else { break; } if (spaceEquivs >= indentWidth) { end += characters; characters = 0; spaceEquivs = spaceEquivs % indentWidth; } } if (end == 0) return ""; //$NON-NLS-1$ else if (end == size) return line; else return line.substring(0, end); } /** * Tests if a character is an indent character. Indent character are all * whitespace characters except the line delimiter characters. * * @param ch * The character to test * @return Returns <code>true</code> if this the character is a indent * character */ public static boolean isIndentChar(char ch) { return Character.isWhitespace(ch) && !isLineDelimiterChar(ch); } /** * Tests if a character is a line delimiter character. * * @param ch * The character to test * @return Returns <code>true</code> if this the character is a line * delimiter character */ public static boolean isLineDelimiterChar(char ch) { return ch == '\n' || ch == '\r'; } } --- NEW FILE: DefaultCodeFormatterConstants.java --- package org.rubypeople.rdt.core.formatter; import java.util.Map; import org.rubypeople.rdt.core.RubyCore; import org.rubypeople.rdt.internal.formatter.DefaultCodeFormatterOptions; public class DefaultCodeFormatterConstants { /** * <pre> * FORMATTER / Possible value for the option FORMATTER_TAB_CHAR * </pre> * * @since 0.8.0 * @see RubyCore#TAB * @see RubyCore#SPACE * @see #FORMATTER_TAB_CHAR */ public static final String MIXED = "mixed"; //$NON-NLS-1$ /** * <pre> * FORMATTER / Option to specify the equivalent number of spaces that represents one indentation * - option id: "org.rubypeople.rdt.core.formatter.indentation.size" * - possible values: "<n>", where n is zero or a positive integer * - default: "4" * </pre> * * <p> * This option is used only if the tab char is set to MIXED. * </p> * * @see #FORMATTER_TAB_CHAR * @since 0.8.0 */ public static final String FORMATTER_INDENTATION_SIZE = RubyCore.PLUGIN_ID + ".formatter.indentation.size"; //$NON-NLS-1$ /** * <pre> * FORMATTER / Option to specify the tabulation size * - option id: "org.rubypeople.rdt.core.formatter.tabulation.char" * - possible values: { TAB, SPACE, MIXED } * - default: TAB * </pre> * * More values may be added in the future. * * @see RubyCore#TAB * @see RubyCore#SPACE * @see #MIXED * @since 0.8.0 */ public static final String FORMATTER_TAB_CHAR = RubyCore.PLUGIN_ID + ".formatter.tabulation.char"; //$NON-NLS-1$ /** * <pre> * FORMATTER / Option to specify the equivalent number of spaces that represents one tabulation * - option id: "org.rubypeople.rdt.core.formatter.tabulation.size" * - possible values: "<n>", where n is zero or a positive integer * - default: "4" * </pre> * * @since 0.8.0 */ public static final String FORMATTER_TAB_SIZE = RubyCore.PLUGIN_ID + ".formatter.tabulation.size"; //$NON-NLS-1$ /** * <pre> * FORMATTER / Value to set an option to true. * </pre> * * @since 0.8.0 */ public static final String FALSE = "false"; //$NON-NLS-1$ /** * <pre> * FORMATTER / Value to set an option to false. * </pre> * * @since 0.8.0 */ public static final String TRUE = "true"; //$NON-NLS-1$ /** * <pre> * FORMATTER / Option to specify the length of the page. Beyond this length, the formatter will try to split the code * - option id: "org.rubypeople.rdt.core.formatter.lineSplit" * - possible values: "<n>", where n is zero or a positive integer * - default: "80" * </pre> * * @since 0.8.0 */ public static final String FORMATTER_LINE_SPLIT = RubyCore.PLUGIN_ID + ".formatter.lineSplit"; //$NON-NLS-1$ /** * <pre> * FORMATTER / Option to ident empty lines * - option id: "org.rubypeople.rdt.core.formatter.indent_empty_lines" * - possible values: { TRUE, FALSE } * - default: FALSE * </pre> * * @see #TRUE * @see #FALSE * @since 0.8.0 */ public static final String FORMATTER_INDENT_EMPTY_LINES = RubyCore.PLUGIN_ID + ".formatter.indent_empty_lines"; //$NON-NLS-1$ /** * <pre> * FORMATTER / Option to use tabulations only for leading indentations * - option id: "org.rubypeople.rdt.core.formatter.use_tabs_only_for_leading_indentations" * - possible values: { TRUE, FALSE } * - default: FALSE * </pre> * * @see #TRUE * @see #FALSE * @since 0.8.0 */ public static final String FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS = RubyCore.PLUGIN_ID + ".formatter.use_tabs_only_for_leading_indentations"; //$NON-NLS-1$ /** * <pre> * FORMATTER / Option to control whether comments are formatted * - option id: "org.rubypeople.rdt.core.formatter.comment.format_comments" * - possible values: { TRUE, FALSE } * - default: TRUE * </pre> * * @see #TRUE * @see #FALSE * @since 0.8.0 */ public final static String FORMATTER_COMMENT_FORMAT = RubyCore.PLUGIN_ID + ".formatter.comment.format_comments"; //$NON-NLS-1$ /** * <pre> * FORMATTER / Option to control whether the header comment of a Ruby source file is formatted * - option id: "org.rubypeople.rdt.core.formatter.comment.format_header" * - possible values: { TRUE, FALSE } * - default: FALSE * </pre> * * @see #TRUE * @see #FALSE * @since 0.8.0 */ public final static String FORMATTER_COMMENT_FORMAT_HEADER = RubyCore.PLUGIN_ID + ".formatter.comment.format_header"; //$NON-NLS-1$ /** * <pre> * FORMATTER / Option to specify the line length for comments. * - option id: "org.rubypeople.rdt.core.formatter.comment.line_length" * - possible values: "<n>", where n is zero or a positive integer * - default: "80" * </pre> * * @since 0.8.0 */ public final static String FORMATTER_COMMENT_LINE_LENGTH = RubyCore.PLUGIN_ID + ".formatter.comment.line_length"; //$NON-NLS-1$ /** * <pre> * FORMATTER / Option to control whether blank lines are cleared inside comments * - option id: "org.rubypeople.rdt.core.formatter.comment.clear_blank_lines" * - possible values: { TRUE, FALSE } * - default: FALSE * </pre> * @see #TRUE * @see #FALSE * @since 0.8.0 */ public final static String FORMATTER_COMMENT_CLEAR_BLANK_LINES = RubyCore.PLUGIN_ID + ".formatter.comment.clear_blank_lines"; //$NON-NLS-1$ /** * Returns the default Eclipse formatter settings * * @return the Eclipse default settings * @since 0.8.0 */ public static Map getEclipseDefaultSettings() { return DefaultCodeFormatterOptions.getEclipseDefaultSettings().getMap(); } public static Map getRubyConventionsSettings() { return DefaultCodeFormatterOptions.getRubyConventionsSettings().getMap(); } } |
|
From: Christopher W. <caw...@us...> - 2006-02-10 18:27:44
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/formatter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2782/src/org/rubypeople/rdt/core/formatter Log Message: Directory /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/formatter added to the repository |
|
From: Christopher W. <caw...@us...> - 2006-02-07 15:58:11
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6623/src/org/rubypeople/rdt/internal/core Modified Files: RubyScriptStructureBuilder.java Log Message: fix up our positions (so when we select items in the outline they actually match the editor in reality) Index: RubyScriptStructureBuilder.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** RubyScriptStructureBuilder.java 27 Jan 2006 17:08:23 -0000 1.15 --- RubyScriptStructureBuilder.java 7 Feb 2006 15:57:52 -0000 1.16 *************** *** 377,383 **** RubyFieldElementInfo info = new RubyFieldElementInfo(); info.setTypeName(estimateValueType(iVisited.getValueNode())); ! ISourcePosition pos = iVisited.getPosition(); ! //setTokenRange(pos, info, name); ! setClassVarRange( pos, info, name ); // TODO Add more information about the variable infoStack.push(info); --- 377,381 ---- RubyFieldElementInfo info = new RubyFieldElementInfo(); info.setTypeName(estimateValueType(iVisited.getValueNode())); ! setTokenRange( iVisited.getPosition(), info, name ); // TODO Add more information about the variable infoStack.push(info); *************** *** 407,413 **** info.setTypeName(estimateValueType(iVisited.getValueNode())); info.setTypeName(estimateValueType(iVisited.getValueNode())); ! ISourcePosition pos = iVisited.getPosition(); ! //setTokenRange(pos, info, name); ! setClassVarRange( pos, info, name ); parentInfo.addChild(var); --- 405,409 ---- info.setTypeName(estimateValueType(iVisited.getValueNode())); info.setTypeName(estimateValueType(iVisited.getValueNode())); ! setTokenRange( iVisited.getPosition(), info, name ); parentInfo.addChild(var); *************** *** 536,573 **** return ""; } ! ! private Instruction setLocalVarRange( ISourcePosition pos, MemberElementInfo info, String name ){ ! int start = pos.getStartOffset() - name.length(); ! setMemberElementPosition( ! info, ! start, ! pos.getStartOffset() - 1, ! start, ! pos.getEndOffset() ); ! return null; ! } ! ! private Instruction setInstanceVarRange( ISourcePosition pos, MemberElementInfo info, String name ){ ! int start = pos.getStartOffset() - name.length(); ! setMemberElementPosition( ! info, ! start, ! pos.getStartOffset()- 1, ! start, ! pos.getEndOffset() ); ! return null; ! } ! ! private Instruction setClassVarRange( ISourcePosition pos, MemberElementInfo info, String name ){ ! int start = pos.getStartOffset() - name.length(); ! setMemberElementPosition( ! info, ! start, ! pos.getStartOffset() - 1, ! start, ! pos.getEndOffset() - 1); ! return null; ! } ! /** * @param keyword --- 532,536 ---- return ""; } ! /** * @param keyword *************** *** 576,602 **** * @param name */ ! private Instruction setKeywordRange(String keyword, ISourcePosition pos, MemberElementInfo info, String name) { ! info.setNameSourceStart( pos.getStartOffset() + 1); ! info.setNameSourceEnd(pos.getStartOffset() + name.length() ); ! info.setSourceRangeStart(pos.getStartOffset() + 1 ); ! info.setSourceRangeEnd( pos.getEndOffset() ); ! return null; ! } ! ! /** ! * Sets the position on a given MemberElementInfo object. ! * @param info ! * @param nameSourceStart ! * @param nameSourceEnd ! * @param sourceStart ! * @param sourceEnd ! */ ! private Instruction setMemberElementPosition( MemberElementInfo info, int nameSourceStart, ! int nameSourceEnd, int sourceStart, int sourceEnd ){ ! info.setNameSourceStart( nameSourceStart ); ! info.setNameSourceEnd( nameSourceEnd ); ! info.setSourceRangeStart( sourceStart ); ! info.setSourceRangeEnd( sourceEnd ); ! return null; } --- 539,549 ---- * @param name */ ! private void setKeywordRange(String keyword, ISourcePosition pos, MemberElementInfo info, String name) { ! // TODO Actually check nodes which make up the name for their position! ! int nameStart = pos.getStartOffset() + keyword.length() + 1; // the extra 1 is for a space after the keyword ! info.setNameSourceStart(nameStart); ! info.setNameSourceEnd(nameStart + name.length() - 1 ); ! info.setSourceRangeStart(pos.getStartOffset()); ! info.setSourceRangeEnd(pos.getEndOffset() - 1); } *************** *** 1047,1057 **** * @param info */ ! private Instruction setTokenRange(ISourcePosition pos, RubyFieldElementInfo info, String name) { ! int realStart = pos.getStartOffset() - name.length(); info.setNameSourceStart(realStart); ! info.setNameSourceEnd(pos.getStartOffset() - 1); info.setSourceRangeStart(realStart); ! info.setSourceRangeEnd(pos.getStartOffset() - 10); ! return null; } --- 994,1003 ---- * @param info */ ! private void setTokenRange(ISourcePosition pos, RubyFieldElementInfo info, String name) { ! int realStart = pos.getStartOffset() - name.length() + 1; info.setNameSourceStart(realStart); ! info.setNameSourceEnd(pos.getStartOffset()); info.setSourceRangeStart(realStart); ! info.setSourceRangeEnd(pos.getStartOffset()); } *************** *** 1095,1100 **** // TODO Add more information to the info object! ISourcePosition pos = iVisited.getPosition(); ! //setTokenRange(pos, info, name); ! setInstanceVarRange( pos, info, name ); info.setTypeName(estimateValueType(iVisited.getValueNode())); --- 1041,1045 ---- // TODO Add more information to the info object! ISourcePosition pos = iVisited.getPosition(); ! setTokenRange( pos, info, name ); info.setTypeName(estimateValueType(iVisited.getValueNode())); *************** *** 1190,1194 **** // TODO Set the info! ISourcePosition pos = iVisited.getPosition(); ! setLocalVarRange( pos, info, iVisited.getName() ); infoStack.push(info); --- 1135,1139 ---- // TODO Set the info! ISourcePosition pos = iVisited.getPosition(); ! setTokenRange( pos, info, iVisited.getName() ); infoStack.push(info); |
|
From: Markus B. <mba...@us...> - 2006-02-05 19:44:55
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.build/cruiseControl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22334 Modified Files: config.xml customTargets.xml Log Message: removed handling of includes entry for source feature build in feature.xml and build.properties Index: customTargets.xml =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.build/cruiseControl/customTargets.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** customTargets.xml 5 Feb 2006 18:07:50 -0000 1.8 --- customTargets.xml 5 Feb 2006 19:44:44 -0000 1.9 *************** *** 98,107 **** <antcall target="replaceVersions"/> <antcall target="setUpdateSiteURL"/> - <replace file="${buildDirectory}/features/org.rubypeople.rdt/feature.xml"> - <replacefilter token="<!--@@INCLUDES@@-->" value="<includes id="org.rubypeople.rdt.source" version="${featureVersion}"/>"/> - </replace> - <replace file="${buildDirectory}/features/org.rubypeople.rdt/build.properties"> - <replacefilter token="#generate.feature" value="generate.feature" /> - </replace> </target> --- 98,101 ---- Index: config.xml =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.build/cruiseControl/config.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** config.xml 5 Feb 2006 16:39:14 -0000 1.4 --- config.xml 5 Feb 2006 19:44:44 -0000 1.5 *************** *** 7,11 **** <modificationset quietperiod="120"> <cvs cvsroot=":ext:mba...@cv...:/cvsroot/rubyeclipse" module="rdt-all"/> - <alwaysbuild/> </modificationset> --- 7,10 ---- |
|
From: Markus B. <mba...@us...> - 2006-02-05 19:25:12
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt-feature In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15738 Modified Files: build.properties feature.xml Log Message: includes with source feature works since Eclipse 3.1 Index: feature.xml =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt-feature/feature.xml,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** feature.xml 4 Feb 2006 11:50:07 -0000 1.34 --- feature.xml 5 Feb 2006 19:25:04 -0000 1.35 *************** *** 244,255 **** </url> ! <!-- Due to a bug in the 3.0.1 Eclipse PDE, the Export... button in the feature manifest ! editor does not work, if there is a source feature to be built. Therefore the include statement is ! commented out and the customTargets.xml will replace the placeholder with an include statement ! after fetching this file from CVS and before the build starts. ! In addition to that, the following line will be added to build.properties: ! gen...@or...=org.rubypeople.rdt --> ! <!--@@INCLUDES@@--> ! <requires> <import plugin="org.eclipse.core.resources"/> --- 244,251 ---- </url> ! <includes ! id="org.rubypeople.rdt.source" ! version="0.0.0"/> ! <requires> <import plugin="org.eclipse.core.resources"/> Index: build.properties =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt-feature/build.properties,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** build.properties 26 Mar 2005 06:16:13 -0000 1.3 --- build.properties 5 Feb 2006 19:25:04 -0000 1.4 *************** *** 1,4 **** bin.includes = feature.xml ! # Please do not change the last line: During headless build this ! # line will be uncommented. See also comment in feature.xml ! #gen...@or...=org.rubypeople.rdt --- 1,2 ---- bin.includes = feature.xml ! gen...@or...=org.rubypeople.rdt |
|
From: Markus B. <mba...@us...> - 2006-02-05 18:07:57
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.build/cruiseControl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17280 Modified Files: customTargets.xml Log Message: removed typo Index: customTargets.xml =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.build/cruiseControl/customTargets.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** customTargets.xml 5 Feb 2006 17:48:56 -0000 1.7 --- customTargets.xml 5 Feb 2006 18:07:50 -0000 1.8 *************** *** 228,232 **** <echo file="${UpdateSiteStagingLocation}/site.xml"><?xml version="1.0" encoding="UTF-8"?> <site> ! <description;> The Ruby Development Tools nightly builds. </description> <feature url="features/org.rubypeople.rdt_${featureVersion}.jar" id="org.rubypeople.rdt" version="${featureVersion}"> <category name="RubyEclipseNightlyBuilds"/> </feature> --- 228,232 ---- <echo file="${UpdateSiteStagingLocation}/site.xml"><?xml version="1.0" encoding="UTF-8"?> <site> ! <description> The Ruby Development Tools nightly builds. </description> <feature url="features/org.rubypeople.rdt_${featureVersion}.jar" id="org.rubypeople.rdt" version="${featureVersion}"> <category name="RubyEclipseNightlyBuilds"/> </feature> |