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: <caw...@us...> - 2007-02-22 14:31:50
|
Revision: 1997
http://svn.sourceforge.net/rubyeclipse/?rev=1997&view=rev
Author: cawilliams
Date: 2007-02-22 06:31:48 -0800 (Thu, 22 Feb 2007)
Log Message:
-----------
fix broken test
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java
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-22 13:45:20 UTC (rev 1996)
+++ trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java 2007-02-22 14:31:48 UTC (rev 1997)
@@ -4,6 +4,8 @@
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
import org.rubypeople.rdt.core.tests.ModifyingResourceTest;
import org.rubypeople.rdt.launching.IVMInstall;
import org.rubypeople.rdt.launching.IVMInstallType;
@@ -72,39 +74,86 @@
}
public void testSetInstalledInterpreters() throws CoreException {
+ String vmOneName = "InterpreterOne";
+ String vmOneId = vmOneName;
+ String vmTwoName = "InterpreterTwo";
+ String vmTwoId = vmTwoName;
try {
- VMStandin standin = new VMStandin(vmType, "InterpreterOne");
+ VMStandin standin = new VMStandin(vmType, vmOneId);
standin.setInstallLocation(folderOne.getLocation().toFile());
- standin.setName("InterpreterOne");
+ standin.setName(vmOneName);
IVMInstall one = standin.convertToRealVM();
RubyRuntime.setDefaultVMInstall(one, null,true);
+ IPath vmOneLocation = folderOne.getLocation();
assertEquals(
"XML should indicate only one interpreter with it being the selected.",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<vmSettings defaultVM=\"43,org.rubypeople.rdt.launching.StandardVMType14,InterpreterOne\">\r\n<vmType id=\"org.rubypeople.rdt.launching.StandardVMType\">\r\n<vm id=\"InterpreterOne\" name=\"InterpreterOne\" path=\"" + folderOne.getLocation().toOSString() + "\"/>\r\n</vmType>\r\n</vmSettings>\r\n",
- getVMsXML());
-
- VMStandin standin2 = new VMStandin(vmType, "InterpreterTwo");
- standin2.setInstallLocation(folderTwo.getLocation().toFile());
- standin2.setName("InterpreterTwo");
+ "<?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());
+ IPath vmTwoLocation = folderTwo.getLocation();
+ VMStandin standin2 = new VMStandin(vmType, vmTwoId);
+ standin2.setInstallLocation(vmTwoLocation.toFile());
+ standin2.setName(vmTwoName);
IVMInstall two = standin2.convertToRealVM();
RubyRuntime.saveVMConfiguration();
assertEquals(
"XML should indicate both interpreters with the first one being selected.",
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<vmSettings defaultVM=\"43,org.rubypeople.rdt.launching.StandardVMType14,InterpreterOne\">\r\n<vmType id=\"org.rubypeople.rdt.launching.StandardVMType\">\r\n<vm id=\"InterpreterOne\" name=\"InterpreterOne\" path=\"" + folderOne.getLocation().toOSString() + "\"/>\r\n<vm id=\"InterpreterTwo\" name=\"InterpreterTwo\" path=\"" + folderTwo.getLocation().toOSString() + "\"/>\r\n</vmType>\r\n</vmSettings>\r\n",
+ "<?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());
RubyRuntime.setDefaultVMInstall(two, null,true);
assertEquals(
- "XML should indicate both interpreters with the first one being selected.",
- "<?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<vm id=\"InterpreterOne\" name=\"InterpreterOne\" path=\"" + folderOne.getLocation().toOSString() + "\"/>\r\n<vm id=\"InterpreterTwo\" name=\"InterpreterTwo\" path=\"" + folderTwo.getLocation().toOSString() + "\"/>\r\n</vmType>\r\n</vmSettings>\r\n",
+ "XML should indicate both interpreters with the second one being selected.",
+ "<?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());
} finally {
- vmType.disposeVMInstall("InterpreterOne");
- vmType.disposeVMInstall("InterpreterTwo");
+ vmType.disposeVMInstall(vmOneId);
+ vmType.disposeVMInstall(vmTwoId);
}
}
private String getVMsXML() {
return RubyRuntime.getPreferences().getString(RubyRuntime.PREF_VM_XML);
}
+
+ private String vmToXML(String id, String name, IPath location) {
+ StringBuffer xml = new StringBuffer();
+ xml.append("<vm id=\"");
+ xml.append(id);
+ xml.append("\" name=\"");
+ xml.append(name);
+ xml.append("\" path=\"");
+ xml.append(location.toOSString());
+ xml.append("\">\r\n");
+ xml.append("<libraryLocations>\r\n");
+ xml.append("<libraryLocation src=\"");
+ xml.append(location.toPortableString());
+ xml.append("/lib/ruby/site_ruby/1.8\"/>\r\n");
+ 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"));
+ xml.append("<libraryLocation src=\"");
+ xml.append(Path.fromOSString(file.toString()).toPortableString());
+ xml.append("\"/>\r\n");
+ xml.append("</libraryLocations>\r\n");
+ xml.append("</vm>\r\n");
+ return xml.toString();
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-22 13:45:21
|
Revision: 1996
http://svn.sourceforge.net/rubyeclipse/?rev=1996&view=rev
Author: cawilliams
Date: 2007-02-22 05:45:20 -0800 (Thu, 22 Feb 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/ExperimentalIndex.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/ExperimentalIndex.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/ExperimentalIndex.java 2007-02-22 12:50:59 UTC (rev 1995)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/ExperimentalIndex.java 2007-02-22 13:45:20 UTC (rev 1996)
@@ -137,12 +137,15 @@
private ExperimentalIndex index;
public ExperimentalIndexJob(ExperimentalIndex index) {
- super("Experimental Index Job");
+ super("Search Index Job");
this.index = index;
}
@Override
protected IStatus run(IProgressMonitor monitor) {
+ // TODO Load up saved data if there is any, rather than starting over
+ // TODO Clear saved state if user cleans a project
+ // TODO Save state after a run
IRubyModel model = RubyModelManager.getRubyModelManager().getRubyModel();
addChildren(model);
return Status.OK_STATUS;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mir...@us...> - 2007-02-22 12:51:04
|
Revision: 1995
http://svn.sourceforge.net/rubyeclipse/?rev=1995&view=rev
Author: mirkostocker
Date: 2007-02-22 04:50:59 -0800 (Thu, 22 Feb 2007)
Log Message:
-----------
Remove duplicated code.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/IParameterReplacer.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ISelectedCallFinder.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ITargetClassFinder.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/core/inlinemethod/InlineMethodEditProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodBodyStatementReplacer.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ParameterReplacer.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/SelectedCallFinder.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/TargetClassFinder.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamefield/FieldProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/inlinemethod/TargetClassFinderUI.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinemethod/FinderTestsBase.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinemethod/TC_ParameterReplacer.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinemethod/TC_SelectedCallFinder.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinemethod/TC_TargetClassFinder.java
Removed Paths:
-------------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/IMethodCallNode.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodCallNode.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodCallNodeFactory.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodFCallNode.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodVCallNode.java
Deleted: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/IMethodCallNode.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/IMethodCallNode.java 2007-02-22 07:34:12 UTC (rev 1994)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/IMethodCallNode.java 2007-02-22 12:50:59 UTC (rev 1995)
@@ -1,41 +0,0 @@
-/***** BEGIN LICENSE BLOCK *****
- * Version: CPL 1.0/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Common Public
- * License Version 1.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.eclipse.org/legal/cpl-v10.html
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * Copyright (C) 2006 Mirko Stocker <me...@mi...>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the CPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the CPL, the GPL or the LGPL.
- ***** END LICENSE BLOCK *****/
-
-package org.rubypeople.rdt.refactoring.core.inlinemethod;
-
-import org.jruby.ast.Node;
-
-/**
- * Interface to represent the similarities of the different call nodes (Call, VCall, FCall) we have.
- */
-public interface IMethodCallNode {
- Node getReceiver();
- Node getArguments();
- String getName();
- Node getNode();
-}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/IParameterReplacer.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/IParameterReplacer.java 2007-02-22 07:34:12 UTC (rev 1994)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/IParameterReplacer.java 2007-02-22 12:50:59 UTC (rev 1995)
@@ -31,6 +31,7 @@
import org.jruby.ast.MethodDefNode;
import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
import org.rubypeople.rdt.refactoring.documentprovider.IDocumentProvider;
+import org.rubypeople.rdt.refactoring.nodewrapper.MethodCallNodeWrapper;
/**
@@ -40,5 +41,5 @@
* The return value contains the method body and, if necessary, the assigments for the method parameters.
*/
public interface IParameterReplacer {
- DocumentProvider replace(IDocumentProvider doc, IMethodCallNode call, MethodDefNode definition);
+ DocumentProvider replace(IDocumentProvider doc, MethodCallNodeWrapper call, MethodDefNode definition);
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ISelectedCallFinder.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ISelectedCallFinder.java 2007-02-22 07:34:12 UTC (rev 1994)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ISelectedCallFinder.java 2007-02-22 12:50:59 UTC (rev 1995)
@@ -29,7 +29,8 @@
package org.rubypeople.rdt.refactoring.core.inlinemethod;
import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
+import org.rubypeople.rdt.refactoring.nodewrapper.MethodCallNodeWrapper;
public interface ISelectedCallFinder {
- IMethodCallNode findSelectedCall(int pos, DocumentProvider doc);
+ MethodCallNodeWrapper findSelectedCall(int pos, DocumentProvider doc);
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ITargetClassFinder.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ITargetClassFinder.java 2007-02-22 07:34:12 UTC (rev 1994)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ITargetClassFinder.java 2007-02-22 12:50:59 UTC (rev 1995)
@@ -29,11 +29,12 @@
package org.rubypeople.rdt.refactoring.core.inlinemethod;
import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
+import org.rubypeople.rdt.refactoring.nodewrapper.MethodCallNodeWrapper;
public interface ITargetClassFinder {
/**
* Try to find the receiver's type from a call.
*/
- String findTargetClass(IMethodCallNode call, DocumentProvider doc);
+ String findTargetClass(MethodCallNodeWrapper call, DocumentProvider doc);
}
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-22 07:34:12 UTC (rev 1994)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodConditionChecker.java 2007-02-22 12:50:59 UTC (rev 1995)
@@ -70,7 +70,7 @@
}
private void renameDuplicates(DocumentProvider doc) {
- StaticScope parent = NodeUtil.getScope(SelectionNodeProvider.getEnclosingScope(doc.getRootNode(), config.getSelectedCall().getNode()));
+ StaticScope parent = NodeUtil.getScope(SelectionNodeProvider.getEnclosingScope(doc.getRootNode(), config.getSelectedCall().getWrappedNode()));
ArrayList<String> localNames = new ArrayList<String>();
if(parent.getVariables() != null) {
@@ -114,8 +114,8 @@
private void createInlinedMethodBody(DocumentProvider doc) {
MethodBodyStatementReplacer bodyReplacer = new MethodBodyStatementReplacer();
- if(config.getSelectedCall().getReceiver() != null) {
- final String name = ((INameNode)config.getSelectedCall().getReceiver()).getName();
+ if(config.getSelectedCall().getReceiverNode() != null) {
+ final String name = ((INameNode)config.getSelectedCall().getReceiverNode()).getName();
config.setMethodDefDoc(bodyReplacer.replaceSelfWithObject(config.getMethodDefDoc(), name));
config.setMethodDefDoc(bodyReplacer.prefixCallsWithObject(config.getMethodDefDoc(), new IncludedClassesProvider(doc), config.getClassName(), name));
Collection<String> usedMembers = new HashSet<String>();
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-22 07:34:12 UTC (rev 1994)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodConfig.java 2007-02-22 12:50:59 UTC (rev 1995)
@@ -34,11 +34,12 @@
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;
public class InlineMethodConfig {
private Boolean singleReturnStatement;
- private IMethodCallNode selectedCall;
+ private MethodCallNodeWrapper selectedCall;
private String className;
private MethodDefNode methodDefinitionNode;
private DocumentProvider methodDefDoc;
@@ -55,7 +56,7 @@
}
public Node getCallParent() {
- return NodeProvider.findParentNode(originalDocument.getRootNode(), selectedCall.getNode());
+ return NodeProvider.findParentNode(originalDocument.getRootNode(), selectedCall.getWrappedNode());
}
public String getClassName() {
@@ -70,7 +71,7 @@
return methodDefinitionNode;
}
- public IMethodCallNode getSelectedCall() {
+ public MethodCallNodeWrapper getSelectedCall() {
return selectedCall;
}
@@ -94,7 +95,7 @@
this.methodDefDoc = methodDefDoc;
}
- public void setSelectedCall(IMethodCallNode selectedCall) {
+ public void setSelectedCall(MethodCallNodeWrapper selectedCall) {
this.selectedCall = selectedCall;
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodEditProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodEditProvider.java 2007-02-22 07:34:12 UTC (rev 1994)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodEditProvider.java 2007-02-22 12:50:59 UTC (rev 1995)
@@ -52,7 +52,7 @@
if(parent instanceof AssignableNode) {
this.node = parent;
} else {
- this.node = config.getSelectedCall().getNode();
+ this.node = config.getSelectedCall().getWrappedNode();
}
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodBodyStatementReplacer.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodBodyStatementReplacer.java 2007-02-22 07:34:12 UTC (rev 1994)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodBodyStatementReplacer.java 2007-02-22 12:50:59 UTC (rev 1995)
@@ -43,6 +43,7 @@
import org.rubypeople.rdt.refactoring.core.NodeProvider;
import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
import org.rubypeople.rdt.refactoring.documentprovider.StringDocumentProvider;
+import org.rubypeople.rdt.refactoring.nodewrapper.MethodCallNodeWrapper;
import org.rubypeople.rdt.refactoring.nodewrapper.MethodNodeWrapper;
public class MethodBodyStatementReplacer implements IMethodBodyStatementReplacer {
@@ -95,20 +96,20 @@
DocumentProvider result = new StringDocumentProvider(doc);
- IMethodCallNode call = null;
+ MethodCallNodeWrapper call = null;
while((call = findCallToMethodInClass(result, provider, className)) != null) {
StringBuilder src = new StringBuilder(result.getActiveFileContent());
- src.insert(call.getNode().getPosition().getStartOffset(), object + '.');
+ src.insert(call.getWrappedNode().getPosition().getStartOffset(), object + '.');
result = new StringDocumentProvider(src.toString());
}
return result;
}
- private IMethodCallNode findCallToMethodInClass(DocumentProvider doc, IncludedClassesProvider provider, String className) {
+ private MethodCallNodeWrapper findCallToMethodInClass(DocumentProvider doc, IncludedClassesProvider provider, String className) {
Collection<MethodNodeWrapper> definedMethods = provider.getAllMethodsFor(className);
- for (IMethodCallNode node : findFAndVCalls(doc)) {
+ for (MethodCallNodeWrapper node : findFAndVCalls(doc)) {
for (MethodNodeWrapper methods : definedMethods) {
if(methods.getName().equals(node.getName())) {
return node;
@@ -118,10 +119,10 @@
return null;
}
- private Collection<IMethodCallNode> findFAndVCalls(DocumentProvider doc) {
- Collection<IMethodCallNode> methodCalls = new ArrayList<IMethodCallNode>();
+ private Collection<MethodCallNodeWrapper> findFAndVCalls(DocumentProvider doc) {
+ Collection<MethodCallNodeWrapper> methodCalls = new ArrayList<MethodCallNodeWrapper>();
for (Node node : NodeProvider.gatherNodesOfTypeInAktScopeNode(doc.getRootNode().getBodyNode(), VCallNode.class, FCallNode.class)) {
- methodCalls.add(MethodCallNodeFactory.create(node));
+ methodCalls.add(new MethodCallNodeWrapper(node));
}
return methodCalls;
}
Deleted: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodCallNode.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodCallNode.java 2007-02-22 07:34:12 UTC (rev 1994)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodCallNode.java 2007-02-22 12:50:59 UTC (rev 1995)
@@ -1,58 +0,0 @@
-/***** BEGIN LICENSE BLOCK *****
- * Version: CPL 1.0/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Common Public
- * License Version 1.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.eclipse.org/legal/cpl-v10.html
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * Copyright (C) 2006 Mirko Stocker <me...@mi...>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the CPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the CPL, the GPL or the LGPL.
- ***** END LICENSE BLOCK *****/
-
-package org.rubypeople.rdt.refactoring.core.inlinemethod;
-
-import org.jruby.ast.CallNode;
-import org.jruby.ast.Node;
-
-public class MethodCallNode implements IMethodCallNode {
-
- private final CallNode method;
-
- public MethodCallNode(CallNode method) {
- this.method = method;
- }
-
- public Node getArguments() {
- return method.getArgsNode();
- }
-
- public String getName() {
- return method.getName();
- }
-
- public Node getReceiver() {
- return method.getReceiverNode();
- }
-
- public CallNode getNode() {
- return method;
- }
-
-}
Deleted: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodCallNodeFactory.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodCallNodeFactory.java 2007-02-22 07:34:12 UTC (rev 1994)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodCallNodeFactory.java 2007-02-22 12:50:59 UTC (rev 1995)
@@ -1,52 +0,0 @@
-/***** BEGIN LICENSE BLOCK *****
- * Version: CPL 1.0/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Common Public
- * License Version 1.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.eclipse.org/legal/cpl-v10.html
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * Copyright (C) 2006 Mirko Stocker <me...@mi...>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the CPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the CPL, the GPL or the LGPL.
- ***** END LICENSE BLOCK *****/
-
-package org.rubypeople.rdt.refactoring.core.inlinemethod;
-
-import org.jruby.ast.CallNode;
-import org.jruby.ast.FCallNode;
-import org.jruby.ast.Node;
-import org.jruby.ast.VCallNode;
-
-public class MethodCallNodeFactory {
-
- public static IMethodCallNode create(final Node node) {
-
- IMethodCallNode call = null;
-
- if(node instanceof CallNode) {
- call = new MethodCallNode((CallNode) node);
- } else if (node instanceof FCallNode) {
- call = new MethodFCallNode((FCallNode) node);
- } else if (node instanceof VCallNode) {
- call = new MethodVCallNode((VCallNode) node);
- }
-
- return call;
- }
-}
Deleted: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodFCallNode.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodFCallNode.java 2007-02-22 07:34:12 UTC (rev 1994)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodFCallNode.java 2007-02-22 12:50:59 UTC (rev 1995)
@@ -1,58 +0,0 @@
-/***** BEGIN LICENSE BLOCK *****
- * Version: CPL 1.0/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Common Public
- * License Version 1.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.eclipse.org/legal/cpl-v10.html
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * Copyright (C) 2006 Mirko Stocker <me...@mi...>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the CPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the CPL, the GPL or the LGPL.
- ***** END LICENSE BLOCK *****/
-
-package org.rubypeople.rdt.refactoring.core.inlinemethod;
-
-import org.jruby.ast.FCallNode;
-import org.jruby.ast.Node;
-
-public class MethodFCallNode implements IMethodCallNode {
-
- private final FCallNode method;
-
- public MethodFCallNode(FCallNode method) {
- this.method = method;
- }
-
- public Node getArguments() {
- return method.getArgsNode();
- }
-
- public String getName() {
- return method.getName();
- }
-
- public Node getReceiver() {
- return null;
- }
-
- public FCallNode getNode() {
- return method;
- }
-
-}
Deleted: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodVCallNode.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodVCallNode.java 2007-02-22 07:34:12 UTC (rev 1994)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodVCallNode.java 2007-02-22 12:50:59 UTC (rev 1995)
@@ -1,58 +0,0 @@
-/***** BEGIN LICENSE BLOCK *****
- * Version: CPL 1.0/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Common Public
- * License Version 1.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.eclipse.org/legal/cpl-v10.html
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * Copyright (C) 2006 Mirko Stocker <me...@mi...>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the CPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the CPL, the GPL or the LGPL.
- ***** END LICENSE BLOCK *****/
-
-package org.rubypeople.rdt.refactoring.core.inlinemethod;
-
-import org.jruby.ast.Node;
-import org.jruby.ast.VCallNode;
-
-public class MethodVCallNode implements IMethodCallNode {
-
- private final VCallNode method;
-
- public MethodVCallNode(VCallNode method) {
- this.method = method;
- }
-
- public Node getArguments() {
- return null;
- }
-
- public String getName() {
- return method.getName();
- }
-
- public Node getReceiver() {
- return null;
- }
-
- public VCallNode getNode() {
- return method;
- }
-
-}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ParameterReplacer.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ParameterReplacer.java 2007-02-22 07:34:12 UTC (rev 1994)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ParameterReplacer.java 2007-02-22 12:50:59 UTC (rev 1995)
@@ -46,11 +46,12 @@
import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
import org.rubypeople.rdt.refactoring.documentprovider.IDocumentProvider;
import org.rubypeople.rdt.refactoring.documentprovider.StringDocumentProvider;
+import org.rubypeople.rdt.refactoring.nodewrapper.MethodCallNodeWrapper;
import org.rubypeople.rdt.refactoring.util.FileHelper;
public class ParameterReplacer implements IParameterReplacer {
- public DocumentProvider replace(IDocumentProvider doc, IMethodCallNode call, MethodDefNode definition) {
+ public DocumentProvider replace(IDocumentProvider doc, MethodCallNodeWrapper call, MethodDefNode definition) {
DocumentProvider strDoc = new StringDocumentProvider(doc.getActiveFileContent().substring(definition.getPosition().getStartOffset(), definition.getPosition().getEndOffset() + 1));
@@ -58,9 +59,9 @@
ArrayNode tailList = new ArrayNode(new SourcePosition());
- if(definition.getArgsNode().getArgs() != null && call.getArguments() != null) {
+ if(definition.getArgsNode().getArgs() != null && call.getArgsNode() != null) {
Object[] defnArguments = definition.getArgsNode().getArgs().childNodes().toArray();
- Object[] arguments = call.getArguments().childNodes().toArray();
+ Object[] arguments = call.getArgsNode().childNodes().toArray();
for(int i = 0; i < defnArguments.length; i++) {
strDoc = processArguments(strDoc, headList, tailList, (Node) arguments[i], (ArgumentNode) defnArguments[i]);
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/SelectedCallFinder.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/SelectedCallFinder.java 2007-02-22 07:34:12 UTC (rev 1994)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/SelectedCallFinder.java 2007-02-22 12:50:59 UTC (rev 1995)
@@ -34,14 +34,14 @@
import org.jruby.ast.VCallNode;
import org.rubypeople.rdt.refactoring.core.SelectionNodeProvider;
import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
+import org.rubypeople.rdt.refactoring.nodewrapper.MethodCallNodeWrapper;
public class SelectedCallFinder implements ISelectedCallFinder {
- public IMethodCallNode findSelectedCall(final int pos, final DocumentProvider doc) {
+ public MethodCallNodeWrapper findSelectedCall(final int pos, final DocumentProvider doc) {
final Node selectedNode = SelectionNodeProvider.getSelectedNodeOfType(doc.getAllNodes(), pos, CallNode.class, FCallNode.class, VCallNode.class);
- return MethodCallNodeFactory.create(selectedNode);
+ return selectedNode != null ? new MethodCallNodeWrapper(selectedNode) : null;
}
-
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/TargetClassFinder.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/TargetClassFinder.java 2007-02-22 07:34:12 UTC (rev 1994)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/TargetClassFinder.java 2007-02-22 12:50:59 UTC (rev 1995)
@@ -47,16 +47,17 @@
import org.rubypeople.rdt.refactoring.exception.NoClassNodeException;
import org.rubypeople.rdt.refactoring.nodewrapper.ClassNodeWrapper;
import org.rubypeople.rdt.refactoring.nodewrapper.FieldNodeWrapper;
+import org.rubypeople.rdt.refactoring.nodewrapper.MethodCallNodeWrapper;
import org.rubypeople.rdt.refactoring.util.NameHelper;
import org.rubypeople.rdt.refactoring.util.NodeUtil;
public class TargetClassFinder implements ITargetClassFinder {
- public String findTargetClass(final IMethodCallNode call, final DocumentProvider doc) {
+ public String findTargetClass(final MethodCallNodeWrapper call, final DocumentProvider doc) {
String name = "";
- if(call.getReceiver() == null) {
+ if(call.getReceiverNode() == null) {
name = getSurroundingClass(call, doc);
}
@@ -70,21 +71,21 @@
return name;
}
- private String getSurroundingClass(final IMethodCallNode call, final DocumentProvider doc) {
- ClassNode classNode = ((ClassNode) NodeProvider.getEnclosingNodeOfType(doc.getRootNode(), call.getNode(), new Class<?>[]{ClassNode.class}));
+ private String getSurroundingClass(final MethodCallNodeWrapper call, final DocumentProvider doc) {
+ ClassNode classNode = ((ClassNode) NodeProvider.getEnclosingNodeOfType(doc.getRootNode(), call.getWrappedNode(), new Class<?>[]{ClassNode.class}));
if(classNode != null) {
return classNode.getCPath().getName();
}
return "";
}
- private AssignableNode getAssignableNode(final IMethodCallNode call, final DocumentProvider doc) {
+ private AssignableNode getAssignableNode(final MethodCallNodeWrapper call, final DocumentProvider doc) {
AssignableNode receiverType = null;
- if(call.getReceiver() instanceof LocalVarNode) {
- receiverType = localAsgnFromLocalVar((LocalVarNode) call.getReceiver(), doc);
- } else if(call.getReceiver() instanceof InstVarNode) {
- receiverType = instVarFromCall((InstVarNode) call.getReceiver(), doc);
+ if(call.getReceiverNode() instanceof LocalVarNode) {
+ receiverType = localAsgnFromLocalVar((LocalVarNode) call.getReceiverNode(), doc);
+ } else if(call.getReceiverNode() instanceof InstVarNode) {
+ receiverType = instVarFromCall((InstVarNode) call.getReceiverNode(), doc);
}
return receiverType;
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamefield/FieldProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamefield/FieldProvider.java 2007-02-22 07:34:12 UTC (rev 1994)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamefield/FieldProvider.java 2007-02-22 12:50:59 UTC (rev 1995)
@@ -90,13 +90,13 @@
private void initClassFields(ClassNodeWrapper classWrapper) {
- Collection<Node> allOccurances = classWrapper
+ Collection<Node> allOccurences = classWrapper
.getClassFieldOccurences();
- for (Node currentAttr : allOccurances) {
+ for (Node currentAttr : allOccurences) {
if (currentAttr instanceof ClassVarNode) {
ClassVarNode classVar = (ClassVarNode) currentAttr;
- if (!isVarSubNodeOfAsgn(classVar, allOccurances, ClassVarAsgnNode.class)) {
+ if (!isVarSubNodeOfAsgn(classVar, allOccurences, ClassVarAsgnNode.class)) {
addClassVar(classVar);
}
} else if (currentAttr instanceof ClassVarAsgnNode) {
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/inlinemethod/TargetClassFinderUI.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/inlinemethod/TargetClassFinderUI.java 2007-02-22 07:34:12 UTC (rev 1994)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/inlinemethod/TargetClassFinderUI.java 2007-02-22 12:50:59 UTC (rev 1995)
@@ -30,10 +30,10 @@
import org.eclipse.jface.window.Window;
import org.jruby.ast.types.INameNode;
-import org.rubypeople.rdt.refactoring.core.inlinemethod.IMethodCallNode;
import org.rubypeople.rdt.refactoring.core.inlinemethod.ITargetClassFinder;
import org.rubypeople.rdt.refactoring.core.inlinemethod.TargetClassFinder;
import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
+import org.rubypeople.rdt.refactoring.nodewrapper.MethodCallNodeWrapper;
import org.rubypeople.rdt.refactoring.ui.IncludedClassesSelectionDialog;
public class TargetClassFinderUI implements ITargetClassFinder {
@@ -44,13 +44,13 @@
targetClassFinder = new TargetClassFinder();
}
- public String findTargetClass(IMethodCallNode call, DocumentProvider doc) {
+ public String findTargetClass(MethodCallNodeWrapper call, DocumentProvider doc) {
String result = targetClassFinder.findTargetClass(call, doc);
- if("".equals(result) && call.getReceiver() == null) {
+ if("".equals(result) && call.getReceiverNode() == null) {
return "";
}
if(result == null || "".equals(result)) {
- final String title = "Please choose the type of the variable " + ((INameNode) call.getReceiver()).getName() + ':';
+ final String title = "Please choose the type of the variable " + ((INameNode) call.getReceiverNode()).getName() + ':';
IncludedClassesSelectionDialog dialog = new IncludedClassesSelectionDialog(doc, title, call.getName());
if (dialog.open() == Window.OK) {
result = dialog.getSelectedName();
Modified: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinemethod/FinderTestsBase.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinemethod/FinderTestsBase.java 2007-02-22 07:34:12 UTC (rev 1994)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinemethod/FinderTestsBase.java 2007-02-22 12:50:59 UTC (rev 1995)
@@ -29,10 +29,10 @@
package org.rubypeople.rdt.refactoring.tests.core.inlinemethod;
import org.jruby.ast.MethodDefNode;
-import org.rubypeople.rdt.refactoring.core.inlinemethod.IMethodCallNode;
import org.rubypeople.rdt.refactoring.core.inlinemethod.MethodFinder;
import org.rubypeople.rdt.refactoring.core.inlinemethod.SelectedCallFinder;
import org.rubypeople.rdt.refactoring.core.inlinemethod.TargetClassFinder;
+import org.rubypeople.rdt.refactoring.nodewrapper.MethodCallNodeWrapper;
import org.rubypeople.rdt.refactoring.tests.FileTestCase;
import org.rubypeople.rdt.refactoring.tests.core.MultipleDocumentsInOneProvider;
@@ -48,18 +48,18 @@
super(fileName);
}
- protected IMethodCallNode findSelected(int pos, String file) {
+ protected MethodCallNodeWrapper findSelected(int pos, String file) {
SelectedCallFinder finder = new SelectedCallFinder();
doc.setActive(file);
return finder.findSelectedCall(pos, doc);
}
protected MethodDefNode findDefinition(int pos, String file) {
- IMethodCallNode methodCallNode = findSelected(pos, file);
+ MethodCallNodeWrapper methodCallNode = findSelected(pos, file);
return findDefinition(methodCallNode);
}
- protected MethodDefNode findDefinition(IMethodCallNode methodCallNode) {
+ protected MethodDefNode findDefinition(MethodCallNodeWrapper methodCallNode) {
String className = new TargetClassFinder().findTargetClass(methodCallNode, doc);
return new MethodFinder().find(className, methodCallNode.getName(), doc);
}
Modified: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinemethod/TC_ParameterReplacer.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinemethod/TC_ParameterReplacer.java 2007-02-22 07:34:12 UTC (rev 1994)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinemethod/TC_ParameterReplacer.java 2007-02-22 12:50:59 UTC (rev 1995)
@@ -32,12 +32,12 @@
import java.io.IOException;
import org.jruby.ast.MethodDefNode;
-import org.rubypeople.rdt.refactoring.core.inlinemethod.IMethodCallNode;
import org.rubypeople.rdt.refactoring.core.inlinemethod.MethodFinder;
import org.rubypeople.rdt.refactoring.core.inlinemethod.ParameterReplacer;
import org.rubypeople.rdt.refactoring.core.inlinemethod.SelectedCallFinder;
import org.rubypeople.rdt.refactoring.core.inlinemethod.TargetClassFinder;
import org.rubypeople.rdt.refactoring.documentprovider.IDocumentProvider;
+import org.rubypeople.rdt.refactoring.nodewrapper.MethodCallNodeWrapper;
import org.rubypeople.rdt.refactoring.tests.FileTestData;
@@ -54,7 +54,7 @@
int caretPosition = testData.getIntProperty("pos");
SelectedCallFinder finder = new SelectedCallFinder();
- IMethodCallNode node = finder.findSelectedCall(caretPosition, testData);
+ MethodCallNodeWrapper node = finder.findSelectedCall(caretPosition, testData);
String className = new TargetClassFinder().findTargetClass(node, testData);
MethodDefNode definitionNode = new MethodFinder().find(className, node.getName(), testData);
Modified: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinemethod/TC_SelectedCallFinder.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinemethod/TC_SelectedCallFinder.java 2007-02-22 07:34:12 UTC (rev 1994)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinemethod/TC_SelectedCallFinder.java 2007-02-22 12:50:59 UTC (rev 1995)
@@ -28,50 +28,42 @@
package org.rubypeople.rdt.refactoring.tests.core.inlinemethod;
-import org.jruby.ast.ArgumentNode;
-import org.rubypeople.rdt.refactoring.core.inlinemethod.IMethodCallNode;
-import org.rubypeople.rdt.refactoring.core.inlinemethod.MethodCallNodeFactory;
-import org.rubypeople.rdt.refactoring.core.inlinemethod.MethodFCallNode;
-import org.rubypeople.rdt.refactoring.core.inlinemethod.MethodVCallNode;
+import org.rubypeople.rdt.refactoring.nodewrapper.MethodCallNodeWrapper;
import org.rubypeople.rdt.refactoring.tests.core.MultipleDocumentsInOneProvider;
public class TC_SelectedCallFinder extends FinderTestsBase {
public void testFindSelectedCall4() {
- MethodFCallNode node = (MethodFCallNode) findSelected(2, "test4");
+ MethodCallNodeWrapper node = findSelected(2, "test4");
assertEquals("call", node.getName());
- assertNotNull(node.getArguments());
- assertNotNull(node.getNode());
- assertNull(node.getReceiver());
+ assertNotNull(node.getArgsNode());
+ assertNotNull(node.getWrappedNode());
+ assertNull(node.getReceiverNode());
}
public void testFindSelectedCall3() {
- MethodVCallNode node = (MethodVCallNode) findSelected(4, "test3");
+ MethodCallNodeWrapper node = findSelected(4, "test3");
assertEquals("call", node.getName());
- assertNull(node.getArguments());
- assertNotNull(node.getNode());
- assertNull(node.getReceiver());
+ assertNull(node.getArgsNode());
+ assertNotNull(node.getWrappedNode());
+ assertNull(node.getReceiverNode());
}
public void testFindSelectedCall2() {
- IMethodCallNode node = findSelected(9, "test2");
+ MethodCallNodeWrapper node = findSelected(9, "test2");
assertEquals("method", node.getName());
- assertNull(node.getArguments());
- assertNotNull(node.getNode());
- assertNotNull(node.getReceiver());
+ assertNull(node.getArgsNode());
+ assertNotNull(node.getWrappedNode());
+ assertNotNull(node.getReceiverNode());
}
public void testFindSelectedCall1() {
- IMethodCallNode node = findSelected(8, "test1");
+ MethodCallNodeWrapper node = findSelected(8, "test1");
assertEquals("method", node.getName());
- assertNotNull(node.getArguments());
- assertNotNull(node.getNode());
- assertNotNull(node.getReceiver());
+ assertNotNull(node.getArgsNode());
+ assertNotNull(node.getWrappedNode());
+ assertNotNull(node.getReceiverNode());
}
-
- public void testMethodCallNodeFactory() {
- assertNull(MethodCallNodeFactory.create(new ArgumentNode(null, "")));
- }
@Override
protected void setUp() throws Exception {
Modified: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinemethod/TC_TargetClassFinder.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinemethod/TC_TargetClassFinder.java 2007-02-22 07:34:12 UTC (rev 1994)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinemethod/TC_TargetClassFinder.java 2007-02-22 12:50:59 UTC (rev 1995)
@@ -117,12 +117,12 @@
private LocalAsgnNode findLocalAsgnNode(int pos, String file) {
TargetClassFinder finder = new TargetClassFinder();
- return finder.localAsgnFromLocalVar( (LocalVarNode) ((CallNode) findSelected(pos, file).getNode()).getReceiverNode(), doc);
+ return finder.localAsgnFromLocalVar( (LocalVarNode) ((CallNode) findSelected(pos, file).getWrappedNode()).getReceiverNode(), doc);
}
private InstAsgnNode findInstAsgnNode(int pos, String file) {
TargetClassFinder finder = new TargetClassFinder();
- return finder.instVarFromCall( (InstVarNode) ((CallNode) findSelected(pos, file).getNode()).getReceiverNode(), doc);
+ return finder.instVarFromCall( (InstVarNode) ((CallNode) findSelected(pos, file).getWrappedNode()).getReceiverNode(), doc);
}
private String findTargetClass(int pos, String file) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mir...@us...> - 2007-02-22 07:34:19
|
Revision: 1994
http://svn.sourceforge.net/rubyeclipse/?rev=1994&view=rev
Author: mirkostocker
Date: 2007-02-21 23:34:12 -0800 (Wed, 21 Feb 2007)
Log Message:
-----------
Fix the argument edit function in the extract method dialog.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/extractmethod/ExtractedMethodHelper.java
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/extractmethod/ExtractedMethodHelper.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/extractmethod/ExtractedMethodHelper.java 2007-02-21 14:01:25 UTC (rev 1993)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/extractmethod/ExtractedMethodHelper.java 2007-02-22 07:34:12 UTC (rev 1994)
@@ -237,9 +237,9 @@
ArrayList<String> local = new ArrayList<String>();
- for (String name : NodeUtil.getScope(selectedNodes).getVariables()) {
- if (!arguments.contains(name)) {
- local.add(name);
+ for(LocalNodeWrapper varNode : LocalNodeWrapper.gatherLocalNodes(getMethodCallNode())) {
+ if (!arguments.contains(varNode.getName())) {
+ local.add(varNode.getName());
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mir...@us...> - 2007-02-21 14:03:10
|
Revision: 1993
http://svn.sourceforge.net/rubyeclipse/?rev=1993&view=rev
Author: mirkostocker
Date: 2007-02-21 06:01:25 -0800 (Wed, 21 Feb 2007)
Log Message:
-----------
Only invoke rename class / local if the caretposition is on the name, not anywhere inside the body.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renameclass/RenameClassConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/RenameConditionChecker.java
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renameclass/RenameClassConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renameclass/RenameClassConditionChecker.java 2007-02-21 13:13:01 UTC (rev 1992)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renameclass/RenameClassConditionChecker.java 2007-02-21 14:01:25 UTC (rev 1993)
@@ -50,6 +50,11 @@
ClassNodeWrapper classNode = null;
try {
classNode = SelectionNodeProvider.getSelectedClassNode(config.getDocProvider().getRootNode(), config.getOffset());
+ int nameStart = ((ClassNode) classNode.getWrappedNode()).getCPath().getPosition().getStartOffset();
+ int nameEnd = ((ClassNode) classNode.getWrappedNode()).getCPath().getPosition().getEndOffset();
+ if(config.getOffset() < nameStart || config.getOffset() > nameEnd) {
+ return;
+ }
} catch (NoClassNodeException e) {return;}
config.setModulePrefix(classNode.getFirstPartialClassNode().getModulePrefix());
config.setSelectedNode((ClassNode) classNode.getFirstPartialClassNode().getWrappedNode());
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/RenameConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/RenameConditionChecker.java 2007-02-21 13:13:01 UTC (rev 1992)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/RenameConditionChecker.java 2007-02-21 14:01:25 UTC (rev 1993)
@@ -31,6 +31,7 @@
import java.util.Collection;
import org.jruby.ast.ArgumentNode;
+import org.jruby.ast.AssignableNode;
import org.jruby.ast.BlockArgNode;
import org.jruby.ast.DAsgnNode;
import org.jruby.ast.DVarNode;
@@ -39,6 +40,7 @@
import org.jruby.ast.MethodDefNode;
import org.jruby.ast.Node;
import org.jruby.ast.RootNode;
+import org.jruby.ast.types.INameNode;
import org.rubypeople.rdt.refactoring.core.NodeProvider;
import org.rubypeople.rdt.refactoring.core.RefactoringConditionChecker;
import org.rubypeople.rdt.refactoring.core.SelectionNodeProvider;
@@ -68,6 +70,13 @@
config = (RenameConfig) configObj;
RootNode rootNode = config.getDocumentProvider().getRootNode();
Node selectedNode = SelectionNodeProvider.getSelectedNodeOfType(rootNode, config.getCaretPosition(), SELECTED_NODE_TYPES);
+ if(selectedNode instanceof AssignableNode) {
+ int start = selectedNode.getPosition().getStartOffset();
+ int end = start + ((INameNode) selectedNode).getName().length();
+ if(config.getCaretPosition() < start || config.getCaretPosition() > end) {
+ return;
+ }
+ }
config.setSelectedNode(selectedNode);
if(selectedNode == null) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mir...@us...> - 2007-02-21 13:13:03
|
Revision: 1992
http://svn.sourceforge.net/rubyeclipse/?rev=1992&view=rev
Author: mirkostocker
Date: 2007-02-21 05:13:01 -0800 (Wed, 21 Feb 2007)
Log Message:
-----------
Inline method now creates accessors if the inlined method body accesses members of the class.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineAndRemoveEditProvider.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/core/inlinemethod/MethodBodyStatementReplacer.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/RenameDuplicatedVariables.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movefield/GenerateAccessorsAtTarget.java
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/TC_MethodBodyStatementReplacer.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinemethod/TC_MethodBodyStatementReplacer.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/inline_method_test_13.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/inline_method_test_13.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/inline_method_test_13.test_properties
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineAndRemoveEditProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineAndRemoveEditProvider.java 2007-02-21 12:57:27 UTC (rev 1991)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineAndRemoveEditProvider.java 2007-02-21 13:13:01 UTC (rev 1992)
@@ -31,6 +31,7 @@
import java.util.ArrayList;
import java.util.Collection;
+import org.rubypeople.rdt.refactoring.core.movefield.GenerateAccessorsAtTarget;
import org.rubypeople.rdt.refactoring.editprovider.DeleteEditProvider;
import org.rubypeople.rdt.refactoring.editprovider.EditProvider;
import org.rubypeople.rdt.refactoring.editprovider.MultiEditProvider;
@@ -51,6 +52,11 @@
if(remove) {
editProviders.add(new DeleteEditProvider(config.getMethodDefinitionNode()));
}
+ if(config.getUsedMembers() != null && !config.getUsedMembers().isEmpty()) {
+ for(String member : config.getUsedMembers()) {
+ editProviders.add(new GenerateAccessorsAtTarget(config.getDocumentProvider(), config.getClassName(), member.substring(1)).getEditProvider());
+ }
+ }
return editProviders;
}
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-21 12:57:27 UTC (rev 1991)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodConditionChecker.java 2007-02-21 13:13:01 UTC (rev 1992)
@@ -29,6 +29,8 @@
package org.rubypeople.rdt.refactoring.core.inlinemethod;
import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
import org.jruby.ast.AssignableNode;
import org.jruby.ast.ListNode;
@@ -113,8 +115,12 @@
private void createInlinedMethodBody(DocumentProvider doc) {
MethodBodyStatementReplacer bodyReplacer = new MethodBodyStatementReplacer();
if(config.getSelectedCall().getReceiver() != null) {
- config.setMethodDefDoc(bodyReplacer.replaceSelfWithObject(config.getMethodDefDoc(), ((INameNode)config.getSelectedCall().getReceiver()).getName()));
- config.setMethodDefDoc(bodyReplacer.prefixCallsWithObject(config.getMethodDefDoc(), new IncludedClassesProvider(doc), config.getClassName(), ((INameNode)config.getSelectedCall().getReceiver()).getName()));
+ final String name = ((INameNode)config.getSelectedCall().getReceiver()).getName();
+ config.setMethodDefDoc(bodyReplacer.replaceSelfWithObject(config.getMethodDefDoc(), name));
+ config.setMethodDefDoc(bodyReplacer.prefixCallsWithObject(config.getMethodDefDoc(), new IncludedClassesProvider(doc), config.getClassName(), name));
+ Collection<String> usedMembers = new HashSet<String>();
+ config.setMethodDefDoc(bodyReplacer.replaceVarsWithAccessor(config.getMethodDefDoc(), name, usedMembers));
+ config.setUsedMembers(usedMembers);
}
config.setMethodDefDoc(bodyReplacer.removeReturnStatements(config.getMethodDefDoc()));
}
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-21 12:57:27 UTC (rev 1991)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodConfig.java 2007-02-21 13:13:01 UTC (rev 1992)
@@ -28,6 +28,8 @@
package org.rubypeople.rdt.refactoring.core.inlinemethod;
+import java.util.Collection;
+
import org.jruby.ast.MethodDefNode;
import org.jruby.ast.Node;
import org.rubypeople.rdt.refactoring.core.NodeProvider;
@@ -43,6 +45,7 @@
private final DocumentProvider originalDocument;
private int pos;
private ITargetClassFinder targetClassFinder;
+ private Collection<String> usedMembers;
public InlineMethodConfig(DocumentProvider doc, int pos, ITargetClassFinder targetClassFinder) {
@@ -106,4 +109,12 @@
public void setMethodDefinitionNode(MethodDefNode methodDefinitionNode) {
this.methodDefinitionNode = methodDefinitionNode;
}
+
+ public void setUsedMembers(Collection<String> usedMembers) {
+ this.usedMembers = usedMembers;
+ }
+
+ public Collection<String> getUsedMembers() {
+ return usedMembers;
+ }
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodBodyStatementReplacer.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodBodyStatementReplacer.java 2007-02-21 12:57:27 UTC (rev 1991)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodBodyStatementReplacer.java 2007-02-21 13:13:01 UTC (rev 1992)
@@ -32,14 +32,17 @@
import java.util.Collection;
import org.jruby.ast.FCallNode;
+import org.jruby.ast.InstAsgnNode;
+import org.jruby.ast.InstVarNode;
import org.jruby.ast.Node;
import org.jruby.ast.ReturnNode;
import org.jruby.ast.SelfNode;
import org.jruby.ast.VCallNode;
+import org.jruby.ast.types.INameNode;
import org.rubypeople.rdt.refactoring.classnodeprovider.IncludedClassesProvider;
import org.rubypeople.rdt.refactoring.core.NodeProvider;
+import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
import org.rubypeople.rdt.refactoring.documentprovider.StringDocumentProvider;
-import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
import org.rubypeople.rdt.refactoring.nodewrapper.MethodNodeWrapper;
public class MethodBodyStatementReplacer implements IMethodBodyStatementReplacer {
@@ -63,7 +66,31 @@
return result;
}
+
+ public DocumentProvider replaceVarsWithAccessor(DocumentProvider doc, String object, Collection<String> usedMembers) {
+ DocumentProvider result = new StringDocumentProvider(doc);
+ Collection<Node> varNodes = null;
+ do {
+ varNodes = NodeProvider.gatherNodesOfTypeInAktScopeNode(result.getRootNode().getBodyNode(), InstVarNode.class, InstAsgnNode.class);
+
+ if(varNodes.isEmpty()) {
+ continue;
+ }
+ final Node varNode = varNodes.iterator().next();
+ String name = ((INameNode) varNode).getName();
+ usedMembers.add(name);
+ StringBuilder src = new StringBuilder(result.getActiveFileContent());
+ src.replace(varNode.getPosition().getStartOffset(),
+ varNode.getPosition().getStartOffset() + name.length(),
+ object + '.' + name.substring(1));
+ result = new StringDocumentProvider(src.toString());
+
+ } while(!varNodes.isEmpty());
+
+ return result;
+ }
+
public DocumentProvider prefixCallsWithObject(DocumentProvider doc, IncludedClassesProvider provider, String className, String object) {
DocumentProvider result = new StringDocumentProvider(doc);
@@ -78,7 +105,6 @@
return result;
}
-
private IMethodCallNode findCallToMethodInClass(DocumentProvider doc, IncludedClassesProvider provider, String className) {
Collection<MethodNodeWrapper> definedMethods = provider.getAllMethodsFor(className);
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/RenameDuplicatedVariables.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/RenameDuplicatedVariables.java 2007-02-21 12:57:27 UTC (rev 1991)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/RenameDuplicatedVariables.java 2007-02-21 13:13:01 UTC (rev 1992)
@@ -42,6 +42,7 @@
DocumentProvider result = new StringDocumentProvider(doc.getActiveFileContent());
for (String name : NameHelper.findDuplicates(rootNode.getStaticScope().getVariables(), localNames)) {
+ if("$~".equals(name) || "$_".equals(name)) continue;
result = new LocalVariableRenamer(result, name, NameHelper.createName(name)).rename();
}
return result;
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movefield/GenerateAccessorsAtTarget.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movefield/GenerateAccessorsAtTarget.java 2007-02-21 12:57:27 UTC (rev 1991)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movefield/GenerateAccessorsAtTarget.java 2007-02-21 13:13:01 UTC (rev 1992)
@@ -43,7 +43,10 @@
for(String fileName : doc.getFileNames()) {
StringDocumentProvider stringDocumentProvider = new StringDocumentProvider(fileName, doc.getFileContent(fileName));
- targetClass = stringDocumentProvider.getIncludedClassNodeProvider().getClassNode(className);
+ ClassNodeWrapper classNodeWrapper = stringDocumentProvider.getIncludedClassNodeProvider().getClassNode(className);
+ if(classNodeWrapper != null) {
+ targetClass = classNodeWrapper;
+ }
}
generatedAccessor = new GeneratedAccessor("attr_accessor", accessorName, GeneratedAccessor.TYPE_SIMPLE_ACCESSOR, targetClass);
Modified: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/TC_MethodBodyStatementReplacer.source.rb
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/TC_MethodBodyStatementReplacer.source.rb 2007-02-21 12:57:27 UTC (rev 1991)
+++ trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/TC_MethodBodyStatementReplacer.source.rb 2007-02-21 13:13:01 UTC (rev 1992)
@@ -32,3 +32,9 @@
##!result5
fac = (1..10).inject(1) { |i, j| i * j }
fac
+##!test6
+@x = 5
+puts @x
+##!result6
+a.x = 5
+puts a.x
\ No newline at end of file
Added: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/inline_method_test_13.result.rb
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/inline_method_test_13.result.rb (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/inline_method_test_13.result.rb 2007-02-21 13:13:01 UTC (rev 1992)
@@ -0,0 +1,14 @@
+class A
+
+ attr_accessor :x
+
+ def a
+ @x = 5
+ end
+end
+class B
+ def b
+ a = A.new
+ a.x = 5
+ end
+end
Added: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/inline_method_test_13.source.rb
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/inline_method_test_13.source.rb (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/inline_method_test_13.source.rb 2007-02-21 13:13:01 UTC (rev 1992)
@@ -0,0 +1,11 @@
+class A
+ def a
+ @x = 5
+ end
+end
+class B
+ def b
+ a = A.new
+ a.a
+ end
+end
Added: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/inline_method_test_13.test_properties
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/inline_method_test_13.test_properties (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/inline_method_test_13.test_properties 2007-02-21 13:13:01 UTC (rev 1992)
@@ -0,0 +1,2 @@
+pos=73
+remove=false
Modified: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinemethod/TC_MethodBodyStatementReplacer.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinemethod/TC_MethodBodyStatementReplacer.java 2007-02-21 12:57:27 UTC (rev 1991)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinemethod/TC_MethodBodyStatementReplacer.java 2007-02-21 13:13:01 UTC (rev 1992)
@@ -28,6 +28,8 @@
package org.rubypeople.rdt.refactoring.tests.core.inlinemethod;
+import java.util.ArrayList;
+
import org.rubypeople.rdt.refactoring.core.inlinemethod.MethodBodyStatementReplacer;
import org.rubypeople.rdt.refactoring.documentprovider.IDocumentProvider;
import org.rubypeople.rdt.refactoring.tests.core.MultipleDocumentsInOneProvider;
@@ -49,10 +51,14 @@
public void testReturnStatement() {
replaceReturn("test4", "result4");
}
-
+
public void testReturnStatementFac() {
replaceReturn("test5", "result5");
}
+
+ public void testReturnCallToMember() {
+ replaceCallToMember("test6", "result6", "a");
+ }
private void replace(String testName, String newName, String resultName) {
IDocumentProvider result = new MethodBodyStatementReplacer().replaceSelfWithObject(doc.setActive(testName), newName);
@@ -64,6 +70,11 @@
compareResults(resultName, result);
}
+ private void replaceCallToMember(String testName, String resultName, String objName) {
+ IDocumentProvider result = new MethodBodyStatementReplacer().replaceVarsWithAccessor(doc.setActive(testName), objName, new ArrayList<String>());
+ compareResults(resultName, result);
+ }
+
private void compareResults(String resultName, IDocumentProvider result) {
assertEquals(doc.setActive(resultName).getActiveFileContent(), result.getActiveFileContent());
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cal...@us...> - 2007-02-21 12:57:28
|
Revision: 1991
http://svn.sourceforge.net/rubyeclipse/?rev=1991&view=rev
Author: callandor1983
Date: 2007-02-21 04:57:27 -0800 (Wed, 21 Feb 2007)
Log Message:
-----------
Rename on method (whole methodname selected) works now (instead of calling rename local)
Modified Paths:
--------------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/rename/RenameConditionChecker.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_15.activeFile.rb.result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_15.activeFile.rb.source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_15.test_properties
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/rename/RenameConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/rename/RenameConditionChecker.java 2007-02-21 11:41:02 UTC (rev 1990)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/rename/RenameConditionChecker.java 2007-02-21 12:57:27 UTC (rev 1991)
@@ -47,8 +47,9 @@
selectedLocalNode = SelectionNodeProvider.getSelectedNodeOfType(rootNode, offset, LocalNodeWrapper.getLocalNodeClasses());
ConstNode selectedConstNode = (ConstNode) SelectionNodeProvider.getSelectedNodeOfType(rootNode, offset, ConstNode.class);
SymbolNode selectedSymbolNode = (SymbolNode) SelectionNodeProvider.getSelectedNodeOfType(rootNode, offset, SymbolNode.class);
- if(selectedLocalNode == null && SelectionNodeProvider.getSelectedNodeOfType(rootNode, offset, ArgsNode.class) != null) {
- selectedLocalNode = SelectionNodeProvider.getSelectedNodeOfType(rootNode, offset, ArgumentNode.class);
+ ArgsNode argsNode = (ArgsNode) SelectionNodeProvider.getSelectedNodeOfType(rootNode, offset, ArgsNode.class);
+ if(selectedLocalNode == null && argsNode != null) {
+ selectedLocalNode = SelectionNodeProvider.getSelectedNodeOfType(argsNode, offset, ArgumentNode.class);
}
initPreferedNode(selectedConstNode, selectedSymbolNode);
}
Added: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_15.activeFile.rb.result
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_15.activeFile.rb.result (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_15.activeFile.rb.result 2007-02-21 12:57:27 UTC (rev 1991)
@@ -0,0 +1,6 @@
+class Test
+ def bar
+ @foo = 5
+ p @foo
+ end
+end
\ No newline at end of file
Added: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_15.activeFile.rb.source
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_15.activeFile.rb.source (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_15.activeFile.rb.source 2007-02-21 12:57:27 UTC (rev 1991)
@@ -0,0 +1,6 @@
+class Test
+ def wunder
+ @foo = 5
+ p @foo
+ end
+end
\ No newline at end of file
Added: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_15.test_properties
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_15.test_properties (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_15.test_properties 2007-02-21 12:57:27 UTC (rev 1991)
@@ -0,0 +1,4 @@
+activeFile=activeFile.rb
+destinationFiles=
+caretPosition=22
+newName=bar
\ 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: <cal...@us...> - 2007-02-21 11:41:06
|
Revision: 1990
http://svn.sourceforge.net/rubyeclipse/?rev=1990&view=rev
Author: callandor1983
Date: 2007-02-21 03:41:02 -0800 (Wed, 21 Feb 2007)
Log Message:
-----------
Inline local var doesn't eliminate selected asgnNode when no target was found.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/InlineTempConditionChecker.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/conditionchecks/inline_temp_checker_test_7.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/conditionchecks/inline_temp_checker_test_7.test_source
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/InlineTempConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/InlineTempConditionChecker.java 2007-02-21 10:04:53 UTC (rev 1989)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/InlineTempConditionChecker.java 2007-02-21 11:41:02 UTC (rev 1990)
@@ -117,9 +117,15 @@
addError("Cannot inline a local variable that uses its own value in the assignment.");
} else if (isMultipleAsgnNode()) {
addError("Inline in multiple assignments not jet supported.");
+ } else if (!hasTarget()) {
+ addError("No target found to inline the selected variable.");
}
}
+ private boolean hasTarget() {
+ return !config.getLocalOccurrences().isEmpty();
+ }
+
private boolean isBlockArgument() {
IterNode enclosingIterNode = (IterNode) SelectionNodeProvider.getSelectedNodeOfType(rootNode, config.getCaretPosition(), IterNode.class);
if(enclosingIterNode == null) {
Added: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/conditionchecks/inline_temp_checker_test_7.test_properties
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/conditionchecks/inline_temp_checker_test_7.test_properties (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/conditionchecks/inline_temp_checker_test_7.test_properties 2007-02-21 11:41:02 UTC (rev 1990)
@@ -0,0 +1,3 @@
+cursorPosition=43
+newName=dd
+initialError0=No target found to inline the selected variable.
Added: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/conditionchecks/inline_temp_checker_test_7.test_source
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/conditionchecks/inline_temp_checker_test_7.test_source (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/conditionchecks/inline_temp_checker_test_7.test_source 2007-02-21 11:41:02 UTC (rev 1990)
@@ -0,0 +1,5 @@
+class Triangle
+ def hypotenuse a, b
+ cSquare = a ** 2 + b ** 2
+ end
+end
\ 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: <cal...@us...> - 2007-02-21 10:04:56
|
Revision: 1989
http://svn.sourceforge.net/rubyeclipse/?rev=1989&view=rev
Author: callandor1983
Date: 2007-02-21 02:04:53 -0800 (Wed, 21 Feb 2007)
Log Message:
-----------
Candidates at end of document can now be selected on a OccurenceReplaceSelectionPage.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamefield/RenameFieldRefactoring.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/RenameMethodRefactoring.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/RdtCodeViewer.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/OccurenceReplaceSelectionPage.java
Removed Paths:
-------------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/CallReplaceSelectionPage.java
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamefield/RenameFieldRefactoring.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamefield/RenameFieldRefactoring.java 2007-02-20 16:25:36 UTC (rev 1988)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamefield/RenameFieldRefactoring.java 2007-02-21 10:04:53 UTC (rev 1989)
@@ -35,7 +35,7 @@
import org.rubypeople.rdt.refactoring.documentprovider.DocumentWithIncluding;
import org.rubypeople.rdt.refactoring.ui.IValidator;
import org.rubypeople.rdt.refactoring.ui.NewNameListener;
-import org.rubypeople.rdt.refactoring.ui.pages.CallReplaceSelectionPage;
+import org.rubypeople.rdt.refactoring.ui.pages.OccurenceReplaceSelectionPage;
import org.rubypeople.rdt.refactoring.ui.pages.RenameFieldPage;
import org.rubypeople.rdt.refactoring.util.NameValidator;
@@ -53,7 +53,7 @@
private FieldRenamer renamer;
private NewNameListener nameListener;
private RenameFieldPage pageOne;
- private CallReplaceSelectionPage page;
+ private OccurenceReplaceSelectionPage page;
public RenameFieldRefactoring(TextSelectionProvider selectionProvider) {
super(NAME);
@@ -70,7 +70,7 @@
pageOne = new RenameFieldPage(config.getSelectedName().replaceAll("@", ""), nameListener, config);
pages.add(pageOne);
- page = new CallReplaceSelectionPage(config, config.getDocProvider());
+ page = new OccurenceReplaceSelectionPage(config, config.getDocProvider());
pages.add(page);
}
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/RenameMethodRefactoring.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/RenameMethodRefactoring.java 2007-02-20 16:25:36 UTC (rev 1988)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/RenameMethodRefactoring.java 2007-02-21 10:04:53 UTC (rev 1989)
@@ -34,7 +34,7 @@
import org.rubypeople.rdt.refactoring.core.TextSelectionProvider;
import org.rubypeople.rdt.refactoring.ui.IValidator;
import org.rubypeople.rdt.refactoring.ui.NewNameListener;
-import org.rubypeople.rdt.refactoring.ui.pages.CallReplaceSelectionPage;
+import org.rubypeople.rdt.refactoring.ui.pages.OccurenceReplaceSelectionPage;
import org.rubypeople.rdt.refactoring.ui.pages.RenamePage;
import org.rubypeople.rdt.refactoring.util.NameValidator;
@@ -64,7 +64,7 @@
RenamePage page = new RenamePage(NAME + "...", config.getTargetMethod().getName(), nameListener);
pages.add(page);
if(!config.getPossibleCalls().isEmpty()){
- pages.add(new CallReplaceSelectionPage(config, config.getDocProvider()));
+ pages.add(new OccurenceReplaceSelectionPage(config, config.getDocProvider()));
}
}
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/RdtCodeViewer.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/RdtCodeViewer.java 2007-02-20 16:25:36 UTC (rev 1988)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/RdtCodeViewer.java 2007-02-21 10:04:53 UTC (rev 1989)
@@ -71,7 +71,7 @@
public void setBackgroundColor(int start, int length, Color color) {
StyleRange styleRangeNode = new StyleRange();
styleRangeNode.start = start;
- styleRangeNode.length = length + 1;
+ styleRangeNode.length = length;
styleRangeNode.background = color;
getTextWidget().setStyleRange(styleRangeNode);
}
Deleted: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/CallReplaceSelectionPage.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/CallReplaceSelectionPage.java 2007-02-20 16:25:36 UTC (rev 1988)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/CallReplaceSelectionPage.java 2007-02-21 10:04:53 UTC (rev 1989)
@@ -1,148 +0,0 @@
-/***** BEGIN LICENSE BLOCK *****
- * Version: CPL 1.0/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Common Public
- * License Version 1.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.eclipse.org/legal/cpl-v10.html
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * Copyright (C) 2006 Lukas Felber <lf...@hs...>
- * Copyright (C) 2006 Mirko Stocker <me...@mi...>
- * Copyright (C) 2006 Thomas Corbat <tc...@hs...>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the CPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the CPL, the GPL or the LGPL.
- ***** END LICENSE BLOCK *****/
-
-package org.rubypeople.rdt.refactoring.ui.pages;
-
-import java.util.ArrayList;
-
-import org.eclipse.ltk.ui.refactoring.UserInputWizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-import org.jruby.lexer.yacc.ISourcePosition;
-import org.rubypeople.rdt.refactoring.JRubyRefactoringUtils;
-import org.rubypeople.rdt.refactoring.core.renamemethod.NodeSelector;
-import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
-import org.rubypeople.rdt.refactoring.nodewrapper.INodeWrapper;
-import org.rubypeople.rdt.refactoring.ui.RdtCodeViewer;
-
-public class CallReplaceSelectionPage extends UserInputWizardPage {
-
- public static final String NAME = "Select Calls...";
- private final static RGB highlightColor = new RGB(173, 193, 217);
-
- private NodeSelector selector;
- private Table possibilityTable;
- private DocumentProvider docProvider;
-
-
- public CallReplaceSelectionPage(NodeSelector selector, DocumentProvider docProvider) {
- super(NAME);
- this.selector = selector;
- this.docProvider = docProvider;
- }
-
- public void createControl(Composite parent) {
-
- Composite control = new Composite(parent, SWT.NONE);
- FillLayout controlLayout = new FillLayout();
- controlLayout.spacing = 10;
- controlLayout.marginHeight = 10;
- controlLayout.marginWidth = 10;
- control.setLayout(controlLayout);
- initPossibilityTable(control);
- initCodeView(control);
- setControl(control);
- }
-
- private void initCodeView(Composite control) {
- final RdtCodeViewer viewer = RdtCodeViewer.create(control);
- possibilityTable.addSelectionListener(new SelectionListener(){
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- INodeWrapper currentCall = (INodeWrapper) e.item.getData();
- ISourcePosition pos = currentCall.getWrappedNode().getPosition();
- int length = pos.getEndOffset() - pos.getStartOffset();
- String file = docProvider.getFileContent(currentCall.getWrappedNode().getPosition().getFile());
- updateCodeViewer(viewer, pos, length, file);
-
- updateChecks();
- }
-
- private void updateCodeViewer(final RdtCodeViewer viewer, ISourcePosition pos, int length, String content) {
- viewer.setPreviewText(content);
- viewer.setBackgroundColor(pos.getStartOffset(), length, highlightColor);
- viewer.getTextWidget().setSelection(pos.getStartOffset());
- viewer.getTextWidget().showSelection();
- }
-
- private void updateChecks() {
- ArrayList<INodeWrapper> checkedCalls = new ArrayList<INodeWrapper>();
- for(TableItem currentItem : possibilityTable.getItems()){
- if(currentItem.getChecked()){
- checkedCalls.add((INodeWrapper) currentItem.getData());
- }
- }
- selector.setSelectedCalls(checkedCalls);
- }
- });
- }
-
- private void initPossibilityTable(Composite control) {
- possibilityTable = new Table(control, SWT.BORDER | SWT.CHECK);
- for(INodeWrapper currentCall : selector.getPossibleCalls()){
- TableItem currentItem = new TableItem(possibilityTable, SWT.NONE);
- currentItem.setText(getTableCaption(currentCall));
- if(proableCall(currentCall)){
- currentItem.setChecked(true);
- }
- currentItem.setData(currentCall);
- }
- }
-
- private String getTableCaption(INodeWrapper currentCall) {
- ISourcePosition pos = currentCall.getWrappedNode().getPosition();
- return pos.getFile() + " line: " + (pos.getStartLine() + 1) ;
- }
-
- private boolean proableCall(INodeWrapper currentCall) {
-
- for(INodeWrapper targetCall : selector.getSelectedCalls()){
- if(hasSamePosition(currentCall, targetCall)){
- return true;
- }
- }
- return false;
- }
-
- private boolean hasSamePosition(INodeWrapper currentCall, INodeWrapper targetCall) {
- return JRubyRefactoringUtils.hasSamePosition(currentCall.getWrappedNode(), targetCall.getWrappedNode());
- }
-
-
-}
Copied: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/OccurenceReplaceSelectionPage.java (from rev 1988, trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/CallReplaceSelectionPage.java)
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/OccurenceReplaceSelectionPage.java (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/OccurenceReplaceSelectionPage.java 2007-02-21 10:04:53 UTC (rev 1989)
@@ -0,0 +1,148 @@
+/***** BEGIN LICENSE BLOCK *****
+ * Version: CPL 1.0/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Common Public
+ * License Version 1.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * Copyright (C) 2006 Lukas Felber <lf...@hs...>
+ * Copyright (C) 2006 Mirko Stocker <me...@mi...>
+ * Copyright (C) 2006 Thomas Corbat <tc...@hs...>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the CPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the CPL, the GPL or the LGPL.
+ ***** END LICENSE BLOCK *****/
+
+package org.rubypeople.rdt.refactoring.ui.pages;
+
+import java.util.ArrayList;
+
+import org.eclipse.ltk.ui.refactoring.UserInputWizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableItem;
+import org.jruby.lexer.yacc.ISourcePosition;
+import org.rubypeople.rdt.refactoring.JRubyRefactoringUtils;
+import org.rubypeople.rdt.refactoring.core.renamemethod.NodeSelector;
+import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
+import org.rubypeople.rdt.refactoring.nodewrapper.INodeWrapper;
+import org.rubypeople.rdt.refactoring.ui.RdtCodeViewer;
+
+public class OccurenceReplaceSelectionPage extends UserInputWizardPage {
+
+ public static final String NAME = "Select Calls...";
+ private final static RGB highlightColor = new RGB(173, 193, 217);
+
+ private NodeSelector selector;
+ private Table possibilityTable;
+ private DocumentProvider docProvider;
+
+
+ public OccurenceReplaceSelectionPage(NodeSelector selector, DocumentProvider docProvider) {
+ super(NAME);
+ this.selector = selector;
+ this.docProvider = docProvider;
+ }
+
+ public void createControl(Composite parent) {
+
+ Composite control = new Composite(parent, SWT.NONE);
+ FillLayout controlLayout = new FillLayout();
+ controlLayout.spacing = 10;
+ controlLayout.marginHeight = 10;
+ controlLayout.marginWidth = 10;
+ control.setLayout(controlLayout);
+ initPossibilityTable(control);
+ initCodeView(control);
+ setControl(control);
+ }
+
+ private void initCodeView(Composite control) {
+ final RdtCodeViewer viewer = RdtCodeViewer.create(control);
+ possibilityTable.addSelectionListener(new SelectionListener(){
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ INodeWrapper currentCall = (INodeWrapper) e.item.getData();
+ ISourcePosition pos = currentCall.getWrappedNode().getPosition();
+ String file = docProvider.getFileContent(currentCall.getWrappedNode().getPosition().getFile());
+ updateCodeViewer(viewer, pos, file);
+
+ updateChecks();
+ }
+
+ private void updateCodeViewer(final RdtCodeViewer viewer, ISourcePosition pos, String content) {
+ int length = pos.getEndOffset() - pos.getStartOffset();
+ viewer.setPreviewText(content);
+ viewer.setBackgroundColor(pos.getStartOffset(), length, highlightColor);
+ viewer.getTextWidget().setSelection(pos.getStartOffset());
+ viewer.getTextWidget().showSelection();
+ }
+
+ private void updateChecks() {
+ ArrayList<INodeWrapper> checkedCalls = new ArrayList<INodeWrapper>();
+ for(TableItem currentItem : possibilityTable.getItems()){
+ if(currentItem.getChecked()){
+ checkedCalls.add((INodeWrapper) currentItem.getData());
+ }
+ }
+ selector.setSelectedCalls(checkedCalls);
+ }
+ });
+ }
+
+ private void initPossibilityTable(Composite control) {
+ possibilityTable = new Table(control, SWT.BORDER | SWT.CHECK);
+ for(INodeWrapper currentCall : selector.getPossibleCalls()){
+ TableItem currentItem = new TableItem(possibilityTable, SWT.NONE);
+ currentItem.setText(getTableCaption(currentCall));
+ if(proableCall(currentCall)){
+ currentItem.setChecked(true);
+ }
+ currentItem.setData(currentCall);
+ }
+ }
+
+ private String getTableCaption(INodeWrapper currentCall) {
+ ISourcePosition pos = currentCall.getWrappedNode().getPosition();
+ return pos.getFile() + " line: " + (pos.getStartLine() + 1) ;
+ }
+
+ private boolean proableCall(INodeWrapper currentCall) {
+
+ for(INodeWrapper targetCall : selector.getSelectedCalls()){
+ if(hasSamePosition(currentCall, targetCall)){
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean hasSamePosition(INodeWrapper currentCall, INodeWrapper targetCall) {
+ return JRubyRefactoringUtils.hasSamePosition(currentCall.getWrappedNode(), targetCall.getWrappedNode());
+ }
+
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mir...@us...> - 2007-02-20 16:25:51
|
Revision: 1988
http://svn.sourceforge.net/rubyeclipse/?rev=1988&view=rev
Author: mirkostocker
Date: 2007-02-20 08:25:36 -0800 (Tue, 20 Feb 2007)
Log Message:
-----------
Change the refactoring tests to use the resource bundle to load test data (I hope this works correctly) and some other fixes, especially for Windows users.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/MemberElementInfo.java
trunk/org.rubypeople.rdt.refactoring/.classpath
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/ConvertTempToFieldAction.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/EncapsulateFieldAction.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/ExtractMethodAction.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/FormatSourceAction.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/GenerateAccessorsAction.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/GenerateConstructorAction.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/InlineClassAction.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/InlineMethodAction.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/InlineTempAction.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/MergeClassPartsAction.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/MergeClassPartsInFileAction.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/MergeWithExternalClassPartsAction.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/MoveFieldAction.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/MoveMethodAction.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/OverrideMethodAction.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/PushDownAction.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/RefactoringAction.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/RefactoringActionGroup.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/RenameAction.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/SplitTempAction.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/WorkbenchWindowActionDelegate.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/NodeProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/RubyRefactoring.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/SelectionNodeProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/converttemptofield/ClassVarNameProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/converttemptofield/ConvertTempToFieldRefactoring.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/converttemptofield/InstVarNameProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/converttemptofield/TempToFieldConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/converttemptofield/TempToFieldConverter.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/encapsulatefield/EncapsulateFieldRefactoring.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/extractmethod/ExtractMethodConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/extractmethod/ExtractMethodRefactoring.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/extractmethod/ExtractedMethodDef.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/extractmethod/ExtractedMethodHelper.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/generateaccessors/AccessorsGenerator.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlineclass/InlineClassRefactoring.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlineclass/InsertClassBuilder.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/InlineMethodRefactoring.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ParameterReplacer.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ReturnStatementReplacer.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/InlineTempConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/InlineTempConfig.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/InlineTempRefactoring.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movefield/MoveFieldConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movefield/MoveFieldRefactoring.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movemethod/MoveMethodRefactoring.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/rename/RenameConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/rename/RenameRefactoring.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renameclass/RenameClassConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renameclass/RenameClassRefactoring.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamefield/RenameFieldRefactoring.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/RenameLocalVariableRefactoring.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/RenameMethodConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/RenameMethodConfig.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/RenameMethodRefactoring.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/splittemp/SplitTempRefactoring.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/nodewrapper/FieldNodeWrapper.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/nodewrapper/LocalNodeWrapper.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/LabeledTextField.java
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/InlineTempPage.java
trunk/org.rubypeople.rdt.refactoring.tests/.classpath
trunk/org.rubypeople.rdt.refactoring.tests/META-INF/MANIFEST.MF
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/FilePropertyData.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/FileTestCase.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/FileTestData.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/FileTestSuite.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/MultiFileTestData.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/TestsPlugin.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/MultipleDocumentsInOneProvider.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/TC_SelectionNodeProvider.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/TS_Core.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/converttemptofield/TS_TempToField.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/converttemptofield/conditionchecks/TS_TempToFieldChecks.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/converttemptofield/conditionchecks/TempToFieldConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/encapsulatefield/TS_EncapsulateField.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/encapsulatefield/conditionchecks/EncapsulateFieldConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/encapsulatefield/conditionchecks/TS_EncapsulateFieldChecks.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/extractmethod/ExtractMethodTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/extractmethod/TS_ExtractMethod.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/extractmethod/conditionchecks/ExtractMethodConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/extractmethod/conditionchecks/TS_ExtractMethodChecks.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/generateaccessors/TS_GenerateAccessors.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/generateconstructor/TS_GenerateConstructor.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlineclass/ClassInlinerTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlineclass/TS_InlineClass.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlineclass/conditionchecks/InlineClassConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlineclass/conditionchecks/TS_InlineClassChecks.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinemethod/InlineMethodTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinemethod/TC_ParameterReplacer.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinemethod/TS_InlineMethod.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinemethod/conditions/InlineMethodConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinemethod/conditions/TS_InlineMethodChecks.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinetemp/TS_InlineTemp.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinetemp/conditionchecks/InlineTempConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinetemp/conditionchecks/TS_InlineTempConditionChecks.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/mergeclasspartsinfile/TS_MergeClassPartsInFile.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/mergeclasspartsinfile/conditionchecks/MergeInFileConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/mergeclasspartsinfile/conditionchecks/TS_MergeClassPartsInFileChecks.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/mergewithexternalclassparts/MergeWithExternalClassPartsTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/mergewithexternalclassparts/TS_MergeWithExternalClassParts.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/mergewithexternalclassparts/conditionchecks/MergeWithExternalConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/mergewithexternalclassparts/conditionchecks/TS_MergetWitExternalChecks.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/movefield/MoveFieldTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/movefield/TS_MoveField.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/movefield/conditionchecks/MoveFieldConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/movefield/conditionchecks/TS_MoveFieldChecks.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/movemethod/MoveMethodTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/movemethod/TS_MoveMethod.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/movemethod/conditionchecks/MoveMethodConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/movemethod/conditionchecks/TS_MoveMethodChecks.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/overridemethod/TS_OverrideMethod.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/pushdown/TS_PushDown.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/rename/RenameTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/rename/TS_Rename.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renameclass/ClassRenameTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renameclass/TC_ClassFinder.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renameclass/TC_ClassInstanciationFinder.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renameclass/TS_RenameClass.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renameclass/conditionchecker/RenameClassConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renameclass/conditionchecker/TS_RenameClassChecks.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamefield/FieldRenamerTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamefield/TS_RenameField.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamefield/conditionchecks/RenameFieldConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamefield/conditionchecks/TS_RenameFieldChecks.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocalvariable/RenameTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocalvariable/TS_RenameLocalVariable.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocalvariable/conditionchecks/RenameLocalConditionChecker.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocalvariable/conditionchecks/TS_RenameLocalCondition.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamemethod/MethodRenamerTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamemethod/TS_RenameMethod.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamemethod/conditioncheck/RenameMethodConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamemethod/conditioncheck/TS_RenameMethodChecks.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamemethod/selection/RenameMethodSelectionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamemethod/selection/TS_RenameMethodSelection.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splittemp/SplitTempTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splittemp/TC_LocalVarFinder.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splittemp/TC_SplittedVariableRenamer.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splittemp/TS_SplitTemp.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splittemp/conditionchecks/SplitTempConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splittemp/conditionchecks/TS_SplitTempChecks.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/util/TS_Util.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/TextSelectionProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/util/FileHelper.java
trunk/org.rubypeople.rdt.refactoring.tests/resources/
trunk/org.rubypeople.rdt.refactoring.tests/resources/classnodeprovider/
trunk/org.rubypeople.rdt.refactoring.tests/resources/classnodeprovider/class_node_provider_test_1
trunk/org.rubypeople.rdt.refactoring.tests/resources/classnodeprovider/tc_included_classes_provider.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/classnodeprovider/tc_included_classes_provider_2.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/conditionchecks/
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/conditionchecks/create_stub.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/conditionchecks/temp_to_field_checker_test_1.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/conditionchecks/temp_to_field_checker_test_1.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/conditionchecks/temp_to_field_checker_test_10.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/conditionchecks/temp_to_field_checker_test_10.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/conditionchecks/temp_to_field_checker_test_2.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/conditionchecks/temp_to_field_checker_test_2.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/conditionchecks/temp_to_field_checker_test_3.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/conditionchecks/temp_to_field_checker_test_3.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/conditionchecks/temp_to_field_checker_test_4.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/conditionchecks/temp_to_field_checker_test_4.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/conditionchecks/temp_to_field_checker_test_5.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/conditionchecks/temp_to_field_checker_test_5.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/conditionchecks/temp_to_field_checker_test_6.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/conditionchecks/temp_to_field_checker_test_6.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/conditionchecks/temp_to_field_checker_test_7.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/conditionchecks/temp_to_field_checker_test_7.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/conditionchecks/temp_to_field_checker_test_8.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/conditionchecks/temp_to_field_checker_test_8.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/conditionchecks/temp_to_field_checker_test_9.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/conditionchecks/temp_to_field_checker_test_9.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/create_stub.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_1.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_1.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_1.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_10.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_10.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_10.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_12.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_12.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_12.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_13.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_13.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_13.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_14.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_14.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_14.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_15.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_15.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_15.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_16.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_16.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_16.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_17.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_17.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_17.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_2.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_2.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_2.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_3.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_3.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_3.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_4.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_4.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_4.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_5.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_5.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_5.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_6.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_6.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_6.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_7.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_7.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_7.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_8.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_8.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_8.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_9.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_9.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/temp_to_field_test_9.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/conditionchecks/
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/conditionchecks/create_stub.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/conditionchecks/encapsulate_field_checker_test_1.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/conditionchecks/encapsulate_field_checker_test_1.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/conditionchecks/encapsulate_field_checker_test_2.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/conditionchecks/encapsulate_field_checker_test_2.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/conditionchecks/encapsulate_field_checker_test_3.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/conditionchecks/encapsulate_field_checker_test_3.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/conditionchecks/encapsulate_field_checker_test_4.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/conditionchecks/encapsulate_field_checker_test_4.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/create_stub.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/encapsulate_field_test_1.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/encapsulate_field_test_1.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/encapsulate_field_test_1.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/encapsulate_field_test_2.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/encapsulate_field_test_2.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/encapsulate_field_test_2.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/encapsulate_field_test_3.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/encapsulate_field_test_3.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/encapsulate_field_test_3.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/encapsulate_field_test_4.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/encapsulate_field_test_4.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/encapsulate_field_test_4.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/encapsulate_field_test_5.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/encapsulate_field_test_5.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/encapsulate_field_test_5.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/encapsulate_field_test_6.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/encapsulate_field_test_6.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/encapsulate_field_test_6.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/encapsulate_field_test_7.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/encapsulate_field_test_7.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/encapsulate_field_test_7.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/encapsulate_field_test_8.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/encapsulate_field_test_8.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/encapsulatefield/encapsulate_field_test_8.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/enclosing_nodes_test_1.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/enclosing_nodes_test_1.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/enclosing_nodes_test_2.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/enclosing_nodes_test_2.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/enclosing_nodes_test_3.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/enclosing_nodes_test_3.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/enclosing_nodes_test_4.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/enclosing_nodes_test_4.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/enclosing_nodes_test_5.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/enclosing_nodes_test_5.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/enclosing_nodes_test_6.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/enclosing_nodes_test_6.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/enclosing_nodes_test_7.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/enclosing_nodes_test_7.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/conditionchecks/
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/conditionchecks/create_stub.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/conditionchecks/create_stub_win.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/conditionchecks/extract_method_checker_test_1.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/conditionchecks/extract_method_checker_test_1.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/conditionchecks/extract_method_checker_test_10.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/conditionchecks/extract_method_checker_test_10.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/conditionchecks/extract_method_checker_test_11.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/conditionchecks/extract_method_checker_test_11.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/conditionchecks/extract_method_checker_test_12.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/conditionchecks/extract_method_checker_test_12.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/conditionchecks/extract_method_checker_test_2.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/conditionchecks/extract_method_checker_test_2.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/conditionchecks/extract_method_checker_test_3.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/conditionchecks/extract_method_checker_test_3.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/conditionchecks/extract_method_checker_test_4.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/conditionchecks/extract_method_checker_test_4.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/conditionchecks/extract_method_checker_test_5.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/conditionchecks/extract_method_checker_test_5.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/conditionchecks/extract_method_checker_test_6.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/conditionchecks/extract_method_checker_test_6.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/conditionchecks/extract_method_checker_test_7.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/conditionchecks/extract_method_checker_test_7.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/conditionchecks/extract_method_checker_test_8.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/conditionchecks/extract_method_checker_test_8.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/conditionchecks/extract_method_checker_test_9.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/conditionchecks/extract_method_checker_test_9.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/create_stub.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/create_stub_win.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_1.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_1.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_1.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_10.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_10.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_10.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_11.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_11.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_11.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_12.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_12.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_12.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_13.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_13.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_13.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_14.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_14.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_14.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_15.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_15.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_15.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_17.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_17.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_17.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_18.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_18.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_18.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_19.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_19.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_19.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_2.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_2.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_2.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_20.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_20.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_20.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_21.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_21.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_21.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_22.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_22.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_22.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_3.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_3.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_3.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_4.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_4.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_4.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_5.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_5.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_5.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_6.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_6.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_6.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_7.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_7.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_7.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_8.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_8.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_8.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_9.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_9.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/extractmethod/extract_method_test_9.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/create_stub.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_1.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_1.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_1.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_10.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_10.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_10.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_11.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_11.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_11.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_12.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_12.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_12.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_13.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_13.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_13.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_14.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_14.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_14.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_15.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_15.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_15.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_16.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_16.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_16.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_2.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_2.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_2.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_3.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_3.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_3.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_4.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_4.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_4.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_5.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_5.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_5.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_6.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_6.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_6.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_7.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_7.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_7.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_8.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_8.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_8.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_9.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_9.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateaccessors/generate_accesssor_9.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateconstructor/
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateconstructor/create_stub.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateconstructor/generate_constructor_1.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateconstructor/generate_constructor_1.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateconstructor/generate_constructor_1.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateconstructor/generate_constructor_2.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateconstructor/generate_constructor_2.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateconstructor/generate_constructor_2.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateconstructor/generate_constructor_3.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateconstructor/generate_constructor_3.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateconstructor/generate_constructor_3.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateconstructor/generate_constructor_4.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateconstructor/generate_constructor_4.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/generateconstructor/generate_constructor_4.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/conditionchecks/
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/conditionchecks/inline_class_checker_test_1.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/conditionchecks/inline_class_checker_test_1.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/conditionchecks/inline_class_checker_test_2.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/conditionchecks/inline_class_checker_test_2.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/conditionchecks/inline_class_checker_test_3.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/conditionchecks/inline_class_checker_test_3.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/conditionchecks/inline_class_checker_test_4.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/conditionchecks/inline_class_checker_test_4.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/conditionchecks/inline_class_checker_test_5.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/conditionchecks/inline_class_checker_test_5.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/conditionchecks/inline_class_checker_test_6.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/conditionchecks/inline_class_checker_test_6.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_1.activeFile.rb.result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_1.activeFile.rb.source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_1.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_10.activeFile.rb.result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_10.activeFile.rb.source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_10.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_2.activeFile.rb.result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_2.activeFile.rb.source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_2.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_3.activeFile.rb.result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_3.activeFile.rb.source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_3.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_4.activeFile.rb.result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_4.activeFile.rb.source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_4.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_5.activeFile.rb.result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_5.activeFile.rb.source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_5.includeFile.rb.result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_5.includeFile.rb.source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_5.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_6.activeFile.rb.result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_6.activeFile.rb.source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_6.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_7.activeFile.rb.result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_7.activeFile.rb.source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_7.includeFile.rb.result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_7.includeFile.rb.source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_7.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_8.activeFile.rb.result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_8.activeFile.rb.source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_8.includeFile.rb.result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_8.includeFile.rb.source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_8.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_9.activeFile.rb.result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_9.activeFile.rb.source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_9.includeFile.rb.result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_9.includeFile.rb.source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_9.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/TC_MethodBodyStatementReplacer.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/TC_MethodFinder.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/TC_RenameDuplicatedVariables.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/TC_ReturnStatementReplacer.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/TC_SelectedCallFinder.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/TC_TargetClassFinder.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/conditions/
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/conditions/inline_method_checker_test_1.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/conditions/inline_method_checker_test_1.test_source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/conditions/inline_method_checker_test_2.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/conditions/inline_method_checker_test_2.test_source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/conditions/inline_method_checker_test_3.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/conditions/inline_method_checker_test_3.test_source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/conditions/inline_method_checker_test_4.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/conditions/inline_method_checker_test_4.test_source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/conditions/inline_method_checker_test_5.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/conditions/inline_method_checker_test_5.test_source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/inline_method_test_1.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/inline_method_test_1.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/inline_method_test_1.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/inline_method_test_10.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinemethod/inline_method_test_10.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resource...
[truncated message content] |
|
From: <caw...@us...> - 2007-02-20 14:20:56
|
Revision: 1987
http://svn.sourceforge.net/rubyeclipse/?rev=1987&view=rev
Author: cawilliams
Date: 2007-02-20 06:20:48 -0800 (Tue, 20 Feb 2007)
Log Message:
-----------
apply Martin's migrating-diff patch (Ticket #247)
Modified Paths:
--------------
trunk/org.rubypeople.rdt/rdt.license
trunk/org.rubypeople.rdt-feature/feature.xml
trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/model/RubyDebugTarget.java
trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_RubyDebugCommunicationTest.java
trunk/org.rubypeople.rdt.doc.user/docbook.xml
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMDebugger.java
trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RunnerLaunching.java
Modified: trunk/org.rubypeople.rdt/rdt.license
===================================================================
--- trunk/org.rubypeople.rdt/rdt.license 2007-02-20 14:10:08 UTC (rev 1986)
+++ trunk/org.rubypeople.rdt/rdt.license 2007-02-20 14:20:48 UTC (rev 1987)
@@ -7,7 +7,7 @@
See www.rubypeople.org for more information.
The RDT is bundled with the kxml2 pull parser, which is under CPL as well.
-The file org.rubypeople.rdt.launching/ruby/eclipseDebug.rb is based on the debug.rb file, which is part
+The file org.rubypeople.rdt.launching/ruby/classic-debug.rb is based on the debug.rb file, which is part
of the ruby 1.6.8 release.
Because of the nature of developing this plugin, many features or concepts have been copied from
the jdt. Therefore you will find code fragements which have been copied from the jdt. We did not
@@ -113,4 +113,4 @@
Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
-
\ No newline at end of file
+
Modified: trunk/org.rubypeople.rdt-feature/feature.xml
===================================================================
--- trunk/org.rubypeople.rdt-feature/feature.xml 2007-02-20 14:10:08 UTC (rev 1986)
+++ trunk/org.rubypeople.rdt-feature/feature.xml 2007-02-20 14:20:48 UTC (rev 1987)
@@ -30,7 +30,7 @@
RegExp plug-in, http://e-p-i-c.sourceforge.net
JRuby, http://jruby.codehaus.org/
kxml2, http://kxml.sourceforge.net
-The file org.rubypeople.rdt.launching/ruby/eclipseDebug.rb
+The file org.rubypeople.rdt.launching/ruby/classic-debug.rb
is based on the debug.rb file, which is part of the ruby 1.6.8
release. Because of the nature of developing this plugin, many
features or concepts have been copied from the JDT. Therefore
Modified: trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/model/RubyDebugTarget.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/model/RubyDebugTarget.java 2007-02-20 14:10:08 UTC (rev 1986)
+++ trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/model/RubyDebugTarget.java 2007-02-20 14:20:48 UTC (rev 1987)
@@ -53,7 +53,7 @@
this.isTerminated = false ;
IBreakpointManager manager= DebugPlugin.getDefault().getBreakpointManager();
manager.addBreakpointListener(this);
- addDebugParameter("$EclipseListenPort=" + port);
+ addDebugParameter("$RemoteDebugPort=" + port);
}
public RubyDebugTarget(ILaunch launch, int port) {
@@ -247,7 +247,7 @@
public File getDebugParameterFile() {
if (debugParameterFile == null) {
try {
- debugParameterFile = File.createTempFile("eclipseDebug",".rb") ;
+ debugParameterFile = File.createTempFile("classic-debug",".rb") ;
} catch (IOException e) {
RdtDebugCorePlugin.log("Could not create debugParameterFile", e) ;
}
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-20 14:10:08 UTC (rev 1986)
+++ trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_RubyDebugCommunicationTest.java 2007-02-20 14:20:48 UTC (rev 1987)
@@ -78,7 +78,7 @@
String cmd = "rdebug -s -w -n -p 1098 --cport 1099 -d -f xml -I " + getTmpDir().replace('\\', '/') + " " + getRubyTestFilename();
// "FTC_DebuggerCommunicationTest.RUBY_INTERPRETER + " -I" +
// createIncludeDir() + " -I" + getTmpDir().replace('\\', '/') + "
- // -reclipseDebugVerbose.rb " + ;
+ // -rclassic-debug-verbose.rb " + ;
System.out.println("Starting: " + cmd);
process = Runtime.getRuntime().exec(cmd);
rubyStderrRedirectorThread = new OutputRedirectorThread(process.getErrorStream());
Modified: trunk/org.rubypeople.rdt.doc.user/docbook.xml
===================================================================
--- trunk/org.rubypeople.rdt.doc.user/docbook.xml 2007-02-20 14:10:08 UTC (rev 1986)
+++ trunk/org.rubypeople.rdt.doc.user/docbook.xml 2007-02-20 14:20:48 UTC (rev 1987)
@@ -719,7 +719,7 @@
<orderedlist>
<listitem>
<para>open file
- ECLIPSE_HOME/plugins/org.rubypeople.rdt.launching/ruby/eclipseDebug.rb</para>
+ ECLIPSE_HOME/plugins/org.rubypeople.rdt.launching/ruby/classic-debug.rb</para>
</listitem>
<listitem>
<para>set ECLIPSE_VERBOSE = true</para>
@@ -813,4 +813,4 @@
click of an element </listitem>
</itemizedlist>
</chapter>
-</book>
\ No newline at end of file
+</book>
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMDebugger.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMDebugger.java 2007-02-20 14:10:08 UTC (rev 1986)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMDebugger.java 2007-02-20 14:20:48 UTC (rev 1987)
@@ -149,9 +149,9 @@
}
if (RdtDebugCorePlugin.isRubyDebuggerVerbose() || isDebuggerVerbose()) {
- arguments.add("-reclipseDebugVerbose");
+ arguments.add("-rclassic-debug-verbose");
} else {
- arguments.add("-reclipseDebug");
+ arguments.add("-rclassic-debug");
}
// FIXME Somehow hook this into the loadpath stuff?
arguments.add("-I");
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-20 14:10:08 UTC (rev 1986)
+++ trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RunnerLaunching.java 2007-02-20 14:20:48 UTC (rev 1987)
@@ -70,7 +70,7 @@
protected List getCommandLine(IProject project, boolean debug) {
List commandLine = new ArrayList();
if (debug) {
- commandLine.add("-reclipseDebug");
+ commandLine.add("-rclassic-debug");
}
// The include paths and the executed ruby file is quoted on windows
if (debug) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-20 14:10:16
|
Revision: 1986
http://svn.sourceforge.net/rubyeclipse/?rev=1986&view=rev
Author: cawilliams
Date: 2007-02-20 06:10:08 -0800 (Tue, 20 Feb 2007)
Log Message:
-----------
renamed debugger files, apply Martin' classic-debug patch
Added Paths:
-----------
trunk/org.rubypeople.rdt.launching/ruby/classic-debug-verbose.rb
trunk/org.rubypeople.rdt.launching/ruby/classic-debug.rb
Added: trunk/org.rubypeople.rdt.launching/ruby/classic-debug-verbose.rb
===================================================================
--- trunk/org.rubypeople.rdt.launching/ruby/classic-debug-verbose.rb (rev 0)
+++ trunk/org.rubypeople.rdt.launching/ruby/classic-debug-verbose.rb 2007-02-20 14:10:08 UTC (rev 1986)
@@ -0,0 +1,3 @@
+module DebugVerbose
+end
+require 'eclipseDebug'
\ No newline at end of file
Added: trunk/org.rubypeople.rdt.launching/ruby/classic-debug.rb
===================================================================
--- trunk/org.rubypeople.rdt.launching/ruby/classic-debug.rb (rev 0)
+++ trunk/org.rubypeople.rdt.launching/ruby/classic-debug.rb 2007-02-20 14:10:08 UTC (rev 1986)
@@ -0,0 +1,1189 @@
+# Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
+# Copyright (C) 2000 Information-technology Promotion Agency, Japan
+require 'cgi'
+require 'thread'
+
+# REMOTE_DEBUG_PORT is the port on which the debugger waits for commands from a
+# front-end.
+#
+# RDT note: if you change this, you must also change the corresponding port in
+# org.rubypeople.rdt.internal.debug.core.RubyDebuggerProxy
+REMOTE_DEBUG_PORT = (defined? $RemoteDebugPort) ? $RemoteDebugPort : 1098
+
+# VERBOSE_DEBUGGER prints the communication between a front-end and ruby
+# debugger on stderr. If you have started a front-end debug session (and use
+# default preferences for colors of streams), the communication will be printed
+# in red letters to the front-end console.
+VERBOSE_DEBUGGER = defined? DebugVerbose
+
+class PrinterMultiplexer
+ def initialize
+ @printers = []
+ end
+
+ def addPrinter(printer)
+ @printers << printer
+ end
+
+ def method_missing(methodName, *args)
+ @printers.each { |printer|
+ printer.send(methodName, *args)
+ }
+ end
+end
+
+class XmlPrinter
+
+ def initialize(socket)
+ @socket = socket
+ end
+
+ def out(*params)
+ debugIntern(false, *params)
+ if @socket then
+ @socket.printf(*params)
+ end
+ end
+
+ def printXml(s, *params)
+ out(s, *params)
+ end
+
+ def printError(s, *params)
+ out("<error>" + s + "</error>", *params)
+ end
+
+ def printVariable(name, binding, kind)
+ printVariableValue(name, eval(name, binding), kind)
+ end
+
+ def printVariableValue(name, value, kind)
+ if value == nil then
+ out("<variable name=\"%s\" kind=\"%s\"/>", CGI.escapeHTML(name), kind)
+ return
+ end
+ if value.class().name == "Array" or value.class().name == "Hash" then
+ hasChildren = value.length > 0
+ if value.length == 0 then
+ valueString = "Empty " + value.class().name
+ else
+ valueString = value.class().name + " (" + value.length.to_s + " element(s))"
+ end
+ else
+ hasChildren = value.instance_variables.length > 0 || value.class.class_variables.length > 0
+ valueString = value.to_s
+ if valueString =~ /^\"/ then
+ valueString.slice!(1..(valueString.length)-2)
+ end
+ end
+ out("<variable name=\"%s\" kind=\"%s\" value=\"%s\" type=\"%s\" hasChildren=\"%s\" objectId=\"%#+x\"/>", CGI.escapeHTML(name), kind, CGI.escapeHTML(valueString), value.class(), hasChildren, value.respond_to?(:object_id) ? value.object_id : value.id)
+ end
+
+ def printBreakpoint(n, debugFuncName, file, pos)
+ out("<breakpoint file=\"%s\" line=\"%s\" threadId=\"%s\"/>", file, pos, DEBUGGER__.get_thread_num())
+ end
+
+ def printException(file, pos, exception)
+ out("<exception file=\"%s\" line=\"%s\" type=\"%s\" message=\"%s\" threadId=\"%s\"/>", file, pos, exception.class, CGI.escapeHTML(exception.to_s), DEBUGGER__.get_thread_num())
+ end
+
+ def printStepEnd(file, line, framesCount)
+ out("<suspended file=\"%s\" line=\"%s\" frames=\"%s\" threadId=\"%s\"/>", file, line, framesCount, DEBUGGER__.get_thread_num())
+ end
+
+ def printFrame(pos, n, file, line, id)
+ out("<frame no=\"%s\" file=\"%s\" line=\"%s\"/>", n, file, line)
+ end
+
+ def printThread(num, thread)
+ out("<thread id=\"%s\" status=\"%s\"/>", num, thread.status)
+ end
+
+ def printLoadResult(file, exception=nil)
+ if exception then
+ out("<loadResult file=\"%s\" exceptionType=\"%s\" exceptionMessage=\"%s\"/>", file, exception.class, CGI.escapeHTML(exception.to_s))
+ else
+ out("<loadResult file=\"%s\" status=\"OK\"/>", file)
+ end
+ end
+
+ def debug(*params)
+ debugIntern(true, *params)
+ end
+
+ def debugIntern(escape, *params)
+ if VERBOSE_DEBUGGER then
+ output = sprintf(*params)
+ output = CGI.escapeHTML(output) if escape
+ STDERR.print(output)
+# STDERR.print(' [[' + caller(0)[2].sub(/[^:]*:/, '') + ' ')
+# STDERR.print(Thread.current.to_s + ']]')
+ STDERR.print("\n")
+ end
+ end
+end
+
+#multiplex = PrinterMultiplexer.new
+#multiplex.addPrinter(XmlPrinter.new(nil))
+#multiplex.addPrinter(XmlPrinter.new(nil))
+#multiplex.printXml("TEST")
+
+require 'socket'
+require 'tracer'
+
+class Tracer
+ def Tracer.trace_func(*vars)
+ Single.trace_func(*vars)
+ end
+end
+
+SCRIPT_LINES__ = {} unless defined? SCRIPT_LINES__
+
+class DEBUGGER__
+
+ class CommandLinePrinter
+ def printXml(s)
+ # print XML only
+ end
+
+ def printVariable(name, binding, kind)
+ stdout.printf " %s => %s\n", name, eval(name, binding).inspect
+ end
+
+ def printBreakpoint(n, debugFuncName, file, pos)
+ stdout.printf "Breakpoint %d, %s at %s:%s\n", n, debugFuncName, file, pos
+ stdout.flush
+ end
+
+ def printFrame(pos, n, file, line, id)
+ if pos == n
+ stdout.printf "--> #%d %s:%s%s\n", n, file, line, id ? ":in `#{id.id2name}'":""
+ else
+ stdout.printf " #%d %s:%s%s\n", n, file, line, id ? ":in `#{id.id2name}'":""
+ end
+ end
+
+ def printException(file, line, exception)
+ stdout.printf "%s:%d: `%s' (%s)\n", file, line, exception, exception.class
+ stdout.flush
+ end
+
+ def printThread(num, thread)
+ if thread == Thread.current
+ stdout.print "+"
+ else
+ stdout.print " "
+ end
+ stdout.printf "%d ", num
+ stdout.print thread.inspect, "\t"
+ file = DEBUGGER__.context(thread).instance_eval{@file}
+ if file
+ stdout.print file, ":", DEBUGGER__.context(thread).instance_eval{@line}
+ end
+ stdout.print "\n"
+ end
+
+
+ def printStepEnd(file, line, framesCount)
+
+ end
+
+ def debug(*params)
+
+ end
+
+ def stdout
+ DEBUGGER__.stdout
+ end
+ end
+
+ class Context
+ attr_reader :shouldResume
+ def initialize
+ @printer = DEBUGGER__.printer
+ @socket = DEBUGGER__.socket
+ @stop_next = 0
+ @last_file = nil
+ @file = nil
+ @line = nil
+ @no_step = nil
+ @frames = []
+ @current_frame = -1
+ @finish_pos = 0
+ @trace = false
+ @catch = nil # "StandardError"
+ @suspend_next = false
+ @shouldResume = false
+ end
+
+ def stop_next(n=1)
+ @stop_next = n
+ end
+
+ def set_suspend
+ @suspend_next = true
+ end
+
+ def clear_suspend
+ @suspend_next = false
+ end
+
+ def stopCurrentThread
+ @printer.debug("Suspending : %s", Thread.current)
+ Thread.stop()
+ @printer.debug("Resumed : %s", Thread.current)
+ end
+
+ def trace?
+ @trace
+ end
+
+ def set_trace(arg)
+ @trace = arg
+ end
+
+ def stdout
+ if @socket then
+ @socket
+ else
+ DEBUGGER__.stdout
+ end
+ end
+
+ def break_points
+ DEBUGGER__.break_points
+ end
+
+ def display
+ DEBUGGER__.display
+ end
+
+ def context(th)
+ DEBUGGER__.context(th)
+ end
+
+ def set_trace_all(arg)
+ DEBUGGER__.set_trace(arg)
+ end
+
+ def set_last_thread(th)
+ DEBUGGER__.set_last_thread(th)
+ end
+
+ def debug_eval_private(str, binding)
+ # evaluates str like "var.@instance_var.@instance_var"
+ # and "var.privateMethod"
+ # return value might be nil
+ # the scan must detect array and hash accesses, which might
+ # themselves contain point separated expressions, e.g.
+ # array[Test.getX].y
+ names = str.scan(/[^\[\]]*(?=\.)|.*\[.*\](?=\.)|.*$/)
+ # names can contain empty strings
+ obj = eval(names[0], binding)
+ (1..names.length-1).each { |i|
+ if names[i] != "" then
+ if names[i].length > 2 && names[i][0..1] == '@@' then
+ @printer.debug("Evaluating (class_var): %s on %s", names[i], obj )
+ obj = obj.class.class_eval("#{names[i]}")
+ else
+ @printer.debug("Evaluating (instance_var): %s on %s", names[i], obj )
+ obj = obj.instance_eval("#{names[i]}")
+ end
+ end
+ }
+ return obj
+ end
+
+ def debug_eval(str, binding, noPrivateInstanceVars = false)
+ begin
+ if noPrivateInstanceVars then
+ val = eval(str, binding)
+ else
+ val = debug_eval_private(str, binding)
+ end
+ val
+ rescue ScriptError, StandardError => error
+ if error.to_s =~ /private method .* called for/ then
+ return debug_eval(str, binding, true)
+ end
+ @printer.debug("Error in debug_eval (noPrivateInstancsVars=%s): %s", noPrivateInstanceVars, error)
+ raise error
+ end
+ end
+
+ def debug_silent_eval(str, binding)
+ begin
+ val = eval(str, binding)
+ val
+ rescue StandardError, ScriptError
+ nil
+ end
+ end
+
+ def var_list(ary, binding, kind)
+ ary.sort!
+ @printer.printXml("<variables>")
+ for v in ary
+ @printer.printVariable(v,binding, kind)
+ end
+ @printer.printXml("</variables>")
+ end
+
+ def printArrayElements(array)
+ index = 0
+ array.each { |e|
+ @printer.printVariableValue('[' + index.to_s + ']', e, 'instance')
+ index += 1
+ }
+ end
+
+ def printHashElements(hash)
+ hash.keys.each { | k |
+ if k.class.name == "String"
+ name = '\'' + k + '\''
+ else
+ name = k.to_s
+ end
+ @printer.printVariableValue(name, hash[k], 'instance')
+ }
+ end
+
+
+ def getConstantsInClass(aClass)
+ constants = aClass.constants() - Object.constants
+ return constants.delete_if { |c| ! aClass.const_defined? c }
+ end
+
+
+ def getBinding(pos)
+ # returns frame info of frame pos, if pos is within bound, nil otherwise
+ pos = @current_frame unless pos
+ pos = pos.to_i - 1
+ if pos < 0 then
+ @printer.debug("ERROR: illegal stack frame, using top frame.")
+ pos = 0
+ end
+ if pos >= @frames.size then
+ @printer.debug("ERROR: given stack frame number %i too high.", pos + 1)
+ pos = @frames.size - 1
+ end
+ @printer.debug("Using frame %s (1-based) for evaluation of variable.", pos + 1)
+ return @frames[pos][0]
+ end
+
+
+ def debug_variable_info(input, binding)
+
+ case input
+ when /^\s*g(?:lobal)?$/
+ var_list(global_variables, binding, 'global')
+
+ when /^\s*l(?:ocal)?\s*(\d+)?$/
+ @printer.debug("Getting binding for frame #{$1}")
+ new_binding = getBinding($1)
+ if new_binding then
+ binding = new_binding
+ end
+ begin
+ #@printer.debug("binding=%s", binding)
+ localVars = eval("local_variables", binding)
+ # v 1.8.1 dies in eval @printer.debug("HERE")
+ if eval('self.to_s', binding) !~ /main/ then
+ localVars << "self"
+ end
+ var_list(localVars, binding, 'local')
+ rescue StandardError => bang
+ @printer.debug("Exception while evaluating local_variables: %s", bang)
+ var_list([], binding, 'local')
+ end
+
+ when /^\s*i(?:nstance)?\s*(\d+)?\s+((?:[\\+-]0x)[\dabcdef]+)?/
+ new_binding = getBinding($1)
+ if new_binding then
+ binding = new_binding
+ end
+ begin
+ @printer.printXml("<variables>")
+ if $2 then
+ obj = ObjectSpace._id2ref($2.hex)
+ if (!obj) then
+ @printer.debug("unknown object id : %s", $2)
+ end
+ else
+ obj = debug_eval($', binding)
+ end
+ if (obj.class.name == "Array") then
+ printArrayElements(obj)
+ return
+ end
+ if (obj.class.name == "Hash") then
+ printHashElements(obj)
+ return
+ end
+ @printer.debug("%s", obj)
+ instanceBinding = obj.instance_eval{binding()}
+ obj.instance_variables.each {
+ | instanceVar |
+ @printer.printVariable(instanceVar, instanceBinding, 'instance')
+ }
+ classBinding = obj.class.class_eval('binding()')
+ obj.class.class_variables.each {
+ | classVar |
+ @printer.printVariable(classVar, classBinding, 'class')
+ }
+ # I'd like to optimize getting the constants, but they are more dynamic
+ # than one would expect from true constants.
+ getConstantsInClass(obj.class).each {
+ | constant |
+ @printer.printVariable(constant, classBinding, 'constant')
+ }
+ rescue StandardError => error
+ @printer.debug("%s", error)
+ ensure
+ @printer.printXml("</variables>")
+ end
+
+
+ when /^\s*inspect\s*(\d+)?\s+/
+ new_binding = getBinding($1)
+ if new_binding then
+ binding = new_binding
+ end
+ begin
+ obj = debug_eval($', binding, true)
+ rescue ScriptError, StandardError => error
+ @printer.printXml("<processingException type=\"%s\" message=\"%s\"/>", error.class, error.message)
+ return
+ end
+ @printer.debug("%s", obj)
+ @printer.printXml("<variables>")
+ @printer.printVariableValue($', obj, "local")
+ @printer.printXml("</variables>")
+
+
+ end
+ end
+
+ def debug_method_info(input, binding)
+ case input
+ when /^i(:?nstance)?\s+/
+ obj = debug_eval($', binding) # correct highlighting since RDT editor does not recognize $'
+
+ len = 0
+ for v in obj.methods.sort
+ len += v.size + 1
+ if len > 70
+ len = v.size + 1
+ stdout.print "\n"
+ end
+ stdout.print v, " "
+ end
+ stdout.print "\n"
+
+ else
+ obj = debug_eval(input, binding)
+ unless obj.kind_of? Module
+ stdout.print "Should be Class/Module: ", input, "\n"
+ else
+ len = 0
+ for v in obj.instance_methods.sort
+ len += v.size + 1
+ if len > 70
+ len = v.size + 1
+ stdout.print "\n"
+ end
+ stdout.print v, " "
+ end
+ stdout.print "\n"
+ end
+ end
+ end
+
+ def thnum(thread=Thread.current)
+ num = DEBUGGER__.instance_eval{@thread_list[thread]}
+ unless num
+ DEBUGGER__.make_thread_list
+ num = DEBUGGER__.instance_eval{@thread_list[thread]}
+ end
+ num
+ end
+
+ def processInput(input)
+ binding, file, line, id = @frames[0]
+ input.split(";").each {
+ | singleCommand |
+ readUserInput(binding, file, line, singleCommand.strip)
+ }
+ end
+
+ def readUserInput(binding, binding_file, binding_line, input)
+
+ @printer.debug("Processing #{input}, binding=%s", binding)
+ @shouldResume = false
+ frame_pos = 0
+ previous_line = nil
+ display_expressions(binding)
+
+
+
+ case input
+ when /^\s*tr(?:ace)?(?:\s+(on|off))?(?:\s+(all))?$/
+ if defined?( $2 )
+ if $1 == 'on'
+ set_trace_all true
+ else
+ set_trace_all false
+ end
+ elsif defined?( $1 )
+ if $1 == 'on'
+ set_trace true
+ else
+ set_trace false
+ end
+ end
+ if trace?
+ stdout.print "Trace on.\n"
+ else
+ stdout.print "Trace off.\n"
+ end
+
+ when /^\s*b\s+((?:.*?:)?.+)$/
+ #@printer.debug("S")
+ pos = $1
+ if pos.index(":")
+ file, pos = pos.split(":")
+ end
+ file = File.basename(file)
+ if pos =~ /^\d+$/
+ pname = pos
+ pos = pos.to_i
+ else
+ pname = pos = pos.intern.id2name
+ end
+ # TODO: pname is not used
+ break_points.push [true, 0, file, pos]
+ @printer.printXml("<breakpointAdded no=\"%d\" location=\"%s:%s\"/>", break_points.size, file, pos)
+
+ when /^\s*delete\s+(\d+)$/
+ pos = $1.to_i
+ if pos < 1 || pos > break_points.length
+ @printer.printXml("<error>Breakpoint number out of bounds: %d. There are currently %d breakpoints defined.</error>", pos, break_points.length )
+ else
+ break_points.delete_at(pos-1)
+ @printer.printXml("<breakpointDeleted no=\"%d\"/>", pos)
+ end
+
+ # when /^\s*wat(?:ch)?\s+(.+)$/
+ # exp = $1
+ # break_points.push [true, 1, exp]
+ # stdout.printf "Set watchpoint %d\n", break_points.size, exp
+
+ # when /^\s*b(?:reak)?$/
+ # if break_points.find{|b| b[1] == 0}
+ # n = 1
+ # stdout.print "Breakpoints:\n"
+ # for b in break_points
+ # if b[0] and b[1] == 0
+ # stdout.printf " %d %s:%s\n", n, b[2], b[3]
+ # end
+ # n += 1
+ # end
+ # end
+ # if break_points.find{|b| b[1] == 1}
+ # n = 1
+ # stdout.print "\n"
+ # stdout.print "Watchpoints:\n"
+ # for b in break_points
+ # if b[0] and b[1] == 1
+ # stdout.printf " %d %s\n", n, b[2]
+ # end
+ # n += 1
+ # end
+ # end
+ # if break_points.size == 0
+ # stdout.print "No breakpoints\n"
+ # else
+ # stdout.print "\n"
+ # end
+
+ # when /^\s*del(?:ete)?(?:\s+(\d+))?$/
+ # pos = $1
+ # unless pos
+ # input = readline("Clear all breakpoints? (y/n) ", false)
+ # if input == "y"
+ # for b in break_points
+ # b[0] = false
+ # end
+ # end
+ # else
+ # pos = pos.to_i
+ # if break_points[pos-1]
+ # break_points[pos-1][0] = false
+ # else
+ # stdout.printf "Breakpoint %d is not defined\n", pos
+ # end
+ # end
+
+ # when /^\s*disp(?:lay)?\s+(.+)$/
+ # exp = $1
+ # display.push [true, exp]
+ # stdout.printf "%d: ", display.size
+ # display_expression(exp, binding)
+ #
+ # when /^\s*disp(?:lay)?$/
+ # display_expressions(binding)
+ #
+ # when /^\s*undisp(?:lay)?(?:\s+(\d+))?$/
+ # pos = $1
+ # unless pos
+ # input = readline("Clear all expressions? (y/n) ", false)
+ # if input == "y"
+ # for d in display
+ # d[0] = false
+ # end
+ # end
+ # else
+ # pos = pos.to_i
+ # if display[pos-1]
+ # display[pos-1][0] = false
+ # else
+ # stdout.printf "Display expression %d is not defined\n", pos
+ # end
+ # end
+
+ when /^\s*c(?:ont)?$/
+ @shouldResume = true
+
+ when /^\s*s(?:tep)?(?:\s+(\d+))?$/
+ if $1
+ lev = $1.to_i
+ else
+ lev = 1
+ end
+ @stop_next = lev
+ @shouldResume = true
+
+ when /^\s*n(?:ext)?(?:\s+(\d+))?$/
+ if $1
+ lev = $1.to_i
+ else
+ lev = 1
+ end
+ @stop_next = lev
+ @no_step = @frames.size - frame_pos
+ @shouldResume = true
+
+ when /^\s*w(?:here)?$/, /^\s*f(?:rame)?$/
+ display_frames(frame_pos)
+
+ # when /^\s*fin(?:ish)?$/
+ # if frame_pos == @frames.size
+ # stdout.print "\"finish\" not meaningful in the outermost frame.\n"
+ # else
+ # @finish_pos = @frames.size - frame_pos
+ # frame_pos = 0
+ # prompt = false
+ # end
+ when /^\s*f(?:rame)?\s+(\d+)\s*$/
+ @printer.debug("Setting frame to #{$1}")
+ @current_frame = $1.to_i
+
+
+ when /^\s*cat(?:ch)?(?:\s+(.+))?$/
+ # $1 can also be nil
+ @catch = $1
+ @catch = nil if @catch == 'off'
+ if @catch then
+ @printer.debug("Catchpoint set to #{@catch}")
+ else
+ @printer.debug("Catchpoints disabled")
+ end
+
+
+ when /^\s*v(?:ar)?\s+/
+ debug_variable_info($', binding)
+
+ when /^\s*m(?:ethod)?\s+/
+ debug_method_info($', binding)
+
+ when /^\s*th(?:read)?\s+/
+ DEBUGGER__.debug_thread_info($', binding)
+
+ when /^\s*p\s+/
+ stdout.printf "%s\n", debug_eval($', binding).inspect
+
+ when /^\s*load\s+/
+ @printer.debug("loading file: %s", $')
+ begin
+ load $'
+ @printer.printLoadResult($')
+ rescue Exception => error
+ @printer.printLoadResult($', error)
+ end
+
+ else
+ @printer.debug("Unknown input : %s", input)
+ end
+
+
+
+ end
+
+
+
+ def display_expressions(binding)
+ n = 1
+ for d in display
+ if d[0]
+ stdout.printf "%d: ", n
+ display_expression(d[1], binding)
+ end
+ n += 1
+ end
+ end
+
+ def display_expression(exp, binding)
+ stdout.printf "%s = %s\n", exp, debug_silent_eval(exp, binding).to_s
+ end
+
+ def frame_set_pos(binding, file, line, id)
+ if @frames[0] then
+ @frames[0][0] = binding
+ @frames[0][1] = file
+ @frames[0][2] = line
+ @frames[0][3] = id
+ else
+ @frames[0] = [binding, file, line, id]
+ end
+ end
+
+ def display_frames(pos)
+ pos += 1
+ n = 0
+ at = @frames
+ @printer.printXml("<frames>")
+ for bind, file, line, id in at
+ n += 1
+ break unless bind
+ @printer.printFrame(pos, n, file, line, id)
+ end
+ @printer.printXml("</frames>")
+ end
+
+ def debug_funcname(id)
+ if id.nil?
+ "toplevel"
+ else
+ id.id2name
+ end
+ end
+
+ def debug_command(file, line, id, binding)
+ @printer.debug("debug_command, @stop_next=%s, @frames.size=%s", @stop_next, @frames.size)
+ if @stop_next == 0 && @frames.size > 0 then
+ # write suspended only if the suspension was originated by stepping and not before the start
+ # of the program
+ @printer.printStepEnd(file, line, @frames.size)
+ end
+ set_last_thread(Thread.current)
+
+ #readUserInput(binding, file, line )
+ #Thread.stop
+ end
+
+ def check_break_points(file, pos, binding, id)
+ return false if break_points.empty?
+ file = File.basename(file)
+ n = 1
+ for b in break_points
+ @printer.debug("file=%s, pos=%s; breakpoint: %s, %s, %s, %s.\n ", file, pos, b[0], b[1], b[2], b[3])
+ if b[0] # valid
+ if b[1] == 0 and b[2] == file and b[3] == pos # breakpoint
+ @printer.printBreakpoint(n, debug_funcname(id), file, pos)
+ return true
+ elsif b[1] == 1 # watchpoint
+ if debug_silent_eval(b[2], binding)
+ stdout.printf "Watchpoint %d, %s at %s:%s\n", n, debug_funcname(id), file, pos
+ return true
+ end
+ end
+ end
+ n += 1
+ end
+ return false
+ end
+
+ def excn_handle(file, line, id, binding)
+
+ if $!.class <= SystemExit
+ @printer.debug( "SystemExit at %s:%d: `%s' (%s)\n", file, line, $!, $!.class )
+ set_trace_func nil
+ exit
+ end
+ if @catch and ($!.class.ancestors.find { |e| e.to_s == @catch })
+ @printer.printException(file, line, $!)
+ fs = @frames.size
+ tb = caller(0)[-fs..-1]
+ stopCurrentThread
+ @frames[0] = [binding, file, line, id]
+ debug_command(file, line, id, binding)
+ end
+
+ end
+
+ def trace_func(event, file, line, id, binding, klass)
+ Tracer.trace_func(event, file, line, id, binding, klass) if trace?
+
+ @file = file
+ @line = line
+ case event
+ when 'line'
+ DEBUGGER__.printer().debug("trace line, file=%s, line=%s, stop_next=%d, binding=%s", file, line, @stop_next, binding)
+ frame_set_pos(binding, file, line, id)
+ if !@no_step or @frames.size == @no_step
+ @stop_next -= 1
+ @stop_next = -1 if @stop_next < 0
+ elsif @frames.size < @no_step
+ @stop_next = 0 # break here before leaving...
+ else
+ # nothing to do. skipped
+ end
+ if @stop_next == 0 or check_break_points(file, line, binding, id)
+ @no_step = nil
+ debug_command(file, line, id, binding)
+ stopCurrentThread
+ end
+
+ when 'call'
+ DEBUGGER__.printer().debug("trace call, file=%s, line=%s, method=%s", file, line, id.id2name)
+ @frames.unshift [binding, file, line, id]
+ if check_break_points(file, id.id2name, binding, id) or
+ check_break_points(klass.to_s, id.id2name, binding, id) then
+ stopCurrentThread
+ debug_command(file, line, id, binding)
+ end
+
+ when 'c-call'
+ if @frames[0] then
+ @frames[0][1] = file
+ @frames[0][2] = line
+ else
+ @frames[0] = [binding, file, line, id]
+ end
+
+ when 'class'
+ @frames.unshift [binding, file, line, id]
+
+ when 'return', 'end'
+ DEBUGGER__.printer().debug("trace return and end, file=%s, line=%s", file, line)
+ if @frames.size == @finish_pos
+ @stop_next = 1
+ @finish_pos = 0
+ end
+ @frames.shift
+
+ when 'end'
+ DEBUGGER__.printer().debug("trace end, file=%s, line=%s", file, line)
+ @frames.shift
+
+ when 'raise'
+ excn_handle(file, line, id, binding)
+
+ end
+ @last_file = file
+ end
+ end
+
+ trap("INT") { DEBUGGER__.interrupt }
+ @last_thread = Thread::main
+ @max_thread = 1
+ @thread_list = {Thread::main => 1}
+ # break_points' one entry: [valid, type, file, pos]
+ # type: 0 - breakpoint, 1 - watchpoint
+ @break_points = []
+ @display = []
+ @waiting = []
+ @stdout = STDOUT
+
+ class << DEBUGGER__
+ def stdout
+ @stdout
+ end
+
+ def stdout=(s)
+ @stdout = s
+ end
+
+ def display
+ @display
+ end
+
+ def break_points
+ @break_points
+ end
+
+ def waiting
+ @waiting
+ end
+
+ def set_trace( arg )
+ Thread.critical = true
+ make_thread_list
+ for th in @thread_list
+ context(th[0]).set_trace arg
+ end
+ Thread.critical = false
+ end
+
+ def set_last_thread(th)
+ @last_thread = th
+ end
+
+ def suspend
+ printer.debug("Suspending all")
+ Thread.critical = true
+ make_thread_list
+ for th in @thread_list
+ next if th[0] == Thread.current
+ context(th[0]).set_suspend
+ end
+ Thread.critical = false
+ # Schedule other threads to suspend as soon as possible.
+ Thread.pass
+ end
+
+ def resume
+ Thread.critical = true
+ make_thread_list
+ for th in @thread_list
+ next if th[0] == Thread.current
+ context(th[0]).clear_suspend
+ end
+ waiting.each do |th|
+ th.run
+ end
+ waiting.clear
+ Thread.critical = false
+ # Schedule other threads to restart as soon as possible.
+ Thread.pass
+ end
+
+ def context(thread=Thread.current)
+ c = thread[:__debugger_data__]
+ unless c
+ thread[:__debugger_data__] = c = Context.new
+ end
+ c
+ end
+
+ def findThread(context)
+ for thread in Thread::list
+ if context == thread[:__debugger_data__]
+ return thread
+ end
+ end
+ end
+
+ def interrupt
+ context(@last_thread).stop_next
+ end
+
+ def get_thread(num)
+ th = @thread_list.index(num)
+ unless th
+ printer.debug("No thread ##{num}\n")
+ end
+ th
+ end
+
+ def get_thread_num(thread=Thread.current)
+ make_thread_list
+ @thread_list[thread]
+ end
+
+ def print_thread(thread)
+ num = @thread_list[thread]
+ printer.printThread(num, thread)
+ end
+
+ def thread_list_all
+ printer.printXml("<threads>")
+ for num in @thread_list.values.sort
+ printer.printThread(num, get_thread(num))
+ end
+ printer.printXml("</threads>")
+ end
+
+ def make_thread_list
+ hash = {}
+ for th in Thread::list
+ next if th == @@inputReader
+ if @thread_list.key? th
+ hash[th] = @thread_list[th]
+ else
+ @max_thread += 1
+ hash[th] = @max_thread
+ end
+ end
+ @thread_list = hash
+ end
+
+ def debug_thread_info(input, binding)
+ case input
+ when /^l(?:ist)?/
+ make_thread_list
+ thread_list_all
+
+ when /^c(?:ur(?:rent)?)?$/
+ make_thread_list
+ print_thread()
+
+ when /^(?:sw(?:itch)?\s+)?(\d+)/
+ make_thread_list
+ th = get_thread($1.to_i)
+ if th == Thread.current
+ @stdout.print "It's the current thread.\n"
+ else
+ print_thread(th)
+ context(th).stop_next
+ th.run
+ return
+ end
+
+ when /^stop\s+(\d+)/
+ make_thread_list
+ th = get_thread($1.to_i)
+ if th == Thread.current
+ @stdout.print "It's the current thread.\n"
+ elsif th.stop?
+ @stdout.print "Already stopped.\n"
+ else
+ print_thread(th)
+ context(th).suspend
+ end
+
+ when /^resume\s+(\d+)/
+ make_thread_list
+ th = get_thread($1.to_i)
+ if th == Thread.current
+ @stdout.print "It's the current thread.\n"
+ elsif !th.stop?
+ @stdout.print "Already running."
+ else
+ print_thread(th)
+ th.run
+ end
+
+ when /^change\s+(\d+)/
+ make_thread_list
+ th = get_thread($1.to_i)
+ print_thread(th)
+ return context(th)
+ end
+ end
+ end
+
+ @@socket = nil
+ @@printer = nil
+ @@inputReader = nil
+ @@isStarted = false
+
+ def DEBUGGER__.printer
+ @@printer
+ end
+
+ def DEBUGGER__.socket
+ @@socket
+ end
+
+ def DEBUGGER__.isStarted
+ @@isStarted
+ end
+
+ def DEBUGGER__.setStarted
+ @@isStarted = true
+ end
+
+
+ def DEBUGGER__.inputReader
+ @@inputReader
+ end
+
+ def DEBUGGER__.traceOn()
+ set_trace_func @@traceProc
+ Thread.critical = false
+ end
+
+ def DEBUGGER__.traceOff()
+ Thread.critical = true
+ set_trace_func nil
+ end
+
+ def DEBUGGER__.readCommandLoop()
+ sleep(1.0) # workaround for large files with ruby 1.6.8, otherwise parse exceptions
+ loop do
+ sleep(0.1)
+ newData, x, y = IO.select( [socket], nil, nil, 0.001 )
+ next unless newData
+ DEBUGGER__.traceOff()
+ input = newData[0].gets.chomp!
+ input.strip!
+ @@printer.debug("READ #{input}")
+ if !DEBUGGER__.isStarted && input == "cont" then
+ DEBUGGER__.setStarted()
+ DEBUGGER__.traceOn()
+ next
+ end
+ input =~ /^th\s+(\d+)\s*;\s*/
+ if $~ then
+ @@printer.debug("Using context for thread: %s", $1.to_i)
+ context = DEBUGGER__.context(get_thread($1.to_i))
+ input = input[$~[0].length..input.length]
+ else
+ @@printer.debug("Using context for main thread : %s", Thread.main)
+ context = DEBUGGER__.context(Thread.main)
+ end
+ context.processInput(input)
+ if context.shouldResume then
+ threadToResume = DEBUGGER__.findThread(context)
+ end
+ DEBUGGER__.traceOn()
+ next unless threadToResume
+ threadToResume.run()
+ end
+ end
+
+ # use 127.0.0.1 instead of localhost because OSX 10.4
+ server = TCPServer.new('127.0.0.1', REMOTE_DEBUG_PORT)
+ puts "ruby #{RUBY_VERSION} debugger listens on port #{REMOTE_DEBUG_PORT}"
+ $stdout.flush
+ STDERR.sync = true
+ @@socket = server.accept
+ @@printer = XmlPrinter.new(@@socket)
+ @@printer.debug("Socket connection established.")
+
+ @@printer.debug("Starting command reader loop.")
+ @@inputReader = Thread.new {
+ begin
+ DEBUGGER__.readCommandLoop()
+ rescue ScriptError, StandardError => error
+ puts error
+ end
+ }
+
+ @@traceProc = proc { |event, file, line, id, binding, klass, *rest|
+
+ #@@printer.debug("trace %s, %s:%s", event, file, line)
+ next if Thread.current == DEBUGGER__.inputReader
+ next if file =~ /classic-debug.rb$/
+ #@@printer.debug("trace %s, %s:%s", event, file, line)
+ while (!DEBUGGER__.isStarted) do
+ @@printer.debug("Debugging not yet started.")
+ sleep(1)
+ end
+ DEBUGGER__.context.trace_func event, file, line, id, binding, klass
+ }
+
+ @@printer.debug("Setting trace func: %s", @@traceProc)
+ set_trace_func @@traceProc
+end
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-20 14:05:45
|
Revision: 1985
http://svn.sourceforge.net/rubyeclipse/?rev=1985&view=rev
Author: cawilliams
Date: 2007-02-20 06:05:42 -0800 (Tue, 20 Feb 2007)
Log Message:
-----------
rename the files (part of Martin's patch)
Removed Paths:
-------------
trunk/org.rubypeople.rdt.launching/ruby/eclipseDebug.rb
trunk/org.rubypeople.rdt.launching/ruby/eclipseDebugVerbose.rb
Deleted: trunk/org.rubypeople.rdt.launching/ruby/eclipseDebug.rb
===================================================================
--- trunk/org.rubypeople.rdt.launching/ruby/eclipseDebug.rb 2007-02-19 21:47:49 UTC (rev 1984)
+++ trunk/org.rubypeople.rdt.launching/ruby/eclipseDebug.rb 2007-02-20 14:05:42 UTC (rev 1985)
@@ -1,1192 +0,0 @@
-# Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
-# Copyright (C) 2000 Information-technology Promotion Agency, Japan
-require 'cgi'
-require 'thread'
-
-# ECLIPSE_LISTEN_PORT is the port on which the debugger waits for commands from
-# eclipse. If you change this, you must also change the corresponding port in
-# org.rubypeople.rdt.internal.debug.core.RubyDebuggerProxy
-ECLIPSE_LISTEN_PORT = (defined? $EclipseListenPort) ? $EclipseListenPort : 1098
-
-# ECLIPSE_VERBOSE prints tihe communication between eclipse and ruby debugger
-# on stderr. If you have started a eclipse debug session (and use default preferences for
-# colors of streams), the communication will be printed in red letters to the eclipse console.
-ECLIPSE_VERBOSE = defined? DebugVerbose
-
-
-class PrinterMultiplexer
- def initialize
- @printers = []
- end
-
- def addPrinter(printer)
- @printers << printer
- end
-
- def method_missing(methodName, *args)
- @printers.each { |printer|
- printer.send(methodName, *args)
- }
- end
-end
-
-
-
-class XmlPrinter
-
- def initialize(socket)
- @socket = socket
- end
-
- def out(*params)
- debugIntern(false, *params)
- if @socket then
- @socket.printf(*params)
- end
- end
-
- def printXml(s, *params)
- out(s, *params)
- end
-
- def printError(s, *params)
- out("<error>" + s + "</error>", *params)
- end
-
- def printVariable(name, binding, kind)
- printVariableValue(name, eval(name, binding), kind)
- end
-
- def printVariableValue(name, value, kind)
- if value == nil then
- out("<variable name=\"%s\" kind=\"%s\"/>", CGI.escapeHTML(name), kind)
- return
- end
- if value.class().name == "Array" or value.class().name == "Hash" then
- hasChildren = value.length > 0
- if value.length == 0 then
- valueString = "Empty " + value.class().name
- else
- valueString = value.class().name + " (" + value.length.to_s + " element(s))"
- end
- else
- hasChildren = value.instance_variables.length > 0 || value.class.class_variables.length > 0
- valueString = value.to_s
- if valueString =~ /^\"/ then
- valueString.slice!(1..(valueString.length)-2)
- end
- end
- out("<variable name=\"%s\" kind=\"%s\" value=\"%s\" type=\"%s\" hasChildren=\"%s\" objectId=\"%#+x\"/>", CGI.escapeHTML(name), kind, CGI.escapeHTML(valueString), value.class(), hasChildren, value.respond_to?(:object_id) ? value.object_id : value.id)
- end
-
- def printBreakpoint(n, debugFuncName, file, pos)
- out("<breakpoint file=\"%s\" line=\"%s\" threadId=\"%s\"/>", file, pos, DEBUGGER__.get_thread_num())
- end
-
- def printException(file, pos, exception)
- out("<exception file=\"%s\" line=\"%s\" type=\"%s\" message=\"%s\" threadId=\"%s\"/>", file, pos, exception.class, CGI.escapeHTML(exception.to_s), DEBUGGER__.get_thread_num())
- end
-
- def printStepEnd(file, line, framesCount)
- out("<suspended file=\"%s\" line=\"%s\" frames=\"%s\" threadId=\"%s\"/>", file, line, framesCount, DEBUGGER__.get_thread_num())
- end
-
- def printFrame(pos, n, file, line, id)
- out("<frame no=\"%s\" file=\"%s\" line=\"%s\"/>", n, file, line)
- end
-
- def printThread(num, thread)
- out("<thread id=\"%s\" status=\"%s\"/>", num, thread.status) ;
- end
-
- def printLoadResult(file, exception=nil)
- if exception then
- out("<loadResult file=\"%s\" exceptionType=\"%s\" exceptionMessage=\"%s\"/>", file, exception.class, CGI.escapeHTML(exception.to_s))
- else
- out("<loadResult file=\"%s\" status=\"OK\"/>", file)
- end
- end
-
- def debug(*params)
- debugIntern(true, *params)
- end
-
- def debugIntern(escape, *params)
- if ECLIPSE_VERBOSE then
- output = sprintf(*params)
- output = CGI.escapeHTML(output) if escape
- STDERR.print(output)
- STDERR.print("\n")
- end
- end
-end
-
-#multiplex = PrinterMultiplexer.new
-#multiplex.addPrinter(XmlPrinter.new(nil))
-#multiplex.addPrinter(XmlPrinter.new(nil))
-#multiplex.printXml("TEST")
-
-
-
-require 'socket'
-require 'tracer'
-
-class Tracer
- def Tracer.trace_func(*vars)
- Single.trace_func(*vars)
- end
-end
-
-
-
-SCRIPT_LINES__ = {} unless defined? SCRIPT_LINES__
-
-class DEBUGGER__
-
- class CommandLinePrinter
- def printXml(s)
- # print XML only
- end
-
- def printVariable(name, binding, kind)
- stdout.printf " %s => %s\n", name, eval(name, binding).inspect
- end
-
- def printBreakpoint(n, debugFuncName, file, pos)
- stdout.printf "Breakpoint %d, %s at %s:%s\n", n, debugFuncName, file, pos
- stdout.flush
- end
-
- def printFrame(pos, n, file, line, id)
- if pos == n
- stdout.printf "--> #%d %s:%s%s\n", n, file, line, id ? ":in `#{id.id2name}'":""
- else
- stdout.printf " #%d %s:%s%s\n", n, file, line, id ? ":in `#{id.id2name}'":""
- end
- end
-
- def printException(file, line, exception)
- stdout.printf "%s:%d: `%s' (%s)\n", file, line, exception, exception.class
- stdout.flush
- end
-
- def printThread(num, thread)
- if thread == Thread.current
- stdout.print "+"
- else
- stdout.print " "
- end
- stdout.printf "%d ", num
- stdout.print thread.inspect, "\t"
- file = DEBUGGER__.context(thread).instance_eval{@file}
- if file
- stdout.print file, ":", DEBUGGER__.context(thread).instance_eval{@line}
- end
- stdout.print "\n"
- end
-
-
- def printStepEnd(file, line, framesCount)
-
- end
-
- def debug(*params)
-
- end
-
- def stdout
- DEBUGGER__.stdout
- end
- end
-
-
-
- class Context
- attr_reader :shouldResume
- def initialize
- @printer = DEBUGGER__.printer
- @socket = DEBUGGER__.socket
- @stop_next = 0
- @last_file = nil
- @file = nil
- @line = nil
- @no_step = nil
- @frames = []
- @current_frame = -1
- @finish_pos = 0
- @trace = false
- @catch = nil # "StandardError"
- @suspend_next = false
- @shouldResume = false
- end
-
- def stop_next(n=1)
- @stop_next = n
- end
-
- def set_suspend
- @suspend_next = true
- end
-
- def clear_suspend
- @suspend_next = false
- end
-
- def stopCurrentThread
- @printer.debug("Suspending : %s", Thread.current)
- Thread.stop()
- @printer.debug("Resumed : %s", Thread.current)
- end
-
- def trace?
- @trace
- end
-
- def set_trace(arg)
- @trace = arg
- end
-
- def stdout
- if @socket then
- @socket
- else
- DEBUGGER__.stdout
- end
- end
-
- def break_points
- DEBUGGER__.break_points
- end
-
- def display
- DEBUGGER__.display
- end
-
- def context(th)
- DEBUGGER__.context(th)
- end
-
- def set_trace_all(arg)
- DEBUGGER__.set_trace(arg)
- end
-
- def set_last_thread(th)
- DEBUGGER__.set_last_thread(th)
- end
-
- def debug_eval_private(str, binding)
- # evaluates str like "var.@instance_var.@instance_var"
- # and "var.privateMethod"
- # return value might be nil
- # the scan must detect array and hash accesses, which might
- # themselves contain point separated expressions, e.g.
- # array[Test.getX].y
- names = str.scan(/[^\[\]]*(?=\.)|.*\[.*\](?=\.)|.*$/)
- # names can contain empty strings
- obj = eval(names[0], binding)
- (1..names.length-1).each { |i|
- if names[i] != "" then
- if names[i].length > 2 && names[i][0..1] == '@@' then
- @printer.debug("Evaluating (class_var): %s on %s", names[i], obj )
- obj = obj.class.class_eval("#{names[i]}")
- else
- @printer.debug("Evaluating (instance_var): %s on %s", names[i], obj )
- obj = obj.instance_eval("#{names[i]}")
- end
- end
- }
- return obj
- end
-
- def debug_eval(str, binding, noPrivateInstanceVars = false)
- begin
- if noPrivateInstanceVars then
- val = eval(str, binding)
- else
- val = debug_eval_private(str, binding)
- end
- val
- rescue ScriptError, StandardError => error
- if error.to_s =~ /private method .* called for/ then
- return debug_eval(str, binding, true)
- end
- @printer.debug("Error in debug_eval (noPrivateInstancsVars=%s): %s", noPrivateInstanceVars, error)
- raise error
- end
- end
-
- def debug_silent_eval(str, binding)
- begin
- val = eval(str, binding)
- val
- rescue StandardError, ScriptError
- nil
- end
- end
-
- def var_list(ary, binding, kind)
- ary.sort!
- @printer.printXml("<variables>")
- for v in ary
- @printer.printVariable(v,binding, kind)
- end
- @printer.printXml("</variables>")
- end
-
- def printArrayElements(array)
- index = 0
- array.each { |e|
- @printer.printVariableValue('[' + index.to_s + ']', e, 'instance')
- index += 1
- }
- end
-
- def printHashElements(hash)
- hash.keys.each { | k |
- if k.class.name == "String"
- name = '\'' + k + '\''
- else
- name = k.to_s
- end
- @printer.printVariableValue(name, hash[k], 'instance')
- }
- end
-
-
- def getConstantsInClass(aClass)
- constants = aClass.constants() - Object.constants
- return constants.delete_if { |c| ! aClass.const_defined? c }
- end
-
-
- def getBinding(pos)
- # returns frame info of frame pos, if pos is within bound, nil otherwise
- pos = @current_frame unless pos
- pos = pos.to_i - 1
- if pos < 0 then
- @printer.debug("ERROR: illegal stack frame, using top frame.")
- pos = 0
- end
- if pos >= @frames.size then
- @printer.debug("ERROR: given stack frame number %i too high.", pos + 1)
- pos = @frames.size - 1
- end
- @printer.debug("Using frame %s (1-based) for evaluation of variable.", pos + 1)
- return @frames[pos][0]
- end
-
-
- def debug_variable_info(input, binding)
-
- case input
- when /^\s*g(?:lobal)?$/
- var_list(global_variables, binding, 'global')
-
- when /^\s*l(?:ocal)?\s*(\d+)?$/
- @printer.debug("Getting binding for frame #{$1}")
- new_binding = getBinding($1)
- if new_binding then
- binding = new_binding
- end
- begin
- #@printer.debug("binding=%s", binding)
- localVars = eval("local_variables", binding)
- # v 1.8.1 dies in eval @printer.debug("HERE")
- if eval('self.to_s', binding) !~ /main/ then
- localVars << "self"
- end
- var_list(localVars, binding, 'local')
- rescue StandardError => bang
- @printer.debug("Exception while evaluating local_variables: %s", bang)
- var_list([], binding, 'local')
- end
-
- when /^\s*i(?:nstance)?\s*(\d+)?\s+((?:[\\+-]0x)[\dabcdef]+)?/
- new_binding = getBinding($1)
- if new_binding then
- binding = new_binding
- end
- begin
- @printer.printXml("<variables>")
- if $2 then
- obj = ObjectSpace._id2ref($2.hex)
- if (!obj) then
- @printer.debug("unknown object id : %s", $2)
- end
- else
- obj = debug_eval($', binding)
- end
- if (obj.class.name == "Array") then
- printArrayElements(obj)
- return
- end
- if (obj.class.name == "Hash") then
- printHashElements(obj)
- return
- end
- @printer.debug("%s", obj)
- instanceBinding = obj.instance_eval{binding()}
- obj.instance_variables.each {
- | instanceVar |
- @printer.printVariable(instanceVar, instanceBinding, 'instance')
- }
- classBinding = obj.class.class_eval('binding()')
- obj.class.class_variables.each {
- | classVar |
- @printer.printVariable(classVar, classBinding, 'class')
- }
- # I'd like to optimize getting the constants, but they are more dynamic
- # than one would expect from true constants.
- getConstantsInClass(obj.class).each {
- | constant |
- @printer.printVariable(constant, classBinding, 'constant')
- }
- rescue StandardError => error
- @printer.debug("%s", error)
- ensure
- @printer.printXml("</variables>")
- end
-
-
- when /^\s*inspect\s*(\d+)?\s+/
- new_binding = getBinding($1)
- if new_binding then
- binding = new_binding
- end
- begin
- obj = debug_eval($', binding, true)
- rescue ScriptError, StandardError => error
- @printer.printXml("<processingException type=\"%s\" message=\"%s\"/>", error.class, error.message)
- return
- end
- @printer.debug("%s", obj)
- @printer.printXml("<variables>")
- @printer.printVariableValue($', obj, "local")
- @printer.printXml("</variables>")
-
-
- end
- end
-
- def debug_method_info(input, binding)
- case input
- when /^i(:?nstance)?\s+/
- obj = debug_eval($', binding); # correct highlighting since RDT editor does not recognize $'
-
- len = 0
- for v in obj.methods.sort
- len += v.size + 1
- if len > 70
- len = v.size + 1
- stdout.print "\n"
- end
- stdout.print v, " "
- end
- stdout.print "\n"
-
- else
- obj = debug_eval(input, binding)
- unless obj.kind_of? Module
- stdout.print "Should be Class/Module: ", input, "\n"
- else
- len = 0
- for v in obj.instance_methods.sort
- len += v.size + 1
- if len > 70
- len = v.size + 1
- stdout.print "\n"
- end
- stdout.print v, " "
- end
- stdout.print "\n"
- end
- end
- end
-
- def thnum(thread=Thread.current)
- num = DEBUGGER__.instance_eval{@thread_list[thread]}
- unless num
- DEBUGGER__.make_thread_list
- num = DEBUGGER__.instance_eval{@thread_list[thread]}
- end
- num
- end
-
- def processInput(input)
- binding, file, line, id = @frames[0]
- input.split(";").each {
- | singleCommand |
- readUserInput(binding, file, line, singleCommand.strip)
- }
- end
-
- def readUserInput(binding, binding_file, binding_line, input)
-
- @printer.debug("Processing #{input}, binding=%s", binding)
- @shouldResume = false
- frame_pos = 0
- previous_line = nil
- display_expressions(binding)
-
-
-
- case input
- when /^\s*tr(?:ace)?(?:\s+(on|off))?(?:\s+(all))?$/
- if defined?( $2 )
- if $1 == 'on'
- set_trace_all true
- else
- set_trace_all false
- end
- elsif defined?( $1 )
- if $1 == 'on'
- set_trace true
- else
- set_trace false
- end
- end
- if trace?
- stdout.print "Trace on.\n"
- else
- stdout.print "Trace off.\n"
- end
-
- when /^\s*b\s+((?:.*?:)?.+)$/
- #@printer.debug("S")
- pos = $1
- if pos.index(":")
- file, pos = pos.split(":")
- end
- file = File.basename(file)
- if pos =~ /^\d+$/
- pname = pos
- pos = pos.to_i
- else
- pname = pos = pos.intern.id2name
- end
- # TODO: pname is not used
- break_points.push [true, 0, file, pos]
- @printer.printXml("<breakpointAdded no=\"%d\" location=\"%s:%s\"/>\n", break_points.size, file, pos)
-
- when /^\s*delete\s+(\d+)$/
- pos = $1.to_i
- if pos < 1 || pos > break_points.length
- @printer.printXml("<error>Breakpoint number out of bounds: %d. There are currently %d breakpoints defined.</error>", pos, break_points.length )
- else
- break_points.delete_at(pos-1)
- @printer.printXml("<breakpointDeleted no=\"%d\"/>\n", pos)
- end
-
- # when /^\s*wat(?:ch)?\s+(.+)$/
- # exp = $1
- # break_points.push [true, 1, exp]
- # stdout.printf "Set watchpoint %d\n", break_points.size, exp
-
- # when /^\s*b(?:reak)?$/
- # if break_points.find{|b| b[1] == 0}
- # n = 1
- # stdout.print "Breakpoints:\n"
- # for b in break_points
- # if b[0] and b[1] == 0
- # stdout.printf " %d %s:%s\n", n, b[2], b[3]
- # end
- # n += 1
- # end
- # end
- # if break_points.find{|b| b[1] == 1}
- # n = 1
- # stdout.print "\n"
- # stdout.print "Watchpoints:\n"
- # for b in break_points
- # if b[0] and b[1] == 1
- # stdout.printf " %d %s\n", n, b[2]
- # end
- # n += 1
- # end
- # end
- # if break_points.size == 0
- # stdout.print "No breakpoints\n"
- # else
- # stdout.print "\n"
- # end
-
- # when /^\s*del(?:ete)?(?:\s+(\d+))?$/
- # pos = $1
- # unless pos
- # input = readline("Clear all breakpoints? (y/n) ", false)
- # if input == "y"
- # for b in break_points
- # b[0] = false
- # end
- # end
- # else
- # pos = pos.to_i
- # if break_points[pos-1]
- # break_points[pos-1][0] = false
- # else
- # stdout.printf "Breakpoint %d is not defined\n", pos
- # end
- # end
-
- # when /^\s*disp(?:lay)?\s+(.+)$/
- # exp = $1
- # display.push [true, exp]
- # stdout.printf "%d: ", display.size
- # display_expression(exp, binding)
- #
- # when /^\s*disp(?:lay)?$/
- # display_expressions(binding)
- #
- # when /^\s*undisp(?:lay)?(?:\s+(\d+))?$/
- # pos = $1
- # unless pos
- # input = readline("Clear all expressions? (y/n) ", false)
- # if input == "y"
- # for d in display
- # d[0] = false
- # end
- # end
- # else
- # pos = pos.to_i
- # if display[pos-1]
- # display[pos-1][0] = false
- # else
- # stdout.printf "Display expression %d is not defined\n", pos
- # end
- # end
-
- when /^\s*c(?:ont)?$/
- @shouldResume = true
-
- when /^\s*s(?:tep)?(?:\s+(\d+))?$/
- if $1
- lev = $1.to_i
- else
- lev = 1
- end
- @stop_next = lev
- @shouldResume = true
-
- when /^\s*n(?:ext)?(?:\s+(\d+))?$/
- if $1
- lev = $1.to_i
- else
- lev = 1
- end
- @stop_next = lev
- @no_step = @frames.size - frame_pos
- @shouldResume = true
-
- when /^\s*w(?:here)?$/, /^\s*f(?:rame)?$/
- display_frames(frame_pos)
-
- # when /^\s*fin(?:ish)?$/
- # if frame_pos == @frames.size
- # stdout.print "\"finish\" not meaningful in the outermost frame.\n"
- # else
- # @finish_pos = @frames.size - frame_pos
- # frame_pos = 0
- # prompt = false
- # end
- when /^\s*f(?:rame)?\s+(\d+)\s*$/
- @printer.debug("Setting frame to #{$1}")
- @current_frame = $1.to_i
-
-
- when /^\s*cat(?:ch)?(?:\s+(.+))?$/
- # $1 can also be nil
- @catch = $1
- @catch = nil if @catch == 'off'
- if @catch then
- @printer.debug("Catchpoint set to #{@catch}")
- else
- @printer.debug("Catchpoints disabled")
- end
-
-
- when /^\s*v(?:ar)?\s+/
- debug_variable_info($', binding)
-
- when /^\s*m(?:ethod)?\s+/
- debug_method_info($', binding)
-
- when /^\s*th(?:read)?\s+/
- DEBUGGER__.debug_thread_info($', binding)
-
- when /^\s*p\s+/
- stdout.printf "%s\n", debug_eval($', binding).inspect
-
- when /^\s*load\s+/
- @printer.debug("loading file: %s", $')
- begin
- load $'
- @printer.printLoadResult($')
- rescue Exception => error
- @printer.printLoadResult($', error)
- end
-
- else
- @printer.debug("Unknown input : %s", input)
- end
-
-
-
- end
-
-
-
- def display_expressions(binding)
- n = 1
- for d in display
- if d[0]
- stdout.printf "%d: ", n
- display_expression(d[1], binding)
- end
- n += 1
- end
- end
-
- def display_expression(exp, binding)
- stdout.printf "%s = %s\n", exp, debug_silent_eval(exp, binding).to_s
- end
-
-
- def display_frames(pos)
- pos += 1
- n = 0
- at = @frames
- @printer.printXml("<frames>")
- for bind, file, line, id in at
- n += 1
- break unless bind
- @printer.printFrame(pos, n, file, line, id)
- end
- @printer.printXml("</frames>")
- end
-
- def debug_funcname(id)
- if id.nil?
- "toplevel"
- else
- id.id2name
- end
- end
-
- def debug_command(file, line, id, binding)
- @printer.debug("debug_command, @stop_next=%s, @frames.size=%s", @stop_next, @frames.size)
- if @stop_next == 0 && @frames.size > 0 then
- # write suspended only if the suspension was originated by stepping and not before the start
- # of the program
- @printer.printStepEnd(file, line, @frames.size)
- end
- set_last_thread(Thread.current)
-
- #readUserInput(binding, file, line )
- #Thread.stop
- end
-
- def check_break_points(file, pos, binding, id)
- return false if break_points.empty?
- file = File.basename(file)
- n = 1
- for b in break_points
- @printer.debug("file=%s, pos=%s; breakpoint: %s, %s, %s, %s.\n ", file, pos, b[0], b[1], b[2], b[3])
- if b[0] # valid
- if b[1] == 0 and b[2] == file and b[3] == pos # breakpoint
- @printer.printBreakpoint(n, debug_funcname(id), file, pos)
- return true
- elsif b[1] == 1 # watchpoint
- if debug_silent_eval(b[2], binding)
- stdout.printf "Watchpoint %d, %s at %s:%s\n", n, debug_funcname(id), file, pos
- return true
- end
- end
- end
- n += 1
- end
- return false
- end
-
- def excn_handle(file, line, id, binding)
-
- if $!.class <= SystemExit
- @printer.debug( "SystemExit at %s:%d: `%s' (%s)\n", file, line, $!, $!.class )
- set_trace_func nil
- exit
- end
- if @catch and ($!.class.ancestors.find { |e| e.to_s == @catch })
- @printer.printException(file, line, $!)
- fs = @frames.size
- tb = caller(0)[-fs..-1]
- stopCurrentThread
- @frames[0] = [binding, file, line, id]
- debug_command(file, line, id, binding)
- end
-
- end
-
- def trace_func(event, file, line, id, binding, klass)
-
- Tracer.trace_func(event, file, line, id, binding, klass) if trace?
-
- @file = file
- @line = line
- case event
- when 'line'
- DEBUGGER__.printer().debug("trace line, file=%s, line=%s, stop_next=%d, binding=%s", file, line, @stop_next, binding)
- if @frames[0] then
- @frames[0][0] = binding
- @frames[0][1] = file
- @frames[0][2] = line
- @frames[0][3] = id
- else
- @frames[0] = [binding, file, line, id]
- end
- if !@no_step or @frames.size == @no_step
- @stop_next -= 1
- @stop_next = -1 if @stop_next < 0
- elsif @frames.size < @no_step
- @stop_next = 0 # break here before leaving...
- else
- # nothing to do. skipped
- end
-
- if @stop_next == 0 or check_break_points(file, line, binding, id)
- @no_step = nil
- debug_command(file, line, id, binding)
- stopCurrentThread
- end
-
- when 'call'
- DEBUGGER__.printer().debug("trace call, file=%s, line=%s, method=%s", file, line, id.id2name)
- @frames.unshift [binding, file, line, id]
- if check_break_points(file, id.id2name, binding, id) or
- check_break_points(klass.to_s, id.id2name, binding, id) then
- stopCurrentThread
- debug_command(file, line, id, binding)
- end
-
- when 'c-call'
- if @frames[0] then
- @frames[0][1] = file
- @frames[0][2] = line
- else
- @frames[0] = [binding, file, line, id]
- end
-
- when 'class'
- @frames.unshift [binding, file, line, id]
-
- when 'return', 'end'
- DEBUGGER__.printer().debug("trace return and end, file=%s, line=%s", file, line)
- if @frames.size == @finish_pos
- @stop_next = 1
- @finish_pos = 0
- end
- @frames.shift
-
- when 'end'
- DEBUGGER__.printer().debug("trace end, file=%s, line=%s", file, line)
- @frames.shift
-
- when 'raise'
- excn_handle(file, line, id, binding)
-
- end
- @last_file = file
- end
- end
-
- trap("INT") { DEBUGGER__.interrupt }
- @last_thread = Thread::main
- @max_thread = 1
- @thread_list = {Thread::main => 1}
- # break_points' one entry: [valid, type, file, pos]
- # type: 0 - breakpoint, 1 - watchpoint
- @break_points = []
- @display = []
- @waiting = []
- @stdout = STDOUT
-
- class << DEBUGGER__
- def stdout
- @stdout
- end
-
- def stdout=(s)
- @stdout = s
- end
-
- def display
- @display
- end
-
- def break_points
- @break_points
- end
-
- def waiting
- @waiting
- end
-
- def set_trace( arg )
- Thread.critical = true
- make_thread_list
- for th in @thread_list
- context(th[0]).set_trace arg
- end
- Thread.critical = false
- end
-
- def set_last_thread(th)
- @last_thread = th
- end
-
- def suspend
- printer.debug("Suspending all")
- Thread.critical = true
- make_thread_list
- for th in @thread_list
- next if th[0] == Thread.current
- context(th[0]).set_suspend
- end
- Thread.critical = false
- # Schedule other threads to suspend as soon as possible.
- Thread.pass
- end
-
- def resume
- Thread.critical = true
- make_thread_list
- for th in @thread_list
- next if th[0] == Thread.current
- context(th[0]).clear_suspend
- end
- waiting.each do |th|
- th.run
- end
- waiting.clear
- Thread.critical = false
- # Schedule other threads to restart as soon as possible.
- Thread.pass
- end
-
- def context(thread=Thread.current)
- c = thread[:__debugger_data__]
- unless c
- thread[:__debugger_data__] = c = Context.new
- end
- c
- end
-
- def findThread(context)
- for thread in Thread::list
- if context == thread[:__debugger_data__]
- return thread
- end
- end
- end
-
- def interrupt
- context(@last_thread).stop_next
- end
-
- def get_thread(num)
- th = @thread_list.index(num)
- unless th
- printer.debug("No thread ##{num}\n")
- end
- th
- end
-
- def get_thread_num(thread=Thread.current)
- make_thread_list
- @thread_list[thread]
- end
-
- def print_thread(thread)
- num = @thread_list[thread]
- printer.printThread(num, thread)
- end
-
- def thread_list_all
- printer.printXml("<threads>")
- for num in @thread_list.values.sort
- printer.printThread(num, get_thread(num))
- end
- printer.printXml("</threads>")
- end
-
- def make_thread_list
- hash = {}
- for th in Thread::list
- next if th == @@inputReader
- if @thread_list.key? th
- hash[th] = @thread_list[th]
- else
- @max_thread += 1
- hash[th] = @max_thread
- end
- end
- @thread_list = hash
- end
-
- def debug_thread_info(input, binding)
- case input
- when /^l(?:ist)?/
- make_thread_list
- thread_list_all
-
- when /^c(?:ur(?:rent)?)?$/
- make_thread_list
- print_thread()
-
- when /^(?:sw(?:itch)?\s+)?(\d+)/
- make_thread_list
- th = get_thread($1.to_i)
- if th == Thread.current
- @stdout.print "It's the current thread.\n"
- else
- print_thread(th)
- context(th).stop_next
- th.run
- return
- end
-
- when /^stop\s+(\d+)/
- make_thread_list
- th = get_thread($1.to_i)
- if th == Thread.current
- @stdout.print "It's the current thread.\n"
- elsif th.stop?
- @stdout.print "Already stopped.\n"
- else
- print_thread(th)
- context(th).suspend
- end
-
- when /^resume\s+(\d+)/
- make_thread_list
- th = get_thread($1.to_i)
- if th == Thread.current
- @stdout.print "It's the current thread.\n"
- elsif !th.stop?
- @stdout.print "Already running."
- else
- print_thread(th)
- th.run
- end
-
- when /^change\s+(\d+)/
- make_thread_list
- th = get_thread($1.to_i)
- print_thread(th)
- return context(th)
- end
- end
- end
-
- @@socket = nil
- @@printer = nil
- @@inputReader = nil
- @@isStarted = false
-
- def DEBUGGER__.printer
- @@printer
- end
-
- def DEBUGGER__.socket
- @@socket
- end
-
- def DEBUGGER__.isStarted
- @@isStarted
- end
-
- def DEBUGGER__.setStarted
- @@isStarted = true
- end
-
-
- def DEBUGGER__.inputReader
- @@inputReader
- end
-
- def DEBUGGER__.traceOn()
- set_trace_func @@traceProc
- Thread.critical = false ;
- end
-
- def DEBUGGER__.traceOff()
- Thread.critical = true ;
- set_trace_func nil
- end
-
- def DEBUGGER__.readCommandLoop()
- sleep(1.0) # workaround for large files with ruby 1.6.8, otherwise parse exceptions
- loop do
- sleep(0.1)
- newData, x, y = IO.select( [socket], nil, nil, 0.001 )
- next unless newData
- DEBUGGER__.traceOff()
- input = newData[0].gets.chomp!
- input.strip!
- @@printer.debug("READ #{input}")
- if !DEBUGGER__.isStarted && input == "cont" then
- DEBUGGER__.setStarted()
- DEBUGGER__.traceOn()
- next
- end
- input =~ /^th\s+(\d+)\s*;\s*/
- if $~ then
- @@printer.debug("Using context for thread: %s", $1.to_i)
- context = DEBUGGER__.context(get_thread($1.to_i))
- input = input[$~[0].length..input.length]
- else
- @@printer.debug("Using context for main thread : %s", Thread.main)
- context = DEBUGGER__.context(Thread.main)
- end
- context.processInput(input)
- if context.shouldResume then
- threadToResume = DEBUGGER__.findThread(context)
- end
- DEBUGGER__.traceOn()
- next unless threadToResume
- threadToResume.run()
- end
- end
-
- # use 127.0.0.1 instead of localhost because OSX 10.4
- server = TCPServer.new('127.0.0.1', ECLIPSE_LISTEN_PORT)
- puts "ruby #{RUBY_VERSION} debugger listens on port #{ECLIPSE_LISTEN_PORT}"
- $stdout.flush
- STDERR.sync = true ;
- @@socket = server.accept
- @@printer = XmlPrinter.new(@@socket)
- @@printer.debug("Socket connection established.")
-
- @@printer.debug("Starting command reader loop.")
- @@inputReader = Thread.new {
- begin
- DEBUGGER__.readCommandLoop()
- rescue ScriptError, StandardError => error
- puts error
- end
- }
-
- @@traceProc = proc { |event, file, line, id, binding, klass, *rest|
-
- #@@printer.debug("trace %s, %s:%s", event, file, line)
- next if Thread.current == DEBUGGER__.inputReader
- next if file =~ /eclipseDebug.rb$/
- #@@printer.debug("trace %s, %s:%s", event, file, line)
- while (!DEBUGGER__.isStarted) do
- @@printer.debug("Debugging not yet started.")
- sleep(1)
- end
- DEBUGGER__.context.trace_func event, file, line, id, binding, klass
- }
-
- @@printer.debug("Setting trace func: %s", @@traceProc)
- set_trace_func @@traceProc
-end
Deleted: trunk/org.rubypeople.rdt.launching/ruby/eclipseDebugVerbose.rb
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-19 21:47:56
|
Revision: 1984
http://svn.sourceforge.net/rubyeclipse/?rev=1984&view=rev
Author: cawilliams
Date: 2007-02-19 13:47:49 -0800 (Mon, 19 Feb 2007)
Log Message:
-----------
pare down the code some...
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RubyCodeTextHover.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RubyCodeTextHover.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RubyCodeTextHover.java 2007-02-19 21:47:30 UTC (rev 1983)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RubyCodeTextHover.java 2007-02-19 21:47:49 UTC (rev 1984)
@@ -8,98 +8,75 @@
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.ITextViewer;
import org.rubypeople.rdt.internal.ui.RubyPlugin;
import org.rubypeople.rdt.ui.extensions.ITextHoverProvider;
-
/**
- * Generic TextHover that uses installed extensions for getting information; when the TextHover is requested
- * then all installed TextHoverProvider extensions will be asked to provide a String to show for the location.
+ * Generic TextHover that uses installed extensions for getting information;
+ * when the TextHover is requested then all installed TextHoverProvider
+ * extensions will be asked to provide a String to show for the location.
*
* @author murphee
- *
+ *
*/
public class RubyCodeTextHover extends AbstractRubyEditorTextHover {
-
public static final String RDT_UI_NAMESPACE = "org.rubypeople.rdt.ui";
public static final String RDT_UI_TEXTHOVERPROVIDER = "textHoverProvider";
-
+
private List fExtensions;
public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
List extensions = initExtensions();
- try {
- final String symbol = textViewer.getDocument().get(hoverRegion.getOffset(), hoverRegion.getLength());
- // first ask the extensions
- if(extensions.size() > 0){
- for(int i=0; i< extensions.size(); i++){
- ITextHoverProvider currentProvider = (ITextHoverProvider) extensions.get(i);
- String hoverText = currentProvider.getHoverInfo(getEditor().getEditorInput(), textViewer, hoverRegion);
- if(hoverText != null){
- return hoverText;
- }
- }
-
- }
-
- } catch (BadLocationException e1) {
- RubyPlugin.log(e1);
+ if (extensions.isEmpty())
+ return null;
+ for (int i = 0; i < extensions.size(); i++) {
+ ITextHoverProvider currentProvider = (ITextHoverProvider) extensions.get(i);
+ String hoverText = currentProvider.getHoverInfo(getEditor().getEditorInput(), textViewer, hoverRegion);
+ if (hoverText != null) {
+ return hoverText;
+ }
}
return null;
}
private List initExtensions() {
- if(fExtensions == null){
+ if (fExtensions == null) {
fExtensions = new ArrayList();
- IExtensionRegistry reg = Platform.getExtensionRegistry();
-
- IExtensionPoint[] points = reg.getExtensionPoints(RDT_UI_NAMESPACE);
- // TODO: Look for textProvider!
- IExtensionPoint point = null;
-
- if(points != null){
- for (int i = 0; i < points.length; i++) {
- IExtensionPoint currentPoint = points[i];
- if(currentPoint.getUniqueIdentifier().endsWith(RDT_UI_TEXTHOVERPROVIDER)){
- point = currentPoint;
- break;
- }
- }
-
- if(point != null){
- IExtension[] exts = points[0].getExtensions();
-
- ITextHoverProvider 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 ITextHoverProvider) {
- prov = (ITextHoverProvider) tempProv;
- fExtensions.add(prov);
- }
-// Object tempExtension = elem[0].getAttribute("fileExtension");
-// if (tempExtension instanceof String) {
-// String extension = (String) tempExtension;
-// fileExtensionToProvider.put(extension.trim(), prov);
-// }
- } catch (Exception e) {
- RubyPlugin.log(e);
- }
-
+ IExtensionPoint point = getTextHoverExtensionPoint();
+ if (point == null)
+ return fExtensions;
+ 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 ITextHoverProvider) {
+ ITextHoverProvider prov = (ITextHoverProvider) tempProv;
+ fExtensions.add(prov);
}
+ } catch (Exception e) {
+ RubyPlugin.log(e);
}
}
-
}
return fExtensions;
-
}
+ private IExtensionPoint getTextHoverExtensionPoint() {
+ IExtensionRegistry reg = Platform.getExtensionRegistry();
+ IExtensionPoint[] points = reg.getExtensionPoints(RDT_UI_NAMESPACE);
+ if (points == null)
+ return null;
+ for (int i = 0; i < points.length; i++) {
+ IExtensionPoint currentPoint = points[i];
+ if (currentPoint.getUniqueIdentifier().endsWith(RDT_UI_TEXTHOVERPROVIDER)) {
+ return currentPoint;
+ }
+ }
+ return null;
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-19 21:47:35
|
Revision: 1983
http://svn.sourceforge.net/rubyeclipse/?rev=1983&view=rev
Author: cawilliams
Date: 2007-02-19 13:47:30 -0800 (Mon, 19 Feb 2007)
Log Message:
-----------
return null if ri isn't set up, so other providers get a shot at fulfilling the hover text!
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RiDocHoverProvider.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RiDocHoverProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RiDocHoverProvider.java 2007-02-19 21:46:51 UTC (rev 1982)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RiDocHoverProvider.java 2007-02-19 21:47:30 UTC (rev 1983)
@@ -22,7 +22,7 @@
public String getHoverInfo(IEditorInput input, ITextViewer textViewer, IRegion hoverRegion){
IPath riPath = new Path( RubyPlugin.getDefault().getPreferenceStore().getString( PreferenceConstants.RI_PATH ) );
File ri = riPath.toFile();
- if (!ri.exists() || !ri.isFile()) return "RI executable doesn't exist at given path";
+ if (!ri.exists() || !ri.isFile()) return null;
List<String> args = new ArrayList<String>();
args.add(0, riPath.toString());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-19 21:46:55
|
Revision: 1982
http://svn.sourceforge.net/rubyeclipse/?rev=1982&view=rev
Author: cawilliams
Date: 2007-02-19 13:46:51 -0800 (Mon, 19 Feb 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RuntimeLoadpathEntry.java
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RuntimeLoadpathEntry.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RuntimeLoadpathEntry.java 2007-02-19 21:46:26 UTC (rev 1981)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RuntimeLoadpathEntry.java 2007-02-19 21:46:51 UTC (rev 1982)
@@ -33,7 +33,6 @@
import org.rubypeople.rdt.core.IRubyProject;
import org.rubypeople.rdt.core.LoadpathContainerInitializer;
import org.rubypeople.rdt.core.RubyCore;
-import org.rubypeople.rdt.core.RubyModelException;
import org.rubypeople.rdt.launching.IRubyLaunchConfigurationConstants;
import org.rubypeople.rdt.launching.IRuntimeLoadpathEntry;
import org.rubypeople.rdt.launching.RubyRuntime;
@@ -41,11 +40,11 @@
import org.w3c.dom.Element;
/**
- * An entry on the runtime classpath that the user can manipulate
+ * An entry on the runtime loadpath that the user can manipulate
* and share in a launch configuration.
*
- * @see org.eclipse.jdt.launching.IRuntimeLoadpathEntry
- * @since 2.0
+ * @see org.rubypeople.rdt.launching.IRuntimeLoadpathEntry
+ * @since 0.9.0
*/
public class RuntimeLoadpathEntry implements IRuntimeLoadpathEntry {
@@ -55,7 +54,7 @@
private int fType = -1;
/**
- * This entry's classpath property.
+ * This entry's loadpath property.
*/
private int fLoadpathProperty = -1;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-19 21:46:28
|
Revision: 1981
http://svn.sourceforge.net/rubyeclipse/?rev=1981&view=rev
Author: cawilliams
Date: 2007-02-19 13:46:26 -0800 (Mon, 19 Feb 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SetLoadpathOperation.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SetLoadpathOperation.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SetLoadpathOperation.java 2007-02-19 21:46:16 UTC (rev 1980)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SetLoadpathOperation.java 2007-02-19 21:46:26 UTC (rev 1981)
@@ -47,7 +47,7 @@
ILoadpathEntry[] oldResolvedPath, newResolvedPath;
ILoadpathEntry[] newRawPath;
boolean canChangeResources;
- boolean classpathWasSaved;
+ boolean loadpathWasSaved;
boolean needCycleCheck;
boolean needValidation;
boolean needSave;
@@ -237,12 +237,12 @@
// project reference updated - may throw an exception if unable to write .project file
updateProjectReferencesIfNecessary();
- // classpath file updated - may throw an exception if unable to write .classpath file
+ // loadpath file updated - may throw an exception if unable to write .loadpath file
saveLoadpathIfNecessary();
- // perform classpath and output location updates, if exception occurs in classpath update,
+ // perform classpath and output location updates, if exception occurs in loadpath update,
// make sure the output location is updated before surfacing the exception (in case the output
- // location update also throws an exception, give priority to the classpath update one).
+ // location update also throws an exception, give priority to the loadpath update one).
RubyModelException originalException = null;
try {
@@ -291,7 +291,7 @@
boolean needToUpdateDependents = false;
RubyElementDelta delta = new RubyElementDelta(getRubyModel());
boolean hasDelta = false;
- if (this.classpathWasSaved) {
+ if (this.loadpathWasSaved) {
delta.changed(this.project, IRubyElementDelta.F_CLASSPATH_CHANGED);
hasDelta = true;
}
@@ -514,15 +514,15 @@
if (!this.canChangeResources || !this.needSave) return;
- ILoadpathEntry[] classpathForSave;
+ ILoadpathEntry[] loadpathForSave;
if (this.newRawPath == DO_NOT_SET_ENTRIES || this.newRawPath == DO_NOT_UPDATE_PROJECT_REFS){
- classpathForSave = project.getRawLoadpath();
+ loadpathForSave = project.getRawLoadpath();
} else {
- classpathForSave = this.newRawPath;
+ loadpathForSave = this.newRawPath;
}
- // if read-only .classpath, then the classpath setting will never been performed completely
- if (project.saveLoadpath(classpathForSave, null)) {
- this.classpathWasSaved = true;
+ // if read-only .loadpath, then the loadpath setting will never been performed completely
+ if (project.saveLoadpath(loadpathForSave, null)) {
+ this.loadpathWasSaved = true;
this.setAttribute(HAS_MODIFIED_RESOURCE_ATTR, TRUE);
}
}
@@ -554,7 +554,7 @@
beginTask(Messages.bind(Messages.classpath_settingProgress, project.getElementName()), 2);
- // SIDE-EFFECT: from thereon, the classpath got modified
+ // SIDE-EFFECT: from thereon, the loadpath got modified
project.getPerProjectInfo().updateLoadpathInformation(this.newRawPath);
// resolve new path (asking for marker creation if problems)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-19 21:46:18
|
Revision: 1980
http://svn.sourceforge.net/rubyeclipse/?rev=1980&view=rev
Author: cawilliams
Date: 2007-02-19 13:46:16 -0800 (Mon, 19 Feb 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java 2007-02-19 21:46:05 UTC (rev 1979)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java 2007-02-19 21:46:16 UTC (rev 1980)
@@ -949,7 +949,7 @@
}
if (logProblems) {
Util.log(e, "Exception while retrieving " + this.getPath() //$NON-NLS-1$
- + "/.classpath, will revert to default classpath"); //$NON-NLS-1$
+ + "/.loadpath, will revert to default loadpath"); //$NON-NLS-1$
}
}
return null;
@@ -1991,7 +1991,7 @@
}
}
- public boolean saveLoadpath(ILoadpathEntry[] newClasspath, IPath newOutputLocation) throws RubyModelException {
+ public boolean saveLoadpath(ILoadpathEntry[] newLoadpath, IPath newOutputLocation) throws RubyModelException {
if (!this.project.isAccessible())
return false;
@@ -2004,14 +2004,14 @@
* log
* problems
*/, unknownElements);
- if (fileEntries != null && isLoadpathEqualsTo(newClasspath, newOutputLocation, fileEntries)) {
+ if (fileEntries != null && isLoadpathEqualsTo(newLoadpath, newOutputLocation, fileEntries)) {
// no need to save it, it is the same
return false;
}
// actual file saving
try {
- setSharedProperty(LOADPATH_FILENAME, encodeLoadpath(newClasspath, newOutputLocation, true, unknownElements));
+ setSharedProperty(LOADPATH_FILENAME, encodeLoadpath(newLoadpath, newOutputLocation, true, unknownElements));
return true;
} catch (CoreException e) {
throw new RubyModelException(e);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-19 21:46:07
|
Revision: 1979
http://svn.sourceforge.net/rubyeclipse/?rev=1979&view=rev
Author: cawilliams
Date: 2007-02-19 13:46:05 -0800 (Mon, 19 Feb 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/Openable.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelManager.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/Openable.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/Openable.java 2007-02-19 21:45:51 UTC (rev 1978)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/Openable.java 2007-02-19 21:46:05 UTC (rev 1979)
@@ -228,7 +228,7 @@
if (!parentExists()) return false;
SourceFolderRoot root = getSourceFolderRoot();
if (root != null
- && (root == this || !root.isArchive())) {
+ && (root == this || !root.isExternal())) {
return resourceExists();
}
return super.exists();
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelManager.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelManager.java 2007-02-19 21:45:51 UTC (rev 1978)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelManager.java 2007-02-19 21:46:05 UTC (rev 1979)
@@ -611,11 +611,11 @@
this.project = project;
}
- // updating raw classpath need to flush obsoleted cached information
+ // updating raw loadpath need to flush obsoleted cached information
// about resolved entries
- public synchronized void updateLoadpathInformation(ILoadpathEntry[] newRawClasspath) {
+ public synchronized void updateLoadpathInformation(ILoadpathEntry[] newRawLoadpath) {
- this.rawLoadpath = newRawClasspath;
+ this.rawLoadpath = newRawLoadpath;
this.resolvedLoadpath = null;
this.resolvedPathToRawEntries = null;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-19 21:45:54
|
Revision: 1978
http://svn.sourceforge.net/rubyeclipse/?rev=1978&view=rev
Author: cawilliams
Date: 2007-02-19 13:45:51 -0800 (Mon, 19 Feb 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/LoadpathContainerInitializer.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/LoadpathContainerInitializer.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/LoadpathContainerInitializer.java 2007-02-19 21:45:47 UTC (rev 1977)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/LoadpathContainerInitializer.java 2007-02-19 21:45:51 UTC (rev 1978)
@@ -37,17 +37,17 @@
* In case multiple container initializers collide on the same container ID, the first
* registered one will be invoked.
*
- * @see IClasspathEntry
- * @see IClasspathContainer
- * @since 2.0
+ * @see ILoadpathEntry
+ * @see ILoadpathContainer
+ * @since 0.9.0
*/
public abstract class LoadpathContainerInitializer {
/**
- * Creates a new classpath container initializer.
+ * Creates a new loadpath container initializer.
*/
public LoadpathContainerInitializer() {
- // a classpath container initializer must have a public 0-argument constructor
+ // a loadpath container initializer must have a public 0-argument constructor
}
/**
@@ -119,9 +119,9 @@
* @return returns <code>true</code> if the container can be updated
* @since 2.1
*/
- public boolean canUpdateClasspathContainer(IPath containerPath, IRubyProject project) {
+ public boolean canUpdateLoadpathContainer(IPath containerPath, IRubyProject project) {
- // By default, classpath container initializers do not accept updating containers
+ // By default, loadpath container initializers do not accept updating containers
return false;
}
@@ -144,12 +144,12 @@
* @param containerSuggestion a suggestion to update the corresponding container definition
* @throws CoreException when <code>JavaCore#setClasspathContainer</code> would throw any.
* @see JavaCore#setClasspathContainer(IPath, IJavaProject[], IClasspathContainer[], org.eclipse.core.runtime.IProgressMonitor)
- * @see ClasspathContainerInitializer#canUpdateClasspathContainer(IPath, IJavaProject)
- * @since 2.1
+ * @see ClasspathContainerInitializer#canUpdateLoadpathContainer(IPath, IJavaProject)
+ * @since 0.9.0
*/
- public void requestClasspathContainerUpdate(IPath containerPath, IRubyProject project, ILoadpathContainer containerSuggestion) throws CoreException {
+ public void requestLoadpathContainerUpdate(IPath containerPath, IRubyProject project, ILoadpathContainer containerSuggestion) throws CoreException {
- // By default, classpath container initializers do not accept updating containers
+ // By default, loadpath container initializers do not accept updating containers
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-19 21:45:49
|
Revision: 1977
http://svn.sourceforge.net/rubyeclipse/?rev=1977&view=rev
Author: cawilliams
Date: 2007-02-19 13:45:47 -0800 (Mon, 19 Feb 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/SelectionEngine.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/SelectionEngine.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/SelectionEngine.java 2007-02-19 20:53:20 UTC (rev 1976)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/SelectionEngine.java 2007-02-19 21:45:47 UTC (rev 1977)
@@ -81,6 +81,7 @@
ITypeInferrer inferrer = new DefaultTypeInferrer();
List<ITypeGuess> guesses = inferrer.infer(source, start);
RubyElementRequestor requestor = new RubyElementRequestor(script);
+ String methodName = getName(selected);
for (ITypeGuess guess : guesses) {
String name = guess.getType();
IType[] types = requestor.findType(name);
@@ -88,8 +89,9 @@
IType type = types[i];
IMethod[] methods = type.getMethods();
for (int j = 0; i < methods.length; j++) {
- if (methods[j].getElementName().equals(getName(selected))) {
+ if (methods[j].getElementName().equals(methodName)) {
possible.add(methods[j]);
+ break;
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-19 20:53:22
|
Revision: 1976
http://svn.sourceforge.net/rubyeclipse/?rev=1976&view=rev
Author: cawilliams
Date: 2007-02-19 12:53:20 -0800 (Mon, 19 Feb 2007)
Log Message:
-----------
try to avoid null pointer exceptions
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/util/NodeLocator.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/util/NodeLocator.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/util/NodeLocator.java 2007-02-19 20:44:51 UTC (rev 1975)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/util/NodeLocator.java 2007-02-19 20:53:20 UTC (rev 1976)
@@ -22,6 +22,8 @@
* @return Wthether the node spans the specified offset.
*/
protected boolean nodeDoesSpanOffset(Node node, int offset) {
+ if (node == null) return false;
+ if (node.getPosition() == null) return false;
return (node.getPosition().getStartOffset() <= offset)
&& (node.getPosition().getEndOffset() >= offset);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-19 20:44:52
|
Revision: 1975
http://svn.sourceforge.net/rubyeclipse/?rev=1975&view=rev
Author: cawilliams
Date: 2007-02-19 12:44:51 -0800 (Mon, 19 Feb 2007)
Log Message:
-----------
fix task amrker so it will show up, remove unused coe, add code to infer a CallNode's receiver if there's no guesses.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/DefaultTypeInferrer.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/DefaultTypeInferrer.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/DefaultTypeInferrer.java 2007-02-19 20:44:10 UTC (rev 1974)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/DefaultTypeInferrer.java 2007-02-19 20:44:51 UTC (rev 1975)
@@ -43,10 +43,6 @@
if (node == null) {
return null;
}
-
- // System.out.println("offset: " + offset + ": " +
- // node.getClass().getName());
-
return infer(node);
}
@@ -62,7 +58,7 @@
tryConstantNode(node, guesses);
tryAsgnNode(node, guesses);
- // todo: refactor these 3 by common features into 1 (or 1+3) method(s)
+ // TODO refactor these 3 by common features into 1 (or 1+3) method(s)
tryLocalVarNode(node, guesses);
tryInstVarNode(node, guesses);
tryGlobalVarNode(node, guesses);
@@ -71,6 +67,12 @@
if (node instanceof ConstNode) { // if this is a constant, it may be the type name!
guesses.add(new BasicTypeGuess(((ConstNode)node).getName(), 100));
}
+ if (guesses.isEmpty()) { // if we have no guesses..
+ if (node instanceof CallNode) { // and it's a method call, try inferring receiver type
+ CallNode call = (CallNode) node;
+ return infer(call.getReceiverNode());
+ }
+ }
return guesses;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-19 20:44:11
|
Revision: 1974
http://svn.sourceforge.net/rubyeclipse/?rev=1974&view=rev
Author: cawilliams
Date: 2007-02-19 12:44:10 -0800 (Mon, 19 Feb 2007)
Log Message:
-----------
handle method calls better
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/SelectionEngine.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/SelectionEngine.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/SelectionEngine.java 2007-02-19 20:44:02 UTC (rev 1973)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/SelectionEngine.java 2007-02-19 20:44:10 UTC (rev 1974)
@@ -6,6 +6,7 @@
import org.eclipse.core.resources.IFile;
import org.jruby.ast.ArgumentNode;
+import org.jruby.ast.CallNode;
import org.jruby.ast.ClassVarAsgnNode;
import org.jruby.ast.ClassVarDeclNode;
import org.jruby.ast.ClassVarNode;
@@ -18,13 +19,16 @@
import org.jruby.ast.Node;
import org.jruby.ast.VCallNode;
import org.jruby.ast.types.INameNode;
+import org.rubypeople.rdt.core.IMethod;
import org.rubypeople.rdt.core.IParent;
import org.rubypeople.rdt.core.IRubyElement;
-import org.rubypeople.rdt.core.IRubyProject;
import org.rubypeople.rdt.core.IRubyScript;
import org.rubypeople.rdt.core.IType;
import org.rubypeople.rdt.core.RubyModelException;
import org.rubypeople.rdt.internal.core.parser.RubyParser;
+import org.rubypeople.rdt.internal.ti.DefaultTypeInferrer;
+import org.rubypeople.rdt.internal.ti.ITypeGuess;
+import org.rubypeople.rdt.internal.ti.ITypeInferrer;
import org.rubypeople.rdt.internal.ti.util.OffsetNodeLocator;
public class SelectionEngine {
@@ -73,8 +77,23 @@
return convertToArray(possible);
}
if (isMethodCall(selected)) {
- List<IRubyElement> possible = getChildrenWithName(script
- .getChildren(), IRubyElement.METHOD, getName(selected));
+ List<IRubyElement> possible = new ArrayList<IRubyElement>();
+ ITypeInferrer inferrer = new DefaultTypeInferrer();
+ List<ITypeGuess> guesses = inferrer.infer(source, start);
+ RubyElementRequestor requestor = new RubyElementRequestor(script);
+ for (ITypeGuess guess : guesses) {
+ String name = guess.getType();
+ IType[] types = requestor.findType(name);
+ for (int i = 0; i < types.length; i++) {
+ IType type = types[i];
+ IMethod[] methods = type.getMethods();
+ for (int j = 0; i < methods.length; j++) {
+ if (methods[j].getElementName().equals(getName(selected))) {
+ possible.add(methods[j]);
+ }
+ }
+ }
+ }
return convertToArray(possible);
}
return new IRubyElement[0];
@@ -101,7 +120,7 @@
}
private boolean isMethodCall(Node selected) {
- return (selected instanceof VCallNode) || (selected instanceof FCallNode);
+ return (selected instanceof VCallNode) || (selected instanceof FCallNode) || (selected instanceof CallNode);
}
private IRubyElement[] convertToArray(List<IRubyElement> possible) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-19 20:44:04
|
Revision: 1973
http://svn.sourceforge.net/rubyeclipse/?rev=1973&view=rev
Author: cawilliams
Date: 2007-02-19 12:44:02 -0800 (Mon, 19 Feb 2007)
Log Message:
-----------
remove unused method
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-19 17:35:12 UTC (rev 1972)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/RubyElementRequestor.java 2007-02-19 20:44:02 UTC (rev 1973)
@@ -1,7 +1,6 @@
package org.rubypeople.rdt.internal.codeassist;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.List;
import java.util.StringTokenizer;
@@ -55,11 +54,6 @@
return matches;
}
- private List<IType> getTypesInSourceFolderRoot(ISourceFolderRoot root, String typeName) {
- List<IType> types = getTypes(root);
- return filterToMatches(typeName, types);
- }
-
private List<IType> getImportedTypesInSourceFolderRoot(ISourceFolderRoot root, String typeName) {
List<IType> types = new ArrayList<IType>();
try {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|