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: <mir...@us...> - 2007-02-27 12:21:20
|
Revision: 2047
http://svn.sourceforge.net/rubyeclipse/?rev=2047&view=rev
Author: mirkostocker
Date: 2007-02-27 04:21:13 -0800 (Tue, 27 Feb 2007)
Log Message:
-----------
Add an open type dialog (ctrl+shift+t) like JDT has (ticket #6) and fix an off-by-one editor in the PositionBasedEditorOpener (the endposition included the newline).
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/plugin.properties
trunk/org.rubypeople.rdt.ui/plugin.xml
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/ActionMessages.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/ActionMessages.properties
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/util/PositionBasedEditorOpener.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.ui/icons/full/etool16/opentype.gif
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/OpenTypeAction.java
Added: trunk/org.rubypeople.rdt.ui/icons/full/etool16/opentype.gif
===================================================================
(Binary files differ)
Property changes on: trunk/org.rubypeople.rdt.ui/icons/full/etool16/opentype.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/org.rubypeople.rdt.ui/plugin.properties
===================================================================
--- trunk/org.rubypeople.rdt.ui/plugin.properties 2007-02-27 11:27:55 UTC (rev 2046)
+++ trunk/org.rubypeople.rdt.ui/plugin.properties 2007-02-27 12:21:13 UTC (rev 2047)
@@ -168,4 +168,6 @@
# Navigate Menu
##########################################################################
OpenAction.label=&Open
-OpenAction.tooltip=Open an Editor on the Selected Element
\ No newline at end of file
+OpenAction.tooltip=Open an Editor on the Selected Element
+OpenTypeAction.label=Open &Type...
+OpenTypeAction.tooltip=Open an Editor on a Type
\ No newline at end of file
Modified: trunk/org.rubypeople.rdt.ui/plugin.xml
===================================================================
--- trunk/org.rubypeople.rdt.ui/plugin.xml 2007-02-27 11:27:55 UTC (rev 2046)
+++ trunk/org.rubypeople.rdt.ui/plugin.xml 2007-02-27 12:21:13 UTC (rev 2047)
@@ -454,6 +454,11 @@
contextId="org.rubypeople.rdt.ui.rubyEditorScope"
commandId="org.rubypeople.rdt.ui.edit.text.ruby.open.editor"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
+ <key
+ sequence="M1+M2+T"
+ contextId="org.rubypeople.rdt.ui.rubyEditorScope"
+ commandId="org.rubypeople.rdt.ui.edit.text.ruby.open.type"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
</extension>
<extension point="org.eclipse.ui.commands">
<category
@@ -527,12 +532,17 @@
name="%ActionDefinition.gotoMatchingBracket.name">
</command>
<command
- name="%ActionDefinition.openEditor.name"
+ categoryId="org.eclipse.ui.category.navigate"
description="%ActionDefinition.openEditor.description"
+ id="org.rubypeople.rdt.ui.edit.text.ruby.open.editor"
+ name="%ActionDefinition.openEditor.name">
+ </command>
+ <command
categoryId="org.eclipse.ui.category.navigate"
- id="org.rubypeople.rdt.ui.edit.text.ruby.open.editor">
+ id="org.rubypeople.rdt.ui.edit.text.ruby.open.type"
+ name="%OpenTypeAction.label">
</command>
- <command
+ <command
name="%ActionDefinition.toggleComment.name"
description="%ActionDefinition.toggleComment.description"
categoryId="org.rubypeople.rdt.ui.category.source"
@@ -654,6 +664,15 @@
allowLabelUpdate="true"
id="org.rubypeople.rdt.ui.actions.Open">
</action>
+ <action
+ class="org.rubypeople.rdt.ui.actions.OpenTypeAction"
+ definitionId="org.rubypeople.rdt.ui.edit.text.ruby.open.type"
+ id="org.rubypeople.rdt.ui.actions.OpenType"
+ label="%OpenTypeAction.label"
+ icon="icons/full/etool16/opentype.gif"
+ menubarPath="navigate/open.ext"
+ tooltip="%OpenTypeAction.tooltip">
+ </action>
</actionSet>
</extension>
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/ActionMessages.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/ActionMessages.java 2007-02-27 11:27:55 UTC (rev 2046)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/ActionMessages.java 2007-02-27 12:21:13 UTC (rev 2047)
@@ -48,6 +48,9 @@
public static String ActionUtil_notOnBuildPath_title;
public static String ActionUtil_notOnBuildPath_message;
public static String OpenWithMenu_label;
+ public static String OpenTypeAction_error_title;
+ public static String OpenTypeAction_error_messageProblems;
+ public static String OpenTypeAction_message;
static {
NLS.initializeMessages(BUNDLE_NAME, ActionMessages.class);
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/ActionMessages.properties
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/ActionMessages.properties 2007-02-27 11:27:55 UTC (rev 2046)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/ActionMessages.properties 2007-02-27 12:21:13 UTC (rev 2047)
@@ -24,6 +24,10 @@
OpenAction_error_messageBadSelection=Current text selection does not resolve to a Ruby element
OpenAction_error_messageProblems=Problems Opening Editor
+OpenTypeAction_error_title=Open Type
+OpenTypeAction_error_messageProblems=Problems Opening Type
+OpenTypeAction_message=Select a type to open (? = any character, * = any string):
+
MemberFilterActionGroup_hide_fields_label=Hide Fiel&ds
MemberFilterActionGroup_hide_fields_tooltip=Hide Fields
MemberFilterActionGroup_hide_fields_description=Toggles the visibility of fields
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/util/PositionBasedEditorOpener.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/util/PositionBasedEditorOpener.java 2007-02-27 11:27:55 UTC (rev 2046)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/util/PositionBasedEditorOpener.java 2007-02-27 12:21:13 UTC (rev 2047)
@@ -28,7 +28,7 @@
IDocument document = editor.getDocumentProvider().getDocument(editor.getEditorInput());
int start = position.getStartOffset();
int end = position.getEndOffset();
- editor.selectAndReveal(start, end-start+1);
+ editor.selectAndReveal(start, end-start);
}
}
Added: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/OpenTypeAction.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/OpenTypeAction.java (rev 0)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/OpenTypeAction.java 2007-02-27 12:21:13 UTC (rev 2047)
@@ -0,0 +1,57 @@
+package org.rubypeople.rdt.ui.actions;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.PartInitException;
+import org.rubypeople.rdt.core.IRubyElement;
+import org.rubypeople.rdt.core.RubyModelException;
+import org.rubypeople.rdt.internal.ui.actions.ActionMessages;
+import org.rubypeople.rdt.internal.ui.rubyeditor.EditorUtility;
+import org.rubypeople.rdt.ui.wizards.RubyTypeSelectionDialog;
+
+public class OpenTypeAction implements IWorkbenchWindowActionDelegate {
+
+ private IWorkbenchWindow window;
+
+ public void dispose() {
+ this.window = null;
+ }
+
+ public void init(IWorkbenchWindow window) {
+ this.window = window;
+ }
+
+ public void run(IAction action) {
+
+ RubyTypeSelectionDialog dialog = new RubyTypeSelectionDialog(window.getShell());
+ dialog.setMessage(ActionMessages.OpenTypeAction_message);
+
+ if (dialog.open() == Window.OK) {
+ IRubyElement selected = (IRubyElement) dialog.getFirstResult();
+ try {
+ IEditorPart editor = EditorUtility.openInEditor(selected, true);
+ EditorUtility.revealInEditor(editor, selected);
+ } catch (PartInitException e) {
+ showError(e);
+ } catch (RubyModelException e) {
+ showError(e);
+ }
+ }
+ }
+
+ private void showError(CoreException e) {
+ ErrorDialog.openError(window.getShell(),
+ ActionMessages.OpenTypeAction_error_title,
+ ActionMessages.OpenTypeAction_error_messageProblems,
+ e.getStatus());
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cal...@us...> - 2007-02-27 11:28:15
|
Revision: 2046
http://svn.sourceforge.net/rubyeclipse/?rev=2046&view=rev
Author: callandor1983
Date: 2007-02-27 03:27:55 -0800 (Tue, 27 Feb 2007)
Log Message:
-----------
Caching of generated ASTs partialy implemented.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/NodeProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodConfig.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/DocumentProvider.java
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/NodeProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/NodeProvider.java 2007-02-26 22:47:32 UTC (rev 2045)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/NodeProvider.java 2007-02-27 11:27:55 UTC (rev 2046)
@@ -62,14 +62,11 @@
import org.jruby.ast.types.INameNode;
import org.jruby.common.NullWarnings;
import org.jruby.lexer.yacc.LexerSource;
-import org.jruby.lexer.yacc.SourcePosition;
import org.jruby.lexer.yacc.SyntaxException;
import org.jruby.parser.DefaultRubyParser;
-import org.jruby.parser.LocalStaticScope;
import org.jruby.parser.RubyParserConfiguration;
import org.jruby.parser.RubyParserPool;
import org.jruby.parser.RubyParserResult;
-import org.jruby.runtime.DynamicScope;
import org.rubypeople.rdt.refactoring.nodewrapper.AttrAccessorNodeWrapper;
import org.rubypeople.rdt.refactoring.nodewrapper.FieldNodeWrapper;
import org.rubypeople.rdt.refactoring.nodewrapper.MethodCallNodeWrapper;
@@ -112,15 +109,10 @@
}
public static RootNode getRootNode(String fileName, String fileContent) {
- if(fileContent == null) {
- return null;
- }
-
try {
- return parseFile(fileName, fileContent);
+ return (fileContent != null) ? parseFile(fileName, fileContent) : null;
} catch(SyntaxException e) {
-// treat files with syntax errors as empty
- return new RootNode(new SourcePosition(), new DynamicScope(new LocalStaticScope(null), null), null);
+ return null;
}
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodConditionChecker.java 2007-02-26 22:47:32 UTC (rev 2045)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodConditionChecker.java 2007-02-27 11:27:55 UTC (rev 2046)
@@ -38,6 +38,7 @@
import org.jruby.ast.types.INameNode;
import org.jruby.parser.StaticScope;
import org.rubypeople.rdt.refactoring.classnodeprovider.IncludedClassesProvider;
+import org.rubypeople.rdt.refactoring.core.NodeProvider;
import org.rubypeople.rdt.refactoring.core.RefactoringConditionChecker;
import org.rubypeople.rdt.refactoring.core.SelectionNodeProvider;
import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
@@ -47,6 +48,7 @@
public class InlineMethodConditionChecker extends RefactoringConditionChecker {
private InlineMethodConfig config;
+
public InlineMethodConditionChecker(InlineMethodConfig config) {
super(config.getDocumentProvider(),config);
@@ -58,6 +60,7 @@
if(!(findSelectedCall(config.getPos()) && findTargetClass(config.getTargetClassFinder()) && findMethodDefinition())) {
return;
}
+ config.setCellParent(NodeProvider.findParentNode(config.getDocumentProvider().getRootNode(), config.getSelectedCall().getWrappedNode()));
replaceParameters();
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodConfig.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodConfig.java 2007-02-26 22:47:32 UTC (rev 2045)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodConfig.java 2007-02-27 11:27:55 UTC (rev 2046)
@@ -32,7 +32,6 @@
import org.jruby.ast.MethodDefNode;
import org.jruby.ast.Node;
-import org.rubypeople.rdt.refactoring.core.NodeProvider;
import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
import org.rubypeople.rdt.refactoring.nodewrapper.MethodCallNodeWrapper;
@@ -47,6 +46,7 @@
private int pos;
private ITargetClassFinder targetClassFinder;
private Collection<String> usedMembers;
+ private Node cellParent;
public InlineMethodConfig(DocumentProvider doc, int pos, ITargetClassFinder targetClassFinder) {
@@ -56,8 +56,12 @@
}
public Node getCallParent() {
- return NodeProvider.findParentNode(originalDocument.getRootNode(), selectedCall.getWrappedNode());
+ return cellParent;
}
+
+ public void setCellParent(Node cellParent) {
+ this.cellParent = cellParent;
+ }
public String getClassName() {
return className;
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/DocumentProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/DocumentProvider.java 2007-02-26 22:47:32 UTC (rev 2045)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/DocumentProvider.java 2007-02-27 11:27:55 UTC (rev 2046)
@@ -42,6 +42,8 @@
public abstract class DocumentProvider implements IDocumentProvider {
+ private RootNode rootNode;
+
public ClassNodeProvider getClassNodeProvider() {
return new ClassNodeProvider(this);
}
@@ -55,6 +57,10 @@
}
public RootNode getRootNode() {
+// if(rootNode == null) {
+// rootNode = NodeProvider.getRootNode(getActiveFileName(), getActiveFileContent());
+// }
+// return rootNode;
return NodeProvider.getRootNode(getActiveFileName(), getActiveFileContent());
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mir...@us...> - 2007-02-26 22:47:34
|
Revision: 2045
http://svn.sourceforge.net/rubyeclipse/?rev=2045&view=rev
Author: mirkostocker
Date: 2007-02-26 14:47:32 -0800 (Mon, 26 Feb 2007)
Log Message:
-----------
Add a filter for the nodes in the AstView, inspired by http://jmesnil.net/weblog/2007/02/26/add-a-filter-to-a-treeviewer/
Modified Paths:
--------------
trunk/org.rubypeople.rdt.astviewer/src/org/rubypeople/rdt/astviewer/views/AstView.java
Modified: trunk/org.rubypeople.rdt.astviewer/src/org/rubypeople/rdt/astviewer/views/AstView.java
===================================================================
--- trunk/org.rubypeople.rdt.astviewer/src/org/rubypeople/rdt/astviewer/views/AstView.java 2007-02-26 20:32:39 UTC (rev 2044)
+++ trunk/org.rubypeople.rdt.astviewer/src/org/rubypeople/rdt/astviewer/views/AstView.java 2007-02-26 22:47:32 UTC (rev 2045)
@@ -59,6 +59,8 @@
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.FilteredTree;
+import org.eclipse.ui.dialogs.PatternFilter;
import org.eclipse.ui.part.DrillDownAdapter;
import org.eclipse.ui.part.ViewPart;
import org.jruby.ast.Node;
@@ -80,8 +82,11 @@
public void createPartControl(Composite parent) {
sashForm = new SashForm(parent, SWT.NONE);
sashForm.setOrientation(SWT.VERTICAL);
-
- viewer = new TreeViewer(sashForm, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
+ PatternFilter patternFilter = new PatternFilter();
+ final FilteredTree filter = new FilteredTree(sashForm, SWT.MULTI
+ | SWT.H_SCROLL | SWT.V_SCROLL, patternFilter);
+
+ viewer = filter.getViewer();
drillDownAdapter = new DrillDownAdapter(viewer);
viewContentProvider = new ViewContentProvider(getViewSite());
viewer.setContentProvider(viewContentProvider);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-26 20:32:41
|
Revision: 2044
http://svn.sourceforge.net/rubyeclipse/?rev=2044&view=rev
Author: cawilliams
Date: 2007-02-26 12:32:39 -0800 (Mon, 26 Feb 2007)
Log Message:
-----------
don't default to post qualify types. Turn on post qualified types in Ruby browsing Types View
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/browsing/TypesView.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/viewsupport/AppearanceAwareLabelProvider.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/browsing/TypesView.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/browsing/TypesView.java 2007-02-26 20:16:29 UTC (rev 2043)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/browsing/TypesView.java 2007-02-26 20:32:39 UTC (rev 2044)
@@ -9,6 +9,7 @@
import org.rubypeople.rdt.internal.ui.viewsupport.RubyElementImageProvider;
import org.rubypeople.rdt.internal.ui.viewsupport.RubyUILabelProvider;
import org.rubypeople.rdt.ui.PreferenceConstants;
+import org.rubypeople.rdt.ui.RubyElementLabels;
public class TypesView extends RubyBrowsingPart {
@@ -30,7 +31,7 @@
protected RubyUILabelProvider createLabelProvider() {
return new AppearanceAwareLabelProvider(
- AppearanceAwareLabelProvider.DEFAULT_TEXTFLAGS,
+ AppearanceAwareLabelProvider.DEFAULT_TEXTFLAGS | RubyElementLabels.T_POST_QUALIFIED,
AppearanceAwareLabelProvider.DEFAULT_IMAGEFLAGS
| RubyElementImageProvider.SMALL_ICONS);
}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/viewsupport/AppearanceAwareLabelProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/viewsupport/AppearanceAwareLabelProvider.java 2007-02-26 20:16:29 UTC (rev 2043)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/viewsupport/AppearanceAwareLabelProvider.java 2007-02-26 20:32:39 UTC (rev 2044)
@@ -23,7 +23,7 @@
*/
public class AppearanceAwareLabelProvider extends RubyUILabelProvider implements IPropertyChangeListener {
- public final static long DEFAULT_TEXTFLAGS= RubyElementLabels.M_PARAMETER_NAMES | RubyElementLabels.T_POST_QUALIFIED | RubyElementLabels.ROOT_VARIABLE | RubyElementLabels.REFERENCED_ROOT_POST_QUALIFIED;
+ public final static long DEFAULT_TEXTFLAGS= RubyElementLabels.M_PARAMETER_NAMES | RubyElementLabels.ROOT_VARIABLE | RubyElementLabels.REFERENCED_ROOT_POST_QUALIFIED;
public final static int DEFAULT_IMAGEFLAGS= RubyElementImageProvider.OVERLAY_ICONS;
private long fTextFlagMask;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-26 20:16:33
|
Revision: 2043
http://svn.sourceforge.net/rubyeclipse/?rev=2043&view=rev
Author: cawilliams
Date: 2007-02-26 12:16:29 -0800 (Mon, 26 Feb 2007)
Log Message:
-----------
start merging our two interfaces with constants for launching. I've modified the new IRubylaunchConfigurationConstants to use the old strings when possible (the only exception is RUBY_CONTAINER_PATH which would break with old values anyways).
Marked all the old constants deprecated that had new equivalents.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyLaunchConfigurationAttribute.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IRubyLaunchConfigurationConstants.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyLaunchConfigurationAttribute.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyLaunchConfigurationAttribute.java 2007-02-26 18:56:47 UTC (rev 2042)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyLaunchConfigurationAttribute.java 2007-02-26 20:16:29 UTC (rev 2043)
@@ -1,18 +1,59 @@
package org.rubypeople.rdt.internal.launching;
+import org.rubypeople.rdt.launching.IRubyLaunchConfigurationConstants;
+/**
+ * @deprecated Please use the externally visible IRubyLaunchConfigurationConstants
+ *
+ */
public interface RubyLaunchConfigurationAttribute {
- static final String RUBY_LAUNCH_CONFIGURATION_TYPE = "org.rubypeople.rdt.launching.LaunchConfigurationTypeRubyApplication";
+
+ /**
+ * @deprecated Please use <code>IRubyLaunchConfigurationConstants.ID_RUBY_APPLICATION</code>
+ */
+ static final String RUBY_LAUNCH_CONFIGURATION_TYPE = IRubyLaunchConfigurationConstants.ID_RUBY_APPLICATION;
- static final String CUSTOM_LOAD_PATH = LaunchingPlugin.PLUGIN_ID + ".CUSTOM_LOAD_PATH";
- static final String FILE_NAME = LaunchingPlugin.PLUGIN_ID + ".FILE_NAME";
- static final String INTERPRETER_ARGUMENTS = LaunchingPlugin.PLUGIN_ID + ".INTERPRETER_ARGUMENTS";
- static final String MODULE_NAME = LaunchingPlugin.PLUGIN_ID + ".MODULE_NAME";
- static final String PROGRAM_ARGUMENTS = LaunchingPlugin.PLUGIN_ID + ".PROGRAM_ARGUMENTS";
- static final String PROJECT_NAME = LaunchingPlugin.PLUGIN_ID + ".PROJECT_NAME";
- static final String SELECTED_INTERPRETER = LaunchingPlugin.PLUGIN_ID + ".SELECTED_INTERPRETER";
- static final String WORKING_DIRECTORY = LaunchingPlugin.PLUGIN_ID + ".WORKING_DIRECTORY";
- static final String USE_DEFAULT_LOAD_PATH = LaunchingPlugin.PLUGIN_ID + ".USE_DEFAULT_LOAD_PATH";
+ /**
+ * @deprecated Please use <code>IRubyLaunchConfigurationConstants.ATTR_LOADPATH</code>
+ */
+ static final String CUSTOM_LOAD_PATH = IRubyLaunchConfigurationConstants.ATTR_LOADPATH;
+
+ /**
+ * @deprecated Please use <code>IRubyLaunchConfigurationConstants.ATTR_FILE_NAME</code>
+ */
+ static final String FILE_NAME = IRubyLaunchConfigurationConstants.ATTR_FILE_NAME;
+
+ /**
+ * @deprecated Please use <code>IRubyLaunchConfigurationConstants.ATTR_VM_ARGUMENTS</code>
+ */
+ static final String INTERPRETER_ARGUMENTS = IRubyLaunchConfigurationConstants.ATTR_VM_ARGUMENTS;
+
+ /**
+ * @deprecated Please use <code>IRubyLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS</code>
+ */
+ static final String PROGRAM_ARGUMENTS = IRubyLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS;
+
+ /**
+ * @deprecated Please use <code>IRubyLaunchConfigurationConstants.ATTR_PROJECT_NAME</code>
+ */
+ static final String PROJECT_NAME = IRubyLaunchConfigurationConstants.ATTR_PROJECT_NAME;
+
+ /**
+ * @deprecated Please use <code>IRubyLaunchConfigurationConstants.ATTR_RUBY_CONTAINER_PATH</code>
+ */
+ static final String SELECTED_INTERPRETER = IRubyLaunchConfigurationConstants.ATTR_RUBY_CONTAINER_PATH;
+
+ /**
+ * @deprecated Please use <code>IRubyLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY</code>
+ */
+ static final String WORKING_DIRECTORY = IRubyLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY;
+
+ /**
+ * @deprecated Please use <code>IRubyLaunchConfigurationConstants.ATTR_DEFAULT_LOADPATH</code>
+ */
+ static final String USE_DEFAULT_LOAD_PATH = IRubyLaunchConfigurationConstants.ATTR_DEFAULT_LOADPATH;
+
+
static final String USE_DEFAULT_WORKING_DIRECTORY = LaunchingPlugin.PLUGIN_ID + ".USE_DEFAULT_WORKING_DIRECTORY";
}
\ No newline at end of file
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IRubyLaunchConfigurationConstants.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IRubyLaunchConfigurationConstants.java 2007-02-26 18:56:47 UTC (rev 2042)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IRubyLaunchConfigurationConstants.java 2007-02-26 20:16:29 UTC (rev 2043)
@@ -5,6 +5,12 @@
public interface IRubyLaunchConfigurationConstants {
/**
+ * Identifier for the Local Ruby Application launch configuration type
+ * (value <code>"org.rubypeople.rdt.launching.LaunchConfigurationTypeRubyApplication"</code>).
+ */
+ public static final String ID_RUBY_APPLICATION = LaunchingPlugin.getUniqueIdentifier() + ".LaunchConfigurationTypeRubyApplication"; //$NON-NLS-1$
+
+ /**
* Status code indicating a launch configuration does not
* specify a file to launch.
*/
@@ -88,14 +94,14 @@
/**
- * Launch configuration attribute key. The value is a path identifying the JRE used
+ * Launch configuration attribute key. The value is a path identifying the RubyVM used
* when launching a local VM. The path is a loadpath container corresponding
* to the <code>RubyRuntime.RUBY_CONTAINER</code> loadpath container.
* <p>
- * When unspecified the default JRE for a launch configuration is used (which is the
- * JRE associated with the project being launched, or the workspace default JRE when
- * no project is associated with a configuration). The default JRE loadpath container
- * refers explicitly to the workspace default JRE.
+ * When unspecified the default RubyVM for a launch configuration is used (which is the
+ * RubyVM associated with the project being launched, or the workspace default RubyVM when
+ * no project is associated with a configuration). The default RubyVM loadpath container
+ * refers explicitly to the workspace default RubyVM.
* </p>
* @since 0.9.0
*/
@@ -134,7 +140,7 @@
* VM arguments for a Ruby launch configuration, as they should appear
* on the command line.
*/
- public static final String ATTR_VM_ARGUMENTS = LaunchingPlugin.getUniqueIdentifier() + ".VM_ARGUMENTS"; //$NON-NLS-1$
+ public static final String ATTR_VM_ARGUMENTS = LaunchingPlugin.getUniqueIdentifier() + ".INTERPRETER_ARGUMENTS"; //$NON-NLS-1$
/**
* Launch configuration attribute key. The value is a string specifying a
@@ -174,12 +180,12 @@
/**
* Launch configuration attribute key. The value is a boolean specifying
* whether a default loadpath should be used when launching a local
- * Java application. When <code>false</code>, a loadpath must be specified
- * via the <code>ATTR_CLASSPATH</code> attribute. When <code>true</code> or
+ * Ruby application. When <code>false</code>, a loadpath must be specified
+ * via the <code>ATTR_LOADPATH</code> attribute. When <code>true</code> or
* unspecified, a loadpath is computed by the loadpath provider associated
* with a launch configuration.
*/
- public static final String ATTR_DEFAULT_LOADPATH = LaunchingPlugin.getUniqueIdentifier() + ".DEFAULT_LOADPATH"; //$NON-NLS-1$
+ public static final String ATTR_DEFAULT_LOADPATH = LaunchingPlugin.getUniqueIdentifier() + ".USE_DEFAULT_LOAD_PATH"; //$NON-NLS-1$
/**
* Launch configuration attribute key. The attribute value is an ordered list of strings
@@ -187,6 +193,6 @@
* loadpath is generated by the loadpath provider associated with a launch
* configuration (via the <code>ATTR_LOADPATH_PROVIDER</code> attribute).
*/
- public static final String ATTR_LOADPATH = LaunchingPlugin.getUniqueIdentifier() + ".LOADPATH"; //$NON-NLS-1$
+ public static final String ATTR_LOADPATH = LaunchingPlugin.getUniqueIdentifier() + ".CUSTOM_LOAD_PATH"; //$NON-NLS-1$
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java 2007-02-26 18:56:47 UTC (rev 2042)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java 2007-02-26 20:16:29 UTC (rev 2043)
@@ -1137,32 +1137,32 @@
* </ol>
* </p>
* @param configuration
- * @return loadpath container path identifying a JRE or <code>null</code>
+ * @return loadpath container path identifying a RubyVM or <code>null</code>
* @exception org.eclipse.core.runtime.CoreException if an exception occurs retrieving
* attributes from the specified launch configuration
* @since 0.9.0
*/
public static IRuntimeLoadpathEntry computeRubyVMEntry(ILaunchConfiguration configuration) throws CoreException {
- String jreAttr = configuration.getAttribute(IRubyLaunchConfigurationConstants.ATTR_RUBY_CONTAINER_PATH, (String)null);
+ String rubyVmAttr = configuration.getAttribute(IRubyLaunchConfigurationConstants.ATTR_RUBY_CONTAINER_PATH, (String)null);
IPath containerPath = null;
- if (jreAttr == null) {
+ if (rubyVmAttr == null) {
String type = configuration.getAttribute(IRubyLaunchConfigurationConstants.ATTR_VM_INSTALL_TYPE, (String)null);
if (type == null) {
- // default JRE for the launch configuration
+ // default RubyVM for the launch configuration
IRubyProject proj = getRubyProject(configuration);
if (proj == null) {
- containerPath = newDefaultJREContainerPath();
+ containerPath = newDefaultRubyVMContainerPath();
} else {
return computeRubyVMEntry(proj);
}
} else {
String name = configuration.getAttribute(IRubyLaunchConfigurationConstants.ATTR_VM_INSTALL_NAME, (String)null);
if (name != null) {
- containerPath = newDefaultJREContainerPath().append(type).append(name);
+ containerPath = newDefaultRubyVMContainerPath().append(type).append(name);
}
}
} else {
- containerPath = Path.fromPortableString(jreAttr);
+ containerPath = Path.fromPortableString(rubyVmAttr);
}
if (containerPath != null) {
return newRuntimeContainerLoadpathEntry(containerPath, IRuntimeLoadpathEntry.STANDARD_CLASSES);
@@ -1226,7 +1226,7 @@
* @return loadpath container path
* @since 0.9.0
*/
- public static IPath newDefaultJREContainerPath() {
+ public static IPath newDefaultRubyVMContainerPath() {
return new Path(RUBY_CONTAINER);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-26 18:57:03
|
Revision: 2042
http://svn.sourceforge.net/rubyeclipse/?rev=2042&view=rev
Author: cawilliams
Date: 2007-02-26 10:56:47 -0800 (Mon, 26 Feb 2007)
Log Message:
-----------
add the RubyHyperLink stuff into plugin.xml to enable it. Clean up the code. Make the underlying code like the F3 - Go to Declaration stuff...
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/plugin.xml
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/OpenActionUtil.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/SelectionConverter.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/hyperlinks/RubyElementsHyperlinkProvider.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/hyperlinks/RubyHyperLinkDetector.java
Modified: trunk/org.rubypeople.rdt.ui/plugin.xml
===================================================================
--- trunk/org.rubypeople.rdt.ui/plugin.xml 2007-02-26 16:23:47 UTC (rev 2041)
+++ trunk/org.rubypeople.rdt.ui/plugin.xml 2007-02-26 18:56:47 UTC (rev 2042)
@@ -939,5 +939,12 @@
contentMergeViewerId="org.rubypeople.rdt.internal.ui.RubyMergeViewer"
contentTypeId="org.rubypeople.rdt.core.rubySource"/>
</extension>
+
+ <extension
+ point="org.rubypeople.rdt.ui.hyperlinkProvider">
+ <hyperlinkProvider
+ class="org.rubypeople.rdt.internal.ui.text.hyperlinks.RubyElementsHyperlinkProvider">
+ </hyperlinkProvider>
+ </extension>
</plugin>
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/OpenActionUtil.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/OpenActionUtil.java 2007-02-26 16:23:47 UTC (rev 2041)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/OpenActionUtil.java 2007-02-26 18:56:47 UTC (rev 2042)
@@ -9,7 +9,6 @@
import org.rubypeople.rdt.core.RubyModelException;
import org.rubypeople.rdt.internal.ui.rubyeditor.EditorUtility;
import org.rubypeople.rdt.ui.RubyElementLabelProvider;
-import org.rubypeople.rdt.ui.RubyElementLabels;
public class OpenActionUtil {
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/SelectionConverter.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/SelectionConverter.java 2007-02-26 16:23:47 UTC (rev 2041)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/SelectionConverter.java 2007-02-26 18:56:47 UTC (rev 2042)
@@ -59,15 +59,19 @@
}
public static IRubyElement[] codeResolve(IRubyElement input, ITextSelection selection) throws RubyModelException {
+ return codeResolve(input, selection.getOffset(), selection.getLength());
+ }
+
+ public static IRubyElement[] codeResolve(IRubyElement input, int offset, int length) throws RubyModelException {
if (input instanceof ICodeAssist) {
if (input instanceof IRubyScript) {
RubyModelUtil.reconcile((IRubyScript) input);
}
- IRubyElement[] elements= ((ICodeAssist)input).codeSelect(selection.getOffset(), selection.getLength());
+ IRubyElement[] elements= ((ICodeAssist)input).codeSelect(offset, length);
if (elements != null && elements.length > 0)
return elements;
}
return EMPTY_RESULT;
-}
+ }
}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/hyperlinks/RubyElementsHyperlinkProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/hyperlinks/RubyElementsHyperlinkProvider.java 2007-02-26 16:23:47 UTC (rev 2041)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/hyperlinks/RubyElementsHyperlinkProvider.java 2007-02-26 18:56:47 UTC (rev 2042)
@@ -1,125 +1,76 @@
package org.rubypeople.rdt.internal.ui.text.hyperlinks;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.hyperlink.IHyperlink;
import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
import org.jruby.ast.Node;
-import org.rubypeople.rdt.core.IMember;
import org.rubypeople.rdt.core.IRubyElement;
import org.rubypeople.rdt.core.IRubyScript;
-import org.rubypeople.rdt.core.ISourceRange;
import org.rubypeople.rdt.core.RubyModelException;
-import org.rubypeople.rdt.internal.codeassist.SelectionEngine;
import org.rubypeople.rdt.internal.ui.RubyPlugin;
+import org.rubypeople.rdt.internal.ui.actions.OpenActionUtil;
+import org.rubypeople.rdt.internal.ui.actions.SelectionConverter;
import org.rubypeople.rdt.internal.ui.text.RubyWordFinder;
import org.rubypeople.rdt.ui.IWorkingCopyManager;
import org.rubypeople.rdt.ui.text.hyperlinks.IHyperlinkProvider;
public class RubyElementsHyperlinkProvider implements IHyperlinkProvider {
- public RubyElementsHyperlinkProvider (){}
+ public RubyElementsHyperlinkProvider() {}
- class RubyElementsHyperlink implements IHyperlink {
- private IRegion fRegion;
- private final IEditorInput fEditorInput;
- private final IRubyElement[] fElements;
+ class RubyElementsHyperlink implements IHyperlink {
+ private IRegion fRegion;
+ private final IRubyElement[] fElements;
- public RubyElementsHyperlink(IEditorInput editorInput, IRegion region, String symbol, IRubyElement[] elements) {
- this.fEditorInput = editorInput;
-// fRegion = new Region(region.getOffset(), 5);
- fRegion = region;
- this.fElements = elements;
- }
+ public RubyElementsHyperlink(IRegion region, IRubyElement[] elements) {
+ fRegion = region;
+ this.fElements = elements;
+ }
- public IRegion getHyperlinkRegion() {
- return fRegion;
- }
+ public IRegion getHyperlinkRegion() {
+ return fRegion;
+ }
- public String getHyperlinkText() {
- // TODO Auto-generated method stub
- return null;
- }
+ public String getHyperlinkText() {
+ // TODO Auto-generated method stub
+ return null;
+ }
- public String getTypeLabel() {
- // TODO Auto-generated method stub
- return null;
- }
+ public String getTypeLabel() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ public void open() {
+ try {
+ // FIXME Check for first element which is an instanceof of
+ // IMember, don't just try to access the first element!
+ if (fElements != null && fElements.length > 0) {
+ OpenActionUtil.open(fElements[0], true);
+ }
+ } catch (PartInitException e) {
+ RubyPlugin.log(e);
+ } catch (RubyModelException e) {
+ RubyPlugin.log(e);
+ }
+ }
+ }
- public void open() {
- try {
- // FIXME Check for first element which is an instanceof of IMember, don't just try to access the first element!
- if(fElements != null && fElements.length > 0){
- ISourceRange sourceRange = ((IMember) fElements[0]).getSourceRange();
- IFile file = null;
- if (fEditorInput instanceof IFileEditorInput) {
- IFileEditorInput fileInput = (IFileEditorInput) fEditorInput;
- file = fileInput.getFile();
- }
- openFileAndLocation(sourceRange, file);
- }
- } catch (PartInitException e) {
- RubyPlugin.log(e);
- } catch (RubyModelException e) {
- RubyPlugin.log(e);
- } catch (CoreException e) {
- RubyPlugin.log(e);
- }
- }
-
- private void openFileAndLocation(ISourceRange sourceRange, IFile file)
- throws PartInitException, CoreException {
- if (file == null) {
- return;
- }
- if (sourceRange == null) {
- return;
- }
- IEditorPart editorPart = IDE.openEditor(PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow().getActivePage(), file, true);
-
- IMarker mark = file.createMarker(IMarker.TEXT);
- mark.setAttribute(IMarker.CHAR_START, sourceRange.getOffset());
- mark.setAttribute(IMarker.CHAR_END, sourceRange.getOffset()
- + sourceRange.getLength());
- IDE.gotoMarker(editorPart, mark);
- mark.delete();
- IDE.gotoMarker(editorPart, mark);
- }
-
- }
-
-
- public IHyperlink getHyperlink(IEditorInput input, ITextViewer textViewer, Node node,
- IRegion region, boolean canShowMultipleHyperlinks) {
- IRegion newRegion = RubyWordFinder.findWord(textViewer.getDocument(), region.getOffset());
- try {
- String symbol = textViewer.getDocument().get(newRegion.getOffset(), newRegion.getLength());
- // Let's see if this is a RubyElement
- SelectionEngine engine = new SelectionEngine();
- IWorkingCopyManager manager = RubyPlugin.getDefault().getWorkingCopyManager();
- IRubyScript script = manager.getWorkingCopy(input);
- IRubyElement[] elements = engine.select(script, newRegion.getOffset(), newRegion.getOffset() + newRegion.getLength());
- if(elements == null){
- return null;
- }
- if(elements.length > 0){
- // TODO: check if it's a RubyElement, if not, return null
- return new RubyElementsHyperlink(input, newRegion, symbol, elements);
- }
- return null;
- } catch (Exception e) {
- RubyPlugin.log(e);
- }
- return null;
- }
+ public IHyperlink getHyperlink(IEditorInput input, ITextViewer textViewer, Node node, IRegion region, boolean canShowMultipleHyperlinks) {
+ IRegion newRegion = RubyWordFinder.findWord(textViewer.getDocument(), region.getOffset());
+ try {
+ IWorkingCopyManager manager = RubyPlugin.getDefault().getWorkingCopyManager();
+ IRubyScript script = manager.getWorkingCopy(input);
+ IRubyElement[] elements = SelectionConverter.codeResolve(script, newRegion.getOffset(), newRegion.getLength());
+ if (elements == null || elements.length == 0) {
+ return null;
+ }
+ return new RubyElementsHyperlink(newRegion, elements);
+ } catch (Exception e) {
+ RubyPlugin.log(e);
+ }
+ return null;
+ }
}
\ No newline at end of file
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/hyperlinks/RubyHyperLinkDetector.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/hyperlinks/RubyHyperLinkDetector.java 2007-02-26 16:23:47 UTC (rev 2041)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/hyperlinks/RubyHyperLinkDetector.java 2007-02-26 18:56:47 UTC (rev 2042)
@@ -26,106 +26,85 @@
public class RubyHyperLinkDetector implements IHyperlinkDetector {
- public static final String RDT_UI_NAMESPACE = "org.rubypeople.rdt.ui";
- public static final String RDT_UI_HYPERLINKPROVIDER = "hyperlinkProvider";
+ public static final String RDT_UI_NAMESPACE = "org.rubypeople.rdt.ui";
+ public static final String RDT_UI_HYPERLINKPROVIDER = "hyperlinkProvider";
+ private List fExtensions;
+ private final IEditorInput fEditorInput;
- private List fExtensions;
- private final IEditorInput fEditorInput;
+ public RubyHyperLinkDetector(IEditorInput editorInput) {
+ this.fEditorInput = editorInput;
+ }
+ private IExtensionPoint[] getExtensionPoints() {
+ IExtensionRegistry reg = Platform.getExtensionRegistry();
+ return reg.getExtensionPoints(RDT_UI_NAMESPACE);
+ }
- public RubyHyperLinkDetector(IEditorInput editorInput) {
- this.fEditorInput = editorInput;
- }
+ private List initExtensions() {
+ if (fExtensions != null)
+ return fExtensions;
+ fExtensions = new ArrayList();
+ IExtensionPoint[] points = getExtensionPoints();
+ // TODO: Look for textProvider!
+ IExtensionPoint point = getExtensionPoint(points);
+ if (point != null) {
+ IExtension[] exts = point.getExtensions();
+ for (int i = 0; i < exts.length; i++) {
+ IConfigurationElement[] elem = exts[i].getConfigurationElements();
+ String attrs[] = elem[0].getAttributeNames();
+ try {
+ Object tempProv = elem[0].createExecutableExtension("class");
+ if (tempProv instanceof IHyperlinkProvider) {
+ IHyperlinkProvider prov = (IHyperlinkProvider) tempProv;
+ fExtensions.add(prov);
+ }
+ } catch (Exception e) {
+ RubyPlugin.log(e);
+ }
+ }
+ }
+ return fExtensions;
+ }
- private List initExtensions() {
- if(fExtensions == null){
- fExtensions = new ArrayList();
- IExtensionRegistry reg = Platform.getExtensionRegistry();
- IExtensionPoint[] points = reg.getExtensionPoints(RDT_UI_NAMESPACE);
- // TODO: Look for textProvider!
- IExtensionPoint point = null;
+ private IExtensionPoint getExtensionPoint(IExtensionPoint[] points) {
+ for (int i = 0; i < points.length; i++) {
+ IExtensionPoint currentPoint = points[i];
+ String uniqueIdentifier = currentPoint.getUniqueIdentifier();
+ if (uniqueIdentifier.endsWith(RDT_UI_HYPERLINKPROVIDER)) {
+ return currentPoint;
+ }
+ }
+ return null;
+ }
- if(points != null){
- for (int i = 0; i < points.length; i++) {
- IExtensionPoint currentPoint = points[i];
- String uniqueIdentifier = currentPoint.getUniqueIdentifier();
- if(uniqueIdentifier.endsWith(RDT_UI_HYPERLINKPROVIDER)){
- point = currentPoint;
- break;
- }
- }
+ public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {
+ IRegion newRegion = region;
+ List extensions = initExtensions();
+ // first ask the extensions
+ if (extensions.size() > 0) {
+ SelectionEngine engine = new SelectionEngine();
+ IWorkingCopyManager manager = RubyPlugin.getDefault().getWorkingCopyManager();
+ IRubyScript script = manager.getWorkingCopy(fEditorInput);
+ RubyParser parser = new RubyParser();
+ try {
+ Node root = parser.parse((IFile) script.getResource(), new StringReader(script.getSource()));
+ for (int i = 0; i < extensions.size(); i++) {
+ IHyperlinkProvider currentProvider = (IHyperlinkProvider) extensions.get(i);
+ IHyperlink link = currentProvider.getHyperlink(fEditorInput, textViewer, root, newRegion, true);
+ // TODO: either do that or query all HyperlinkProviders and
+ // return a list of hyperlinks?
+ if (link != null) {
+ return new IHyperlink[] { link };
+ }
+ }
+ } catch (RubyModelException e) {
+ RubyPlugin.log(e);
+ }
+ }
- if(point != null){
- IExtension[] exts = point.getExtensions();
+ return null;
- IHyperlinkProvider prov = null;
+ }
- for (int i = 0; i < exts.length; i++) {
- IConfigurationElement[] elem = exts[i].getConfigurationElements();
- String attrs[] = elem[0].getAttributeNames();
- try {
- Object tempProv = elem[0].createExecutableExtension("class");
- if (tempProv instanceof IHyperlinkProvider) {
- prov = (IHyperlinkProvider) tempProv;
- fExtensions.add(prov);
- }
-// }
- } catch (Exception e) {
- RubyPlugin.log(e);
- }
-
- }
- }
- }
-
- }
- return fExtensions;
-
- }
-
-
-
- public IHyperlink[] detectHyperlinks(ITextViewer textViewer,
- IRegion region, boolean canShowMultipleHyperlinks) {
- String symbol = "";
- IRegion newRegion = region;
-// newRegion = RubyWordFinder.findWord(textViewer.getDocument(), region.getOffset());
-// try {
-// symbol = textViewer.getDocument().get(newRegion.getOffset(), newRegion.getLength());
-// } catch (BadLocationException e) {
-// // TODO Auto-generated catch block
-// e.printStackTrace();
-// }
-// System.out.println("Symbol:" + symbol);
-// return new IHyperlink[]{new RubyHyperLinkDetector(fEditorInput, newRegion, symbol)};
-
- List extensions = initExtensions();
-// final String symbol = textViewer.getDocument().get(hoverRegion.getOffset(), hoverRegion.getLength());
- // first ask the extensions
- if(extensions.size() > 0){
- SelectionEngine engine = new SelectionEngine();
- IWorkingCopyManager manager = RubyPlugin.getDefault().getWorkingCopyManager();
- IRubyScript script = manager.getWorkingCopy(fEditorInput);
- RubyParser parser = new RubyParser();
- try {
- Node root = parser.parse((IFile) script.getResource(),new StringReader(script.getSource()));
- // IRubyElement[] elements = engine.select(script, newRegion.getOffset(), newRegion.getOffset() + newRegion.getLength());
- for(int i=0; i< extensions.size(); i++){
- IHyperlinkProvider currentProvider = (IHyperlinkProvider) extensions.get(i);
- IHyperlink link = currentProvider.getHyperlink(fEditorInput, textViewer, root, newRegion, true);
- // TODO: either do that or query all HyperlinkProviders and return a list of hyperlinks?
- if(link != null){
- return new IHyperlink[]{link};
- }
- }
- } catch (RubyModelException e) {
- RubyPlugin.log(e);
- }
- }
-
- return null;
-
- }
-
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-26 16:23:55
|
Revision: 2041
http://svn.sourceforge.net/rubyeclipse/?rev=2041&view=rev
Author: cawilliams
Date: 2007-02-26 08:23:47 -0800 (Mon, 26 Feb 2007)
Log Message:
-----------
add to the What's New page (add 0.7.0, 0.8.0 and 0.9.0)
Modified Paths:
--------------
trunk/org.rubypeople.rdt.doc.user/docbook.xml
Modified: trunk/org.rubypeople.rdt.doc.user/docbook.xml
===================================================================
--- trunk/org.rubypeople.rdt.doc.user/docbook.xml 2007-02-26 15:51:57 UTC (rev 2040)
+++ trunk/org.rubypeople.rdt.doc.user/docbook.xml 2007-02-26 16:23:47 UTC (rev 2041)
@@ -873,6 +873,70 @@
</chapter>
<chapter id="WhatsNew">
<title>What's new</title>
+ <para>New in RDT 0.9.0:</para>
+ <itemizedlist>
+ <listitem> Adds an initial catalog of refactorings thanks to Mirko Stocker, Thomas Corbat, and Lukas Felber.</listitem>
+ <listitem> Better integration with Ruby interpreters: Now integrates loadpaths of the interpreter in backend, also hooks core libraries and standard libraries into the model for code completion/go to declaration, etc.</listitem>
+ <listitem> Preliminary support for ruby-debug as the debugging backend</listitem>
+ <listitem> Generate constructor</listitem>
+ <listitem> Generate accessors</listitem>
+ <listitem> Improved code completion</listitem>
+ <listitem> Integration of type inferrencing work done by Jason morrison for Google Summer of Code</listitem>
+ <listitem> Initial version of Mark occurences support</listitem>
+ <listitem> Goto Declaration(F3) support</listitem>
+ <listitem> Hyperlink navigation in source code - similar to F3 - Go To Declaration. Hold Ctrl (or Apple key on macs) and hover over source. Click a link to be taken to it's source.</listitem>
+ <listitem> Integration with latest JRuby parser: speedier, positioning fixes</listitem>
+ <listitem> Syntax coloring of the Merge/compare view</listitem>
+ </itemizedlist>
+
+ <para>New in RDT 0.8.0:</para>
+ <itemizedlist>
+ <listitem> Compatible with Eclipse 3.1 and 3.2</listitem>
+ <listitem> New Ruby Browsing Perspective</listitem>
+ <listitem> New Class Wizard</listitem>
+ <listitem> Apply code formatting (indentation) to templates</listitem>
+ <listitem> Auto-insertion of templates</listitem>
+ <listitem> Distinct syntax highlighting of globals</listitem>
+ <listitem> Distinct syntax highlighting of instance/class variables</listitem>
+ <listitem> Goto matching bracket action</listitem>
+ <listitem> Right-clicking on "ruler" to left of ruby file's contents now allows user to add bookmark or task</listitem>
+ <listitem> Auto-extend comments under particular conditions (abov method/class/module definitions, above attr_, above alias, above constant assignment, as first lines of file)</listitem>
+ <listitem> Allow user to customize font used by Ruby Editor</listitem>
+ <listitem> Allow user to turn on/off smart auto-closing of strings, brackets and braces on new preference page (was always enabled by default before)</listitem>
+ <listitem> A number of bugfixes (see <ulink url="http://rubyeclipse.mktec.com/cgi-bin/trac.py/query?status=closed&milestone=0.8.0&type=defect&order=priority">http://rubyeclipse.mktec.com/cgi-bin/trac.py/query?status=closed&milestone=0.8.0&type=defect&order=priority</ulink>)</listitem>
+ </itemizedlist>
+
+ <para>New in RDT 0.7.0:</para>
+ <itemizedlist>
+ <listitem> Multiple debugger session possible because a free port will be used for the debugger communication. The port is written to a
+ temporary file and conveyed to the ruby process with "-r<tmpFile>". The fixed port used in the past (1098) is still the default
+ port in the case that a temporary file can not be created</listitem>
+ <listitem> Catchpoints:
+ <itemizedlist>
+ <listitem> The default was to halt at every type of StandardError, the new default is *not* to halt when exceptions are raised</listitem>
+ <listitem> There is a menu entry in the debug perspective and a toolbar button in the breakpoint view which starts the Catchpoint dialog</listitem>
+ <listitem> The catchpoint dialog allows to add a ruby exception breakpoint</listitem>
+ <listitem> There can be at most one exception breakpoint; the breakpoint can be enabled, disabled and removed in the breakpoint view</listitem>
+ <listitem> Added ability to distinctly color characters</listitem>
+ <listitem> Added ability to distinctly color Fixnums (numbers)</listitem>
+ <listitem> Added ability to distinctly color Symbols</listitem>
+ </itemizedlist> </listitem>
+ <listitem> Fixed arguments in alias template to refer to methods in ocrrect order (first arg is new name, second is old)</listitem>
+ <listitem> Always suggests Kernel methods (unless user has typed text which would eliminate all of them as possibilities)</listitem>
+ <listitem> Suggest Class and Module names from current project and any projects referenced by it</listitem>
+ <listitem> Added outline support for aliasing methods using the format 'alias :new_method :old_method'</listitem>
+ <listitem> Fixed bug where current visibility was never reset when opening a new class</listitem>
+ <listitem> Fix broken link between RubyProjects and RubyScripts. RubyProjects didn't properly find and add all RubyScripts as children.
+ It should do so now (according to RubyFileMatcher's behavior).</listitem>
+ <listitem> Started to implement ElementChangeListeners/RubyDelta/RubyModelOperation core model machinery</listitem>
+ <listitem> Now allows code folding of class methods (self.method)</listitem>
+ <listitem> Now updates code folding points as user edits the ruby script</listitem>
+ <listitem> Double-click now selects text more logically (Try double-clicking a method call or variable in a method chain.
+ It used to select until it hit a space or bracket. Now it will stop at periods as well [and more characters too])</listitem>
+ <listitem> New extension point for template proposals</listitem>
+ <listitem> New extension point for text hovers </listitem>
+ </itemizedlist>
+
<para>New in RDT 0.6.0:</para>
<itemizedlist>
<listitem> Code folding </listitem>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mir...@us...> - 2007-02-26 15:52:00
|
Revision: 2040
http://svn.sourceforge.net/rubyeclipse/?rev=2040&view=rev
Author: mirkostocker
Date: 2007-02-26 07:51:57 -0800 (Mon, 26 Feb 2007)
Log Message:
-----------
Copy the CompareResultDialog from JUnit and adapt to the testunit plug-in. Also change the RemoteTestRunner.rb to spit out the actual/expected text (I hope my solution is ok). I often have to compare text diffs in my tests and it annoyed me that we didn't have this feature, so here it is :)
Modified Paths:
--------------
trunk/org.rubypeople.rdt.testunit/META-INF/MANIFEST.MF
trunk/org.rubypeople.rdt.testunit/ruby/RemoteTestRunner.rb
trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/CompareResultsAction.java
trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestHierarchyTab.java
trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestUnitMessages.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/CompareResultDialog.java
Modified: trunk/org.rubypeople.rdt.testunit/META-INF/MANIFEST.MF
===================================================================
--- trunk/org.rubypeople.rdt.testunit/META-INF/MANIFEST.MF 2007-02-26 15:31:48 UTC (rev 2039)
+++ trunk/org.rubypeople.rdt.testunit/META-INF/MANIFEST.MF 2007-02-26 15:51:57 UTC (rev 2040)
@@ -21,5 +21,7 @@
org.eclipse.ui.workbench.texteditor,
org.eclipse.text,
org.jruby,
- org.eclipse.ui.ide
+ org.eclipse.ui.ide,
+ org.eclipse.compare,
+ org.eclipse.jface.text
Eclipse-LazyStart: true
Modified: trunk/org.rubypeople.rdt.testunit/ruby/RemoteTestRunner.rb
===================================================================
--- trunk/org.rubypeople.rdt.testunit/ruby/RemoteTestRunner.rb 2007-02-26 15:31:48 UTC (rev 2039)
+++ trunk/org.rubypeople.rdt.testunit/ruby/RemoteTestRunner.rb 2007-02-26 15:51:57 UTC (rev 2040)
@@ -106,6 +106,26 @@
def start_mediator # :nodoc:
return @mediator.run_suite
end
+
+ def convert_newlines(str)
+ str.gsub("\\n", "\n").gsub("\\r", "\r")
+ end
+
+ def output_actual(msg)
+ output_single("%ACTUALS \n")
+ msg =~ /<"(.*)">\.$/
+ actual = convert_newlines($1)
+ output_single("#{actual}\n")
+ output_single("%ACTUALE \n")
+ end
+
+ def output_expected(msg)
+ output_single("%EXPECTS \n")
+ msg =~ /^<"(.*?)">/
+ expected = convert_newlines($1)
+ output_single("#{expected}\n")
+ output_single("%EXPECTE \n")
+ end
def add_fault(fault) # :nodoc:
@faults << fault
@@ -118,6 +138,12 @@
header = "Exception: #{fault.exception.message}"
stack_trace = get_trace(fault.exception.backtrace)
end
+
+ if fault.message =~ /^<".*?">.*<".*?">\.$/m
+ output_actual(fault.message)
+ output_expected(fault.message)
+ end
+
output_single("#{fault_type}#{@last_test_id},#{@last_test_name}\n")
output_single("%TRACES \n")
output_single("#{header}\n")
Added: trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/CompareResultDialog.java
===================================================================
--- trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/CompareResultDialog.java (rev 0)
+++ trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/CompareResultDialog.java 2007-02-26 15:51:57 UTC (rev 2040)
@@ -0,0 +1,220 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 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.internal.testunit.ui;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+
+import org.eclipse.compare.CompareConfiguration;
+import org.eclipse.compare.CompareViewerPane;
+import org.eclipse.compare.IEncodedStreamContentAccessor;
+import org.eclipse.compare.ITypedElement;
+import org.eclipse.compare.contentmergeviewer.TextMergeViewer;
+import org.eclipse.compare.structuremergeviewer.DiffNode;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.TrayDialog;
+import org.eclipse.jface.text.DocumentEvent;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITypedRegion;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.TextAttribute;
+import org.eclipse.jface.text.TextPresentation;
+import org.eclipse.jface.text.TextViewer;
+import org.eclipse.jface.text.presentation.IPresentationDamager;
+import org.eclipse.jface.text.presentation.IPresentationReconciler;
+import org.eclipse.jface.text.presentation.IPresentationRepairer;
+import org.eclipse.jface.text.presentation.PresentationReconciler;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.SourceViewer;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
+public class CompareResultDialog extends TrayDialog {
+ private static class CompareResultMergeViewer extends TextMergeViewer {
+ private CompareResultMergeViewer(Composite parent, int style, CompareConfiguration configuration) {
+ super(parent, style, configuration);
+ }
+
+ protected void createControls(Composite composite) {
+ super.createControls(composite);
+ //PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IJUnitHelpContextIds.RESULT_COMPARE_DIALOG);
+ }
+
+ protected void configureTextViewer(TextViewer textViewer) {
+ if (textViewer instanceof SourceViewer) {
+ ((SourceViewer)textViewer).configure(new CompareResultViewerConfiguration());
+ }
+ }
+ }
+
+ public static class CompareResultViewerConfiguration extends SourceViewerConfiguration {
+ public static class SimpleDamagerRepairer implements IPresentationDamager, IPresentationRepairer {
+ private IDocument fDocument;
+
+ public void setDocument(IDocument document) {
+ fDocument= document;
+ }
+
+ public IRegion getDamageRegion(ITypedRegion partition, DocumentEvent event, boolean changed) {
+ return new Region(0, fDocument.getLength());
+ }
+
+ public void createPresentation(TextPresentation presentation, ITypedRegion damage) {
+ int suffix= CompareResultDialog.fgThis.fSuffix;
+ int prefix= CompareResultDialog.fgThis.fPrefix;
+ TextAttribute attr= new TextAttribute(Display.getDefault().getSystemColor(SWT.COLOR_RED), null, SWT.BOLD);
+ presentation.addStyleRange(new StyleRange(prefix, fDocument.getLength()-suffix-prefix, attr.getForeground(), attr.getBackground(), attr.getStyle()));
+ }
+ }
+
+ public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
+ PresentationReconciler reconciler= new PresentationReconciler();
+ SimpleDamagerRepairer dr= new SimpleDamagerRepairer();
+ reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
+ reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
+ return reconciler;
+ }
+ }
+
+ private static class CompareElement implements ITypedElement, IEncodedStreamContentAccessor {
+ private String fContent;
+
+ public CompareElement(String content) {
+ fContent= content;
+ }
+ public String getName() {
+ return "<no name>"; //$NON-NLS-1$
+ }
+ public Image getImage() {
+ return null;
+ }
+ public String getType() {
+ return "txt"; //$NON-NLS-1$
+ }
+ public InputStream getContents() {
+ try {
+ return new ByteArrayInputStream(fContent.getBytes("UTF-8")); //$NON-NLS-1$
+ } catch (UnsupportedEncodingException e) {
+ return new ByteArrayInputStream(fContent.getBytes());
+ }
+ }
+ public String getCharset() throws CoreException {
+ return "UTF-8"; //$NON-NLS-1$
+ }
+ }
+
+ private TextMergeViewer fViewer;
+ private String fExpected;
+ private String fActual;
+ private String fTestName;
+
+ /* workaround - to make prefix and suffix accessible to the CompareResultViewerConfiguration */
+ private static CompareResultDialog fgThis;
+
+ private int fPrefix;
+ private int fSuffix;
+
+ public CompareResultDialog(Shell parentShell, TestRunInfo element) {
+ super(parentShell);
+ fgThis= this;
+ setShellStyle(getShellStyle() | SWT.RESIZE | SWT.MAX);
+ fTestName= element.getTestName();
+ fExpected= element.getExpected();
+ fActual= element.getActual();
+ computePrefixSuffix();
+ }
+
+ private void computePrefixSuffix() {
+ int end= Math.min(fExpected.length(), fActual.length());
+ int i= 0;
+ for(; i < end; i++)
+ if (fExpected.charAt(i) != fActual.charAt(i))
+ break;
+ fPrefix= i;
+
+ int j= fExpected.length()-1;
+ int k= fActual.length()-1;
+ int l= 0;
+ for (; k >= fPrefix && j >= fPrefix; k--,j--) {
+ if (fExpected.charAt(j) != fActual.charAt(k))
+ break;
+ l++;
+ }
+ fSuffix= l;
+ }
+
+ protected void configureShell(Shell newShell) {
+ super.configureShell(newShell);
+ newShell.setText(TestUnitMessages.CompareResultDialog_title);
+ //PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, IJUnitHelpContextIds.RESULT_COMPARE_DIALOG);
+ }
+
+ protected void createButtonsForButtonBar(Composite parent) {
+ createButton(parent, IDialogConstants.OK_ID, TestUnitMessages.CompareResultDialog_labelOK, true);
+ }
+
+ protected Control createDialogArea(Composite parent) {
+ Composite composite = (Composite)super.createDialogArea(parent);
+ GridLayout layout= new GridLayout();
+ layout.numColumns= 1;
+ composite.setLayout(layout);
+
+ CompareViewerPane pane = new CompareViewerPane(composite, SWT.BORDER | SWT.FLAT);
+ pane.setText(fTestName);
+ GridData data= new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
+ data.widthHint= convertWidthInCharsToPixels(120);
+ data.heightHint= convertHeightInCharsToPixels(13);
+ pane.setLayoutData(data);
+
+ Control previewer= createPreviewer(pane);
+ pane.setContent(previewer);
+ GridData gd= new GridData(GridData.FILL_BOTH);
+ previewer.setLayoutData(gd);
+ applyDialogFont(parent);
+ return composite;
+ }
+
+ private Control createPreviewer(Composite parent) {
+ final CompareConfiguration compareConfiguration= new CompareConfiguration();
+ compareConfiguration.setLeftLabel(TestUnitMessages.CompareResultDialog_expectedLabel);
+ compareConfiguration.setLeftEditable(false);
+ compareConfiguration.setRightLabel(TestUnitMessages.CompareResultDialog_actualLabel);
+ compareConfiguration.setRightEditable(false);
+ compareConfiguration.setProperty(CompareConfiguration.IGNORE_WHITESPACE, Boolean.FALSE);
+
+ fViewer= new CompareResultMergeViewer(parent, SWT.NONE, compareConfiguration);
+ fViewer.setInput(new DiffNode(
+ new CompareElement(fExpected),
+ new CompareElement(fActual)));
+
+ Control control= fViewer.getControl();
+ control.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ if (compareConfiguration != null)
+ compareConfiguration.dispose();
+ }
+ });
+ return control;
+ }
+}
Modified: trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/CompareResultsAction.java
===================================================================
--- trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/CompareResultsAction.java 2007-02-26 15:31:48 UTC (rev 2039)
+++ trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/CompareResultsAction.java 2007-02-26 15:51:57 UTC (rev 2040)
@@ -18,8 +18,11 @@
public class CompareResultsAction extends Action {
+ private final FailureTrace fView;
+
public CompareResultsAction(FailureTrace view) {
super(TestUnitMessages.CompareResultsAction_label);
+ this.fView = view;
setDescription(TestUnitMessages.CompareResultsAction_description);
setToolTipText(TestUnitMessages.CompareResultsAction_tooltip);
@@ -33,8 +36,8 @@
*/
public void run() {
// TODO Allow comparison of results
-// CompareResultDialog dialog = new CompareResultDialog(fView.getShell(), fView.getFailedTest());
-// dialog.create();
-// dialog.open();
+ CompareResultDialog dialog = new CompareResultDialog(fView.getShell(), fView.getFailedTest());
+ dialog.create();
+ dialog.open();
}
}
\ No newline at end of file
Modified: trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestHierarchyTab.java
===================================================================
--- trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestHierarchyTab.java 2007-02-26 15:31:48 UTC (rev 2039)
+++ trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestHierarchyTab.java 2007-02-26 15:51:57 UTC (rev 2040)
@@ -411,7 +411,6 @@
if (testInfo == null)
return;
- String testLabel= testInfo.getTestName();
IAction action = null;
Shell shell = fTree.getShell();
@@ -427,9 +426,6 @@
public void menuAboutToShow(IMenuManager manager) {
if (fTree.getSelectionCount() > 0) {
- TreeItem treeItem = fTree.getSelection()[0];
- TestRunInfo testInfo = (TestRunInfo) treeItem.getData();
- String testLabel = testInfo.getTestName();
Shell shell = fTree.getShell();
ISymbolFinder symbolFinder = RubyCore.getPlugin().getSymbolFinder();
if (isSuiteSelected()) {
Modified: trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestUnitMessages.java
===================================================================
--- trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestUnitMessages.java 2007-02-26 15:31:48 UTC (rev 2039)
+++ trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestUnitMessages.java 2007-02-26 15:51:57 UTC (rev 2040)
@@ -63,6 +63,10 @@
public static String TestRunnerViewPart_message_finish;
public static String TestRunnerViewPart_message_started;
public static String TestRunnerViewPart_configName;
+ public static String CompareResultDialog_expectedLabel;
+ public static String CompareResultDialog_actualLabel;
+ public static String CompareResultDialog_labelOK;
+ public static String CompareResultDialog_title;
static {
NLS.initializeMessages(BUNDLE_NAME, TestUnitMessages.class);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-26 15:31:54
|
Revision: 2039
http://svn.sourceforge.net/rubyeclipse/?rev=2039&view=rev
Author: cawilliams
Date: 2007-02-26 07:31:48 -0800 (Mon, 26 Feb 2007)
Log Message:
-----------
some minor edits of the new help text for refactorings.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.doc.user/docbook.xml
Modified: trunk/org.rubypeople.rdt.doc.user/docbook.xml
===================================================================
--- trunk/org.rubypeople.rdt.doc.user/docbook.xml 2007-02-26 13:26:59 UTC (rev 2038)
+++ trunk/org.rubypeople.rdt.doc.user/docbook.xml 2007-02-26 15:31:48 UTC (rev 2039)
@@ -241,18 +241,19 @@
</section>
<section id="EncapsulateField">
<title>Encapsulate Field</title>
- <para>The Encapsulate Field refactoring means that you take a field and
- hide access to it behind getter and setter methods. This can be done for
- external access as well as from inside the class.</para>
+ <para>The Encapsulate Field refactoring encapsulates a field by
+ hiding access to the field behind getter and setter methods. This is often
+ used to enable external access, but can be useful to encapsulate a field
+ internally within a class.</para>
</section>
<section id="ExtractMethod">
<title>Extract Method</title>
- <para>Extract Method removes a block of instructions out of an existing method
- and creates a new one, that contains this functionality. The new method
- will be called from the existing one where the instructions have been
- removed. The local variables from the existing method that are used in
- the affected code block are passed to the new method as parameters.
- If one of those local variables is set inside the selected block it will
+ <para>Extract Method removes a block of statements and moves them into a
+ new method that contains this functionality. The new method
+ will be called from the location where the original statements appeared.
+ Any local variables in scope of the extracted code that are used by the
+ affected statements are passed to the new method as parameters.
+ If one of those local variables is set inside the extracted block it will
be returned from the new method as its return value.</para>
</section>
<section id="GenerateAccessors">
@@ -260,8 +261,8 @@
<para>Generate Accessors can be used to generate getter and setter methods for
fields of a class. The user can choose whether reader and / or writers
are generated and if they should be inserted as methods or in the short
- form using <varname>attr_reader</varname>, <varname>attr_writer</varname>
- or <varname>attr_accessor</varname>.</para>
+ form (using <varname>attr_reader</varname>, <varname>attr_writer</varname>
+ or <varname>attr_accessor</varname>).</para>
</section>
<section id="GenerateConstructorUsingFields">
<title>Generate Constructor using Fields</title>
@@ -273,9 +274,9 @@
</section>
<section id="InlineClass">
<title>Inline Class</title>
- <para>The Inline Class refactoring integrates the code from a usually small class which
- had not much functionality into another class. Usually the target class uses
- the inlined one.</para>
+ <para>The Inline Class refactoring integrates the code from an existing class (which
+ typically has few responsibilities) into another class. Typically the target class uses
+ the inlined class.</para>
</section>
<section id="InlineMethod">
<title>Inline Method</title>
@@ -287,20 +288,19 @@
<section id="InlineTemp">
<title>Inline Temp</title>
<para>The Inline Temp refactoring replaces all occurrences of a local variable with the value
- it got assigned once. Furthermore the assignment is removed as it will not be used
- anymore. Usually this refactoring is used to simplify other refactorings or if it
- does not make sense to keep the variable as it makes the code just more complex.</para>
+ it was once assigned and removes the initial assignment. Usually this refactoring is
+ used to simplify the existing code and lay the groundowrk for future refactorings.</para>
</section>
<section id="MergeClassParts">
<title>Merge Class Parts</title>
- <para>The Merge Ruby Class Parts refactoring pulls class declarations together and merges them
- into one single part.</para>
+ <para>The Merge Ruby Class Parts refactoring pulls multiple class declarations together and merges them
+ into one single part. This is used to gather all instances of a re-opened class into a single area.</para>
</section>
<section id="MoveField">
<title>Move Field</title>
- <para>This refactoring moves, as its name says, a field from one class into another one. This
+ <para>This refactoring moves a field from one class into another one. This
is useful if you realize that the responsibility for a field is not in the owning class,
- but in another one. In this case, the field should better be moved to that class.</para>
+ but in another one. In this case, the field is better moved to the new class.</para>
</section>
<section id="MoveMethod">
<title>Move Method</title>
@@ -317,7 +317,7 @@
</section>
<section id="PushDownMethod">
<title>Push Down Method</title>
- <para>The Push Down Method refactoring removes a method from the super class and pastes it
+ <para>The Push Down Method refactoring removes a method from the super class and pushes it
into all its child classes.</para>
</section>
<section id="Rename">
@@ -326,10 +326,10 @@
</section>
<section id="SplitLocalVariable">
<title>Split Local Variable</title>
- <para>Programmers, especially inexperienced ones, sometimes tend to assign a temporary variable several
- times. The fact that Ruby does not have typed references might misleadingly encourage this.
- This is not recommendable because this means, that the temporary variable takes various
- responsibilities and thus can not be named properly. So the Split Temporary Variables refactoring
+ <para>Programmers sometimes tend to assign a temporary variable several
+ times (the fact that Ruby does not have typed references might misleadingly encourage this).
+ This is not recommendable because this means that the temporary variable takes various
+ responsibilities and thus can not be named properly. The Split Temporary Variables refactoring
helps avoiding this by creating a new temporary variable for each responsibility.</para>
</section>
</section>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-26 13:27:03
|
Revision: 2038
http://svn.sourceforge.net/rubyeclipse/?rev=2038&view=rev
Author: cawilliams
Date: 2007-02-26 05:26:59 -0800 (Mon, 26 Feb 2007)
Log Message:
-----------
fix broken test - we are getting null pointers ont he useDefaultWorkingDirectory button in tests, so I made a method to get the selection, and return null if the button is never created (as in tests)
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyArgumentsTab.java
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyArgumentsTab.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyArgumentsTab.java 2007-02-26 13:08:18 UTC (rev 2037)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyArgumentsTab.java 2007-02-26 13:26:59 UTC (rev 2038)
@@ -139,7 +139,7 @@
public boolean isValid(ILaunchConfiguration launchConfig) {
try {
String workingDirectory = launchConfig.getAttribute(RubyLaunchConfigurationAttribute.WORKING_DIRECTORY, "");
- if (!useDefaultWorkingDirectoryButton.getSelection() && workingDirectory.length() == 0) {
+ if (!useDefaultWorkingDirectoryButton() && workingDirectory.length() == 0) {
setErrorMessage(RdtDebugUiMessages.LaunchConfigurationTab_RubyArguments_working_dir_error_message);
return false;
}
@@ -151,6 +151,11 @@
return true;
}
+ private boolean useDefaultWorkingDirectoryButton() {
+ if (useDefaultWorkingDirectoryButton == null) return false;
+ return useDefaultWorkingDirectoryButton.getSelection();
+ }
+
protected void log(Throwable t) {
RdtDebugUiPlugin.log(t);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-26 13:08:21
|
Revision: 2037
http://svn.sourceforge.net/rubyeclipse/?rev=2037&view=rev
Author: cawilliams
Date: 2007-02-26 05:08:18 -0800 (Mon, 26 Feb 2007)
Log Message:
-----------
avoid outofboundsexception when the path is empty/doesn't produce any tokens in getTypesInImport
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/RubyElementRequestor.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/RubyElementRequestor.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/RubyElementRequestor.java 2007-02-26 12:19:47 UTC (rev 2036)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/RubyElementRequestor.java 2007-02-26 13:08:18 UTC (rev 2037)
@@ -97,7 +97,8 @@
List<String> tokens = new ArrayList<String>();
while(tokenizer.hasMoreTokens()) {
tokens.add(tokenizer.nextToken());
- }
+ }
+ if (tokens.isEmpty()) return new ArrayList<IType>();
String name = tokens.remove(tokens.size() - 1) + RUBY_FILE_EXTENSION;
String[] pckgs = (String[]) tokens.toArray(new String[tokens.size()]);
ISourceFolder folder = root.getSourceFolder(pckgs);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cal...@us...> - 2007-02-26 12:19:51
|
Revision: 2036
http://svn.sourceforge.net/rubyeclipse/?rev=2036&view=rev
Author: callandor1983
Date: 2007-02-26 04:19:47 -0800 (Mon, 26 Feb 2007)
Log Message:
-----------
SelectionNodeProvider generated wrong positions -> fixed
Modified Paths:
--------------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/SelectionNodeProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/ExtractMethodPage.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/enclosing_nodes_test_8.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/enclosing_nodes_test_8.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/rename/rename_test_12.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/rename/rename_test_12.test_properties
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/SelectionNodeProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/SelectionNodeProvider.java 2007-02-26 07:36:22 UTC (rev 2035)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/SelectionNodeProvider.java 2007-02-26 12:19:47 UTC (rev 2036)
@@ -96,11 +96,8 @@
Collection<Node> selectedNodes = getNodesFromTo(beginBlockChildNode, endBlockChildNode, blockChildren);
if(isNodeContainedInNode(selectedNodes.toArray(new Node[selectedNodes.size()])[0], enclosingNode)) {
- BlockNode blockAroundSelected = new BlockNode(NodeFactory.unionPositions(beginNode.getPosition(), endNode.getPosition()));
- for(Node node : selectedNodes) {
- blockAroundSelected.add(node);
- }
- blockAroundSelected.setPosition(NodeFactory.unionPositions(NodeProvider.unwrap(beginNode).getPosition(), NodeProvider.unwrap(endNode).getPosition()));
+ BlockNode blockAroundSelected = NodeFactory.createBlockNode(selectedNodes.toArray(new Node[0])); // new BlockNode(NodeFactory.unionPositions(NodeProvider.unwrap(beginNode).getPosition(), NodeProvider.unwrap(endNode).getPosition()));
+ blockAroundSelected.setPosition(NodeFactory.unionPositions(NodeProvider.unwrap(beginBlockChildNode).getPosition(), NodeProvider.unwrap(endBlockChildNode).getPosition()));
return blockAroundSelected;
} else if (beginNode.equals(endNode)) {
return beginNode;
@@ -108,7 +105,6 @@
return enclosingNode;
}
-
public static boolean isNodeContainedInNode(Node containedNode, Node containingNode) {
return (nodeContainsPosition(containingNode, containedNode.getPosition().getStartOffset())
&& nodeContainsPosition(containingNode, containedNode.getPosition().getEndOffset()));
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/ExtractMethodPage.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/ExtractMethodPage.java 2007-02-26 07:36:22 UTC (rev 2035)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/ExtractMethodPage.java 2007-02-26 12:19:47 UTC (rev 2036)
@@ -118,12 +118,13 @@
private void setupSelectionPreview() {
extractComposite.getCodeViewer().setPreviewText(selectionInformation.getSource());
- int start = extractedMethod.getSelectedNodes().getPosition().getStartOffset();
- int length = extractedMethod.getSelectedNodes().getPosition().getEndOffset() - start;
- extractComposite.getCodeViewer().setBackgroundColor(start, length, SWT.COLOR_GRAY);
+ int nodeStart = extractedMethod.getSelectedNodes().getPosition().getStartOffset();
+ int nodeLength = extractedMethod.getSelectedNodes().getPosition().getEndOffset() - nodeStart;
+ extractComposite.getCodeViewer().setBackgroundColor(nodeStart, nodeLength, SWT.COLOR_GRAY);
- extractComposite.getCodeViewer().setBackgroundColor(selectionInformation.getStartOfSelection(),
- selectionInformation.getEndOfSelection() - selectionInformation.getStartOfSelection(), SWT.COLOR_DARK_GRAY);
+ int selectionStart = selectionInformation.getStartOfSelection();
+ int selectionLength = selectionInformation.getEndOfSelection() - selectionStart + 1;
+ extractComposite.getCodeViewer().setBackgroundColor(selectionStart, selectionLength, SWT.COLOR_DARK_GRAY);
scrollToSelection();
}
Added: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/enclosing_nodes_test_8.rb
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/resources/core/enclosing_nodes_test_8.rb (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/resources/core/enclosing_nodes_test_8.rb 2007-02-26 12:19:47 UTC (rev 2036)
@@ -0,0 +1,6 @@
+class Test
+ def test
+ a = 5
+ b = 5 * a + 300
+ end
+end
Added: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/enclosing_nodes_test_8.test_properties
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/resources/core/enclosing_nodes_test_8.test_properties (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/resources/core/enclosing_nodes_test_8.test_properties 2007-02-26 12:19:47 UTC (rev 2036)
@@ -0,0 +1,3 @@
+begin=30
+end=43
+expected=BlockNode, NewlineNode, LocalAsgnNode, FixnumNode, NewlineNode, LocalAsgnNode, CallNode, CallNode, FixnumNode, ArrayNode, LocalVarNode, ArrayNode, FixnumNode
Added: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/rename/rename_test_12.source.rb
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/resources/core/rename/rename_test_12.source.rb (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/resources/core/rename/rename_test_12.source.rb 2007-02-26 12:19:47 UTC (rev 2036)
@@ -0,0 +1,5 @@
+class ClassVarRenaming
+ def test
+ @@var
+ end
+end
Added: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/rename/rename_test_12.test_properties
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/resources/core/rename/rename_test_12.test_properties (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/resources/core/rename/rename_test_12.test_properties 2007-02-26 12:19:47 UTC (rev 2036)
@@ -0,0 +1,4 @@
+cursorPosition=40
+#possible values: none, renameClass, renameMethod, renameField, renameLocal
+delegateRenameRefactoring=renameField
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mir...@us...> - 2007-02-26 07:36:25
|
Revision: 2035
http://svn.sourceforge.net/rubyeclipse/?rev=2035&view=rev
Author: mirkostocker
Date: 2007-02-25 23:36:22 -0800 (Sun, 25 Feb 2007)
Log Message:
-----------
Some documentation about the refactorings, just to get an overview.. it would be nice if a native english speaker could review it :)
Modified Paths:
--------------
trunk/org.rubypeople.rdt.doc.user/docbook.xml
Modified: trunk/org.rubypeople.rdt.doc.user/docbook.xml
===================================================================
--- trunk/org.rubypeople.rdt.doc.user/docbook.xml 2007-02-25 15:54:06 UTC (rev 2034)
+++ trunk/org.rubypeople.rdt.doc.user/docbook.xml 2007-02-26 07:36:22 UTC (rev 2035)
@@ -210,6 +210,129 @@
</warning>
</section>
</section>
+ <section id="Refactoring">
+ <title>Refactoring</title>
+ <para>RDT contains several automated refactorings for improving your code and
+ making some tasks easier, like the generation of accessors. The refactorings
+ are available through the menu bar as well as the context menu of the editor
+ and the outline view. The following refactorings are available:</para>
+ <itemizedlist>
+ <listitem>Convert Local Variable to Field</listitem>
+ <listitem>Encapsulate Field</listitem>
+ <listitem>Extract Method</listitem>
+ <listitem>Generate Accessors</listitem>
+ <listitem>Generate Constructor using Fields</listitem>
+ <listitem>Inline Class</listitem>
+ <listitem>Inline Method</listitem>
+ <listitem>Inline Temp</listitem>
+ <listitem>Merge Class Parts</listitem>
+ <listitem>Move Field</listitem>
+ <listitem>Move Method</listitem>
+ <listitem>Override Method</listitem>
+ <listitem>Push Down Method</listitem>
+ <listitem>Rename Class, Field, Method and Local Variable</listitem>
+ <listitem>Split Local Variable</listitem>
+ </itemizedlist>
+ <section id="ConvertLocalVariableToField">
+ <title>Convert Local Variable to Field</title>
+ <para>This refactoring converts a local variable into a field. This will
+ grant access to a variable that was only accessible inside a method or
+ block to the whole class.</para>
+ </section>
+ <section id="EncapsulateField">
+ <title>Encapsulate Field</title>
+ <para>The Encapsulate Field refactoring means that you take a field and
+ hide access to it behind getter and setter methods. This can be done for
+ external access as well as from inside the class.</para>
+ </section>
+ <section id="ExtractMethod">
+ <title>Extract Method</title>
+ <para>Extract Method removes a block of instructions out of an existing method
+ and creates a new one, that contains this functionality. The new method
+ will be called from the existing one where the instructions have been
+ removed. The local variables from the existing method that are used in
+ the affected code block are passed to the new method as parameters.
+ If one of those local variables is set inside the selected block it will
+ be returned from the new method as its return value.</para>
+ </section>
+ <section id="GenerateAccessors">
+ <title>Generate Accessors</title>
+ <para>Generate Accessors can be used to generate getter and setter methods for
+ fields of a class. The user can choose whether reader and / or writers
+ are generated and if they should be inserted as methods or in the short
+ form using <varname>attr_reader</varname>, <varname>attr_writer</varname>
+ or <varname>attr_accessor</varname>.</para>
+ </section>
+ <section id="GenerateConstructorUsingFields">
+ <title>Generate Constructor using Fields</title>
+ <para>The code generator Generate Constructor Using Fields creates a new constructor.
+ The constructor will have a variable number of arguments, which can be
+ selected from a list of the existing fields in the class. In the constructor's
+ body, the class fields will be initialized with the values of the constructor's
+ parameters.</para>
+ </section>
+ <section id="InlineClass">
+ <title>Inline Class</title>
+ <para>The Inline Class refactoring integrates the code from a usually small class which
+ had not much functionality into another class. Usually the target class uses
+ the inlined one.</para>
+ </section>
+ <section id="InlineMethod">
+ <title>Inline Method</title>
+ <para>The Inline Method refactoring removes a method and replaces the call with its content.
+ This might make sense if you have almost empty methods without much logic, perhaps
+ after applying other refactorings. Generally having multiple methods with clear
+ names is better than one big chunk of code.</para>
+ </section>
+ <section id="InlineTemp">
+ <title>Inline Temp</title>
+ <para>The Inline Temp refactoring replaces all occurrences of a local variable with the value
+ it got assigned once. Furthermore the assignment is removed as it will not be used
+ anymore. Usually this refactoring is used to simplify other refactorings or if it
+ does not make sense to keep the variable as it makes the code just more complex.</para>
+ </section>
+ <section id="MergeClassParts">
+ <title>Merge Class Parts</title>
+ <para>The Merge Ruby Class Parts refactoring pulls class declarations together and merges them
+ into one single part.</para>
+ </section>
+ <section id="MoveField">
+ <title>Move Field</title>
+ <para>This refactoring moves, as its name says, a field from one class into another one. This
+ is useful if you realize that the responsibility for a field is not in the owning class,
+ but in another one. In this case, the field should better be moved to that class.</para>
+ </section>
+ <section id="MoveMethod">
+ <title>Move Method</title>
+ <para>The Move Method refactoring behaves almost like the Move Field refactoring, except that it
+ moves methods instead of fields. This is useful if you come across a method in a class
+ that is not really responsible for the functionality provided by this method.</para>
+ </section>
+ <section id="OverrideMethod">
+ <title>Override Method</title>
+ <para>The Override Method code generator creates method bodies for a class. You can
+ choose among the methods of the super class and those methods will be overridden
+ in the class. The added methods will have the same signature as the one from the
+ super class and call super.</para>
+ </section>
+ <section id="PushDownMethod">
+ <title>Push Down Method</title>
+ <para>The Push Down Method refactoring removes a method from the super class and pastes it
+ into all its child classes.</para>
+ </section>
+ <section id="Rename">
+ <title>Rename Class, Field, Method and Local Variable</title>
+ <para>The rename refactorings can be used to change the name of various elements of your code.</para>
+ </section>
+ <section id="SplitLocalVariable">
+ <title>Split Local Variable</title>
+ <para>Programmers, especially inexperienced ones, sometimes tend to assign a temporary variable several
+ times. The fact that Ruby does not have typed references might misleadingly encourage this.
+ This is not recommendable because this means, that the temporary variable takes various
+ responsibilities and thus can not be named properly. So the Split Temporary Variables refactoring
+ helps avoiding this by creating a new temporary variable for each responsibility.</para>
+ </section>
+ </section>
<section id ="ConsoleView">
<title>Console View</title>
<para>The console view contains the output of a program. If the
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mba...@us...> - 2007-02-25 15:54:13
|
Revision: 2034
http://svn.sourceforge.net/rubyeclipse/?rev=2034&view=rev
Author: mbarchfe
Date: 2007-02-25 07:54:06 -0800 (Sun, 25 Feb 2007)
Log Message:
-----------
new ruby-debug gem
Added Paths:
-----------
trunk/org.rubypeople.rdt.launching/ruby-debug-0.8.gem
Removed Paths:
-------------
trunk/org.rubypeople.rdt.launching/ruby-debug-0.6.gem
Deleted: trunk/org.rubypeople.rdt.launching/ruby-debug-0.6.gem
===================================================================
(Binary files differ)
Added: trunk/org.rubypeople.rdt.launching/ruby-debug-0.8.gem
===================================================================
(Binary files differ)
Property changes on: trunk/org.rubypeople.rdt.launching/ruby-debug-0.8.gem
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mba...@us...> - 2007-02-25 15:51:17
|
Revision: 2033
http://svn.sourceforge.net/rubyeclipse/?rev=2033&view=rev
Author: mbarchfe
Date: 2007-02-25 07:51:04 -0800 (Sun, 25 Feb 2007)
Log Message:
-----------
return workingDirectoryPath only if the config attribute is not empty => the default working directory will be used
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractRubyLaunchConfigurationDelegate.java
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractRubyLaunchConfigurationDelegate.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractRubyLaunchConfigurationDelegate.java 2007-02-25 15:48:39 UTC (rev 2032)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractRubyLaunchConfigurationDelegate.java 2007-02-25 15:51:04 UTC (rev 2033)
@@ -180,7 +180,7 @@
String path = configuration.getAttribute(
IRubyLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY,
(String) null);
- if (path != null) {
+ if (path != null && path.length() > 0) {
path = VariablesPlugin.getDefault().getStringVariableManager()
.performStringSubstitution(path);
return new Path(path);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mba...@us...> - 2007-02-25 15:48:45
|
Revision: 2032
http://svn.sourceforge.net/rubyeclipse/?rev=2032&view=rev
Author: mbarchfe
Date: 2007-02-25 07:48:39 -0800 (Sun, 25 Feb 2007)
Log Message:
-----------
fix setting/clearing of catch point
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/actions/ModifyCatchpointAction.java
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/actions/ModifyCatchpointAction.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/actions/ModifyCatchpointAction.java 2007-02-25 15:47:31 UTC (rev 2031)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/actions/ModifyCatchpointAction.java 2007-02-25 15:48:39 UTC (rev 2032)
@@ -57,11 +57,11 @@
try {
if (existingBreakpoint == null) {
IBreakpoint breakpoint = new RubyExceptionBreakpoint(dialog.getException());
- DebugPlugin.getDefault().getBreakpointManager().addBreakpoint(breakpoint) ;
}
else {
+ // This will modify the Breakpoint marker as well which then triggers a
+ // ResourceChange event which will be delivered to the RubyDebugTarget
existingBreakpoint.setException(dialog.getException()) ;
- DebugPlugin.getDefault().getBreakpointManager().fireBreakpointChanged(existingBreakpoint) ;
}
} catch (CoreException e) {
RdtDebugCorePlugin.log(e) ;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mba...@us...> - 2007-02-25 15:47:33
|
Revision: 2031
http://svn.sourceforge.net/rubyeclipse/?rev=2031&view=rev
Author: mbarchfe
Date: 2007-02-25 07:47:31 -0800 (Sun, 25 Feb 2007)
Log Message:
-----------
call "set trace" on startup so that we get a RubyProcessingException when eval fails
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/commands/RubyDebugConnection.java
Modified: trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/commands/RubyDebugConnection.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/commands/RubyDebugConnection.java 2007-02-25 15:46:32 UTC (rev 2030)
+++ trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/commands/RubyDebugConnection.java 2007-02-25 15:47:31 UTC (rev 2031)
@@ -35,13 +35,14 @@
try {
evalResult = command.getEvalReader().readEvalResult();
} catch (RubyProcessingException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ RdtDebugCorePlugin.log(e) ;
}
if (evalResult == null || !evalResult.equals("true")) {
// TODO: go on ?
throw new DebuggerNotFoundException("Could not add extension to ruby debug") ;
}
+ // set trace: show stack trace if evaluation fails
+ new GenericCommand("set trace", true).execute(this) ;
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mba...@us...> - 2007-02-25 15:47:06
|
Revision: 2030
http://svn.sourceforge.net/rubyeclipse/?rev=2030&view=rev
Author: mbarchfe
Date: 2007-02-25 07:46:32 -0800 (Sun, 25 Feb 2007)
Log Message:
-----------
suspension handling
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/model/RubyThread.java
Modified: trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/model/RubyThread.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/model/RubyThread.java 2007-02-25 15:45:48 UTC (rev 2029)
+++ trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/model/RubyThread.java 2007-02-25 15:46:32 UTC (rev 2030)
@@ -140,20 +140,22 @@
} else {
suspensionReason = DebugEvent.BREAKPOINT ;
}
- DebugEvent ev = new DebugEvent(this, DebugEvent.SUSPEND,
- suspensionReason);
- DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] { ev });
frames = null ;
isSuspended = true;
isStepping = false;
this.createName(suspensionPoint);
+ DebugEvent ev = new DebugEvent(this, DebugEvent.SUSPEND,
+ suspensionReason);
+ DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] { ev });
}
public void suspend() {
+ // TODO: the following 3 steps should be performed when suspend event
+ // comes back from the debugger
frames = null ;
isStepping = false;
isSuspended = true;
- // TODO: send suspension command to ruby debugger
+ getRubyDebuggerProxy().sendThreadStop(this) ;
}
public boolean canStepInto() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
Revision: 2029
http://svn.sourceforge.net/rubyeclipse/?rev=2029&view=rev
Author: mbarchfe
Date: 2007-02-25 07:45:48 -0800 (Sun, 25 Feb 2007)
Log Message:
-----------
handle breakpointDeleted
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/parsing/BreakpointModificationReader.java
Modified: trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/parsing/BreakpointModificationReader.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/parsing/BreakpointModificationReader.java 2007-02-25 15:45:19 UTC (rev 2028)
+++ trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/parsing/BreakpointModificationReader.java 2007-02-25 15:45:48 UTC (rev 2029)
@@ -27,19 +27,26 @@
@Override
protected boolean processStartElement(XmlPullParser xpp) throws XmlStreamReaderException {
+ boolean result = false;
if (xpp.getName().equals("breakpointAdded")) {
no = xpp.getAttributeValue("", "no");
- return true;
+ result = true;
+ } else if (xpp.getName().equals("breakpointDeleted")) {
+ no = xpp.getAttributeValue("", "no");
+ result = true;
+ } else if (xpp.getName().equals("error")) {
+ no = "-1";
+ result = true;
}
- return false;
+ return result;
}
-
+
@Override
public void processContent(String text) {}
@Override
protected boolean processEndElement(XmlPullParser xpp) {
- return xpp.getName().equals("breakpointAdded");
+ return xpp.getName().equals("breakpointAdded") || xpp.getName().equals("breakpointDeleted") || xpp.getName().equals("error");
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mba...@us...> - 2007-02-25 15:45:20
|
Revision: 2028
http://svn.sourceforge.net/rubyeclipse/?rev=2028&view=rev
Author: mbarchfe
Date: 2007-02-25 07:45:19 -0800 (Sun, 25 Feb 2007)
Log Message:
-----------
new tst case: inspect timeout
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_AbstractDebuggerCommunicationTest.java
trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_RubyDebugCommunicationTest.java
Modified: trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_AbstractDebuggerCommunicationTest.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_AbstractDebuggerCommunicationTest.java 2007-02-25 15:44:15 UTC (rev 2027)
+++ trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_AbstractDebuggerCommunicationTest.java 2007-02-25 15:45:19 UTC (rev 2028)
@@ -292,8 +292,7 @@
}
private void runTo(String filename, int lineNumber) throws Exception {
- String command = "b " + filename + ":" + lineNumber;
- new BreakpointCommand(command).executeWithResult(debuggerConnection);
+ setBreakpoint(filename, lineNumber) ;
SuspensionReader reader;
if (!debuggerConnection.isCommandPortConnected()) {
reader = debuggerConnection.start();
@@ -308,6 +307,15 @@
assertEquals(lineNumber, hit.getLine());
}
+ private void setBreakpoint(String filename, int line) throws Exception{
+ String command = "b " + filename + ":" + line;
+ new BreakpointCommand(command).executeWithResult(debuggerConnection);
+ }
+
+ private void setBreakpoint(int line) throws Exception {
+ setBreakpoint("test.rb", line) ;
+ }
+
public void testBreakpointOnFirstLine() throws Exception {
createSocket(new String[] { "puts 'a'" });
runTo("test.rb", 1);
@@ -408,7 +416,7 @@
public void testExceptionHierarchy() throws Exception {
createSocket(new String[] { "class MyError < StandardError", "end", "begin", "raise StandardError.new", "rescue", "end", "raise MyError.new" });
- GenericCommand catchCommand = new GenericCommand("catch StandardError", true /* iscontrol */);
+ GenericCommand catchCommand = new GenericCommand("catch MyError", true /* iscontrol */);
catchCommand.execute(debuggerConnection);
SuspensionPoint hit = startDebugger().readSuspension();
assertNotNull(hit);
@@ -886,14 +894,27 @@
sendRuby("v inspect a*2");
try {
getVariableReader().readVariables(createStackFrame());
+ fail("RubyProcessingException not thrown.");
} catch (RubyProcessingException e) {
assertNotNull(e.getMessage());
+ assertFalse(e.getMessage().indexOf("Timeout") > -1) ;
sendRuby("cont");
- return;
}
- fail("RubyProcessingException not thrown.");
}
-
+ public void testInspectTimeout() throws Exception {
+ createSocket(new String[] { "puts 'test'", "puts 'test'" });
+ runToLine(2);
+ sendRuby("v inspect sleep(100)");
+ try {
+ getVariableReader().readVariables(createStackFrame());
+ fail("Timeout did not occur.");
+ } catch (RubyProcessingException e) {
+ assertTrue(e.getMessage().indexOf("Timeout") > -1) ;
+ sendRuby("cont");
+ }
+ }
+
+
public void testEvalError() throws Exception {
createSocket(new String[] { "puts 'test'", "puts 'test'" });
runToLine(2);
@@ -988,16 +1009,17 @@
public void testThreadFramesAndVariables() throws Exception {
createSocket(new String[] { "Thread.new {", "a=5", "x=6", "puts 'x'", "}", "b=10", "b=11" });
- sendRuby("b test.rb:3");
- getBreakpointAddedReader().readBreakpointNo();
- sendRuby("b test.rb:7");
- getBreakpointAddedReader().readBreakpointNo();
+ setBreakpoint(7) ;
+ runToLine(3);
+ sendRuby("th l");
+ ThreadInfo[] threads = getThreadInfoReader().readThreads();
+
sendRuby("th resume 1");
getSuspensionReader().readSuspension();
getSuspensionReader().readSuspension();
// the main thread and the "puts 'a'" - thread are active
sendRuby("th l");
- ThreadInfo[] threads = getThreadInfoReader().readThreads();
+ threads = getThreadInfoReader().readThreads();
assertEquals(2, threads.length);
sendRuby("th " + threads[0].getId() + " ; w ");
Modified: trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_RubyDebugCommunicationTest.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_RubyDebugCommunicationTest.java 2007-02-25 15:44:15 UTC (rev 2027)
+++ trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_RubyDebugCommunicationTest.java 2007-02-25 15:45:19 UTC (rev 2028)
@@ -34,6 +34,7 @@
suite.addTest(new FTC_RubyDebugCommunicationTest("testInspectTemporaryArray"));
suite.addTest(new FTC_RubyDebugCommunicationTest("testInspectNil"));
suite.addTest(new FTC_RubyDebugCommunicationTest("testInspectError"));
+ suite.addTest(new FTC_RubyDebugCommunicationTest("testInspectTimeout"));
suite.addTest(new FTC_RubyDebugCommunicationTest("testEvalError"));
suite.addTest(new FTC_RubyDebugCommunicationTest("testFrames"));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mba...@us...> - 2007-02-25 15:44:44
|
Revision: 2027
http://svn.sourceforge.net/rubyeclipse/?rev=2027&view=rev
Author: mbarchfe
Date: 2007-02-25 07:44:15 -0800 (Sun, 25 Feb 2007)
Log Message:
-----------
ensure that default working directory is used
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyArgumentsTab.java
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyArgumentsTab.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyArgumentsTab.java 2007-02-25 15:43:09 UTC (rev 2026)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyArgumentsTab.java 2007-02-25 15:44:15 UTC (rev 2027)
@@ -139,7 +139,7 @@
public boolean isValid(ILaunchConfiguration launchConfig) {
try {
String workingDirectory = launchConfig.getAttribute(RubyLaunchConfigurationAttribute.WORKING_DIRECTORY, "");
- if (workingDirectory.length() == 0) {
+ if (!useDefaultWorkingDirectoryButton.getSelection() && workingDirectory.length() == 0) {
setErrorMessage(RdtDebugUiMessages.LaunchConfigurationTab_RubyArguments_working_dir_error_message);
return false;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mba...@us...> - 2007-02-25 15:43:44
|
Revision: 2026
http://svn.sourceforge.net/rubyeclipse/?rev=2026&view=rev
Author: mbarchfe
Date: 2007-02-25 07:43:09 -0800 (Sun, 25 Feb 2007)
Log Message:
-----------
fix adding/removing breakpoints, thread suspension
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/ClassicDebuggerCommandFactory.java
trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/ICommandFactory.java
trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyDebugCommandFactory.java
trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyDebuggerProxy.java
trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyExceptionBreakpoint.java
Modified: trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/ClassicDebuggerCommandFactory.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/ClassicDebuggerCommandFactory.java 2007-02-24 20:54:22 UTC (rev 2025)
+++ trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/ClassicDebuggerCommandFactory.java 2007-02-25 15:43:09 UTC (rev 2026)
@@ -68,4 +68,8 @@
public String createCatchOn(IBreakpoint breakpoint) throws CoreException {
return "catch " + ((RubyExceptionBreakpoint) breakpoint).getException();
}
+
+ public String createThreadStop(RubyThread thread) {
+ return "th stop " +thread.getId() ;
+ }
}
Modified: trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/ICommandFactory.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/ICommandFactory.java 2007-02-24 20:54:22 UTC (rev 2025)
+++ trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/ICommandFactory.java 2007-02-25 15:43:09 UTC (rev 2026)
@@ -21,6 +21,8 @@
public String createStepInto(RubyStackFrame stackFrame);
public String createReadThreads();
+
+ public String createThreadStop(RubyThread thread);
public String createInspect(RubyStackFrame frame, String expression);
Modified: trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyDebugCommandFactory.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyDebugCommandFactory.java 2007-02-24 20:54:22 UTC (rev 2025)
+++ trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyDebugCommandFactory.java 2007-02-25 15:43:09 UTC (rev 2026)
@@ -68,4 +68,8 @@
public String createCatchOn(IBreakpoint breakpoint) throws CoreException {
return "catch " + ((RubyExceptionBreakpoint) breakpoint).getException();
}
+
+ public String createThreadStop(RubyThread thread) {
+ return "thread stop " + thread.getId();
+ }
}
Modified: trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyDebuggerProxy.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyDebuggerProxy.java 2007-02-24 20:54:22 UTC (rev 2025)
+++ trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyDebuggerProxy.java 2007-02-25 15:43:09 UTC (rev 2026)
@@ -115,7 +115,7 @@
public void updateBreakpoint(IBreakpoint breakpoint, IMarkerDelta markerDelta) {
int currentline = markerDelta.getAttribute(IMarker.LINE_NUMBER, -1);
try {
- if (currentline == ((RubyLineBreakpoint) breakpoint).getLineNumber()) {
+ if (breakpoint instanceof RubyLineBreakpoint && currentline == ((RubyLineBreakpoint) breakpoint).getLineNumber()) {
return;
}
this.removeBreakpoint(breakpoint);
@@ -224,6 +224,15 @@
RdtDebugCorePlugin.log(e);
}
}
+
+ public void sendThreadStop(RubyThread thread) {
+ try {
+ String command = commandFactory.createThreadStop(thread) ;
+ new GenericCommand(command, true /* isControl */).execute(debuggerConnection);
+ } catch (Exception e) {
+ RdtDebugCorePlugin.log(e);
+ }
+ }
public RubyStackFrame[] readFrames(RubyThread thread) {
try {
Modified: trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyExceptionBreakpoint.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyExceptionBreakpoint.java 2007-02-24 20:54:22 UTC (rev 2025)
+++ trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyExceptionBreakpoint.java 2007-02-25 15:43:09 UTC (rev 2026)
@@ -24,7 +24,8 @@
public RubyExceptionBreakpoint(final String exception) throws CoreException {
// we need to have a resource, because the marker needs it (BTW: why the hell do
- // we need a marker for?)
+ // we need a marker for?) Possible Answer: so that changes can be detected and
+ // propagated to the DebugTarget in the same manner as for Line Breakpoints?
// The workspace root is chosen because JavaExceptionsBreakpoints do so as well
final IResource resource = ResourcesPlugin.getWorkspace().getRoot() ;
IWorkspaceRunnable wr = new IWorkspaceRunnable() {
@@ -32,10 +33,11 @@
public void run(IProgressMonitor monitor) throws CoreException {
setMarker(resource.createMarker(RubyLineBreakpoint.RUBY_BREAKPOINT_MARKER));
getMarker().setAttribute(RUBY_EXCEPTION_ATTR, exception);
- // REGISTERED ?
+ setEnabled(true);
+ // not yet registered with the BreakpointManager ..
getMarker().setAttribute(REGISTERED, false);
+ // .. but now please do so and add the breakpoint to the breakpoint manager
setRegistered(true);
- setEnabled(true);
}
};
try {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-24 20:54:26
|
Revision: 2025
http://svn.sourceforge.net/rubyeclipse/?rev=2025&view=rev
Author: cawilliams
Date: 2007-02-24 12:54:22 -0800 (Sat, 24 Feb 2007)
Log Message:
-----------
try to make test work on Mac OSX - convert strinsg we're comparing ot an independant line delimeter, also remove code inside RubyloadpathVariableInitializer's init method - it doesn't actually do anything anyways, but it had a side-effect that messed up my testing when I blew away the default VM (it would re-initialize the vm types and try to set the default again).
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyLoadpathVariablesInitializer.java
trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyLoadpathVariablesInitializer.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyLoadpathVariablesInitializer.java 2007-02-24 19:40:15 UTC (rev 2024)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyLoadpathVariablesInitializer.java 2007-02-24 20:54:22 UTC (rev 2025)
@@ -2,15 +2,12 @@
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceDescription;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.rubypeople.rdt.core.LoadpathVariableInitializer;
import org.rubypeople.rdt.core.RubyCore;
-import org.rubypeople.rdt.launching.IVMInstall;
-import org.rubypeople.rdt.launching.RubyRuntime;
public class RubyLoadpathVariablesInitializer extends LoadpathVariableInitializer {
@@ -18,57 +15,38 @@
@Override
public void initialize(String variable) {
- IVMInstall vmInstall= RubyRuntime.getDefaultVMInstall();
- if (vmInstall != null) {
- IPath newPath= null;
- IPath[] locations= RubyRuntime.getLibraryLocations(vmInstall);
- // FIXME What should we be looking for?!
- // look for rt.jar or classes.zip (both may exist, so do exhaustive search)
- IPath rtjar = null;
- IPath classeszip = null;
- for (int i = 0; i < locations.length; i++) {
- IPath location = locations[i];
- String name = location.lastSegment();
- if (name.equalsIgnoreCase("rt.jar")) { //$NON-NLS-1$
- rtjar = location;
- } else if (name.equalsIgnoreCase("classes.zip")) { //$NON-NLS-1$
- classeszip = location;
- }
- }
- // rt.jar if present, then classes.zip, else the first library
- IPath systemLib = rtjar;
- if (systemLib == null) {
- systemLib = classeszip;
- }
- if (systemLib == null && locations.length > 0) {
- systemLib = locations[0];
- }
- if (systemLib != null) {
- if (variable.equals(RubyRuntime.RUBYLIB_VARIABLE)) {
- newPath= systemLib;
- }
- if (newPath == null) {
- return;
- }
- IWorkspace workspace= ResourcesPlugin.getWorkspace();
- IWorkspaceDescription wsDescription= workspace.getDescription();
- boolean wasAutobuild= wsDescription.isAutoBuilding();
- try {
- setAutobuild(workspace, false);
- setRubyVMVariable(newPath, variable);
- } catch (CoreException ce) {
- LaunchingPlugin.log(ce);
- return;
- } finally {
- try {
- setAutobuild(workspace, wasAutobuild);
- } catch (CoreException ce) {
- LaunchingPlugin.log(ce);
- }
- }
- }
- }
-
+// FIXME What should we be looking for?!
+// IVMInstall vmInstall= RubyRuntime.getDefaultVMInstall();
+// if (vmInstall != null) {
+// IPath newPath= null;
+// IPath[] locations= RubyRuntime.getLibraryLocations(vmInstall);
+//
+//
+// if (systemLib != null) {
+// if (variable.equals(RubyRuntime.RUBYLIB_VARIABLE)) {
+// newPath= systemLib;
+// }
+// if (newPath == null) {
+// return;
+// }
+// IWorkspace workspace= ResourcesPlugin.getWorkspace();
+// IWorkspaceDescription wsDescription= workspace.getDescription();
+// boolean wasAutobuild= wsDescription.isAutoBuilding();
+// try {
+// setAutobuild(workspace, false);
+// setRubyVMVariable(newPath, variable);
+// } catch (CoreException ce) {
+// LaunchingPlugin.log(ce);
+// return;
+// } finally {
+// try {
+// setAutobuild(workspace, wasAutobuild);
+// } catch (CoreException ce) {
+// LaunchingPlugin.log(ce);
+// }
+// }
+// }
+// }
}
private void setRubyVMVariable(IPath newPath, String var) throws CoreException {
Modified: trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java
===================================================================
--- trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java 2007-02-24 19:40:15 UTC (rev 2024)
+++ trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java 2007-02-24 20:54:22 UTC (rev 2025)
@@ -7,6 +7,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.rubypeople.rdt.core.tests.ModifyingResourceTest;
+import org.rubypeople.rdt.core.tests.util.Util;
import org.rubypeople.rdt.launching.IVMInstall;
import org.rubypeople.rdt.launching.IVMInstallType;
import org.rubypeople.rdt.launching.RubyRuntime;
@@ -27,8 +28,13 @@
@Override
protected void setUp() throws Exception {
super.setUp();
+ RubyRuntime.getVMInstallTypes();
vmType = RubyRuntime.getVMInstallType(VM_TYPE_ID);
RubyRuntime.setDefaultVMInstall(null, null, true);
+ IVMInstall[] installs = vmType.getVMInstalls();
+ for (int i = 0; i < installs.length; i++) {
+ vmType.disposeVMInstall(installs[i].getId());
+ }
LaunchingPlugin.getDefault().setIgnoreVMDefPropertyChangeEvents(true);
createProject("/rubyRuntime");
folderOne = createFolder("/rubyRuntime/interpreterOne");
@@ -43,11 +49,15 @@
@Override
protected void tearDown() throws Exception {
- super.tearDown();
+ RubyRuntime.setDefaultVMInstall(null, null, true);
+ IVMInstall[] installs = vmType.getVMInstalls();
+ for (int i = 0; i < installs.length; i++) {
+ vmType.disposeVMInstall(installs[i].getId());
+ }
vmType = null;
- RubyRuntime.setDefaultVMInstall(null, null, true);
RubyRuntime.getPreferences().setValue(RubyRuntime.PREF_VM_XML, "");
deleteProject("/rubyRuntime");
+ super.tearDown();
}
public void testGetInstalledInterpreters() {
@@ -57,17 +67,16 @@
String vmTwoId = vmTwoName;
try {
VMStandin standin = new VMStandin(vmType, vmOneId);
- standin.setInstallLocation(new File("C:/RubyInstallRootOne"));
+ standin.setInstallLocation(folderOne.getLocation().toFile());
standin.setName(vmOneName);
standin.convertToRealVM();
VMStandin standin2 = new VMStandin(vmType, vmTwoId);
- standin2.setInstallLocation(new File("C:/RubyInstallRootTwo"));
+ standin2.setInstallLocation(folderTwo.getLocation().toFile());
standin2.setName(vmTwoName);
standin2.convertToRealVM();
- IVMInstallType myType = RubyRuntime.getVMInstallType(VM_TYPE_ID);
- IVMInstall[] installs = myType.getVMInstalls();
+ IVMInstall[] installs = vmType.getVMInstalls();
assertEquals(2, installs.length);
assertEquals(vmOneName, installs[0].getName());
assertEquals(vmTwoName, installs[1].getName());
@@ -86,46 +95,50 @@
VMStandin standin = new VMStandin(vmType, vmOneId);
standin.setInstallLocation(folderOne.getLocation().toFile());
standin.setName(vmOneName);
+ RubyRuntime.getVMInstallTypes();
IVMInstall one = standin.convertToRealVM();
RubyRuntime.setDefaultVMInstall(one, null,true);
+ assertEquals(1, vmType.getVMInstalls().length);
IPath vmOneLocation = folderOne.getLocation();
assertEquals(
"XML should indicate only one interpreter with it being the one selected.",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" +
+ Util.convertToIndependantLineDelimiter("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" +
"<vmSettings defaultVM=\"43,org.rubypeople.rdt.launching.StandardVMType14," + vmOneId + "\">\r\n" +
"<vmType id=\"org.rubypeople.rdt.launching.StandardVMType\">\r\n" +
vmToXML(vmOneId, vmOneName, vmOneLocation) +
"</vmType>\r\n" +
- "</vmSettings>\r\n",
- getVMsXML());
+ "</vmSettings>\r\n"),
+ Util.convertToIndependantLineDelimiter(getVMsXML()));
IPath vmTwoLocation = folderTwo.getLocation();
VMStandin standin2 = new VMStandin(vmType, vmTwoId);
standin2.setInstallLocation(vmTwoLocation.toFile());
standin2.setName(vmTwoName);
IVMInstall two = standin2.convertToRealVM();
RubyRuntime.saveVMConfiguration();
+ assertEquals(2, vmType.getVMInstalls().length);
assertEquals(
"XML should indicate both interpreters with the first one being selected.",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" +
+ Util.convertToIndependantLineDelimiter("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" +
"<vmSettings defaultVM=\"43,org.rubypeople.rdt.launching.StandardVMType14," + vmOneId + "\">\r\n" +
"<vmType id=\"org.rubypeople.rdt.launching.StandardVMType\">\r\n" +
vmToXML(vmOneId, vmOneName, vmOneLocation) +
vmToXML(vmTwoId, vmTwoName, vmTwoLocation) +
"</vmType>\r\n" +
- "</vmSettings>\r\n",
- getVMsXML());
+ "</vmSettings>\r\n"),
+ Util.convertToIndependantLineDelimiter(getVMsXML()));
RubyRuntime.setDefaultVMInstall(two, null,true);
+ assertEquals(2, vmType.getVMInstalls().length);
assertEquals(
"XML should indicate both interpreters with the second one being selected.",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" +
+ Util.convertToIndependantLineDelimiter("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" +
"<vmSettings defaultVM=\"" + RubyRuntime.getCompositeIdFromVM(standin2) + "\">\r\n" +
"<vmType id=\"org.rubypeople.rdt.launching.StandardVMType\">\r\n" +
vmToXML(vmOneId, vmOneName, vmOneLocation) +
vmToXML(vmTwoId, vmTwoName, vmTwoLocation) +
"</vmType>\r\n" +
- "</vmSettings>\r\n",
- getVMsXML());
+ "</vmSettings>\r\n"),
+ Util.convertToIndependantLineDelimiter(getVMsXML()));
} finally {
vmType.disposeVMInstall(vmOneId);
vmType.disposeVMInstall(vmTwoId);
@@ -152,7 +165,7 @@
xml.append("<libraryLocation src=\"");
xml.append(location.toPortableString());
xml.append("/lib/ruby/1.8\"/>\r\n");
- File file = LaunchingPlugin.getFileInPlugin(new Path("ruby/" + id + "/lib"));
+ File file = LaunchingPlugin.getFileInPlugin(new Path("ruby" + File.separator + id + File.separator + "lib"));
xml.append("<libraryLocation src=\"");
xml.append(Path.fromOSString(file.toString()).toPortableString());
xml.append("\"/>\r\n");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-24 19:40:17
|
Revision: 2024
http://svn.sourceforge.net/rubyeclipse/?rev=2024&view=rev
Author: cawilliams
Date: 2007-02-24 11:40:15 -0800 (Sat, 24 Feb 2007)
Log Message:
-----------
fix require statement
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/ruby/classic-debug-verbose.rb
Modified: trunk/org.rubypeople.rdt.launching/ruby/classic-debug-verbose.rb
===================================================================
--- trunk/org.rubypeople.rdt.launching/ruby/classic-debug-verbose.rb 2007-02-23 20:18:11 UTC (rev 2023)
+++ trunk/org.rubypeople.rdt.launching/ruby/classic-debug-verbose.rb 2007-02-24 19:40:15 UTC (rev 2024)
@@ -1,3 +1,3 @@
module DebugVerbose
end
-require 'eclipseDebug'
\ No newline at end of file
+require 'classic-debug'
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-23 20:18:12
|
Revision: 2023
http://svn.sourceforge.net/rubyeclipse/?rev=2023&view=rev
Author: cawilliams
Date: 2007-02-23 12:18:11 -0800 (Fri, 23 Feb 2007)
Log Message:
-----------
another try to get this test working on the build machine (and this win32 machine)
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RunnerLaunching.java
Modified: trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RunnerLaunching.java
===================================================================
--- trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RunnerLaunching.java 2007-02-23 19:57:57 UTC (rev 2022)
+++ trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RunnerLaunching.java 2007-02-23 20:18:11 UTC (rev 2023)
@@ -12,6 +12,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
@@ -34,7 +35,7 @@
private final static String PROJECT_NAME = "Simple Project";
private final static String RUBY_LIB_DIR = "someRubyDir"; // dir inside
- // project
+ // project
private final static String RUBY_FILE_NAME = "rubyFile.rb";
private final static String INTERPRETER_ARGUMENTS = "interpreter Arguments";
private final static String PROGRAM_ARGUMENTS = "programArguments";
@@ -86,12 +87,15 @@
buffer.append(project.getLocation().toOSString());
buffer.append("\"");
if (debug) {
- buffer.append(" -I \"");
+ buffer.append(" -I ");
+ if (Platform.getOS().equals(Platform.OS_WIN32))
+ buffer.append("\"");
buffer.append(new Path(StandardVMDebugger.getDirectoryOfRubyDebuggerFile()).toOSString());
- buffer.append("\"");
+ if (Platform.getOS().equals(Platform.OS_WIN32))
+ buffer.append("\"");
buffer.append(" -r");
buffer.append(debugFile);
- buffer.append(" -rclassic-debug");
+ buffer.append(" -rclassic-debug");
}
buffer.append(" -- ");
buffer.append(RUBY_LIB_DIR);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|