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-03-26 13:21:49
|
Revision: 2225
http://svn.sourceforge.net/rubyeclipse/?rev=2225&view=rev
Author: cawilliams
Date: 2007-03-26 06:18:35 -0700 (Mon, 26 Mar 2007)
Log Message:
-----------
do a little tweaking so we still suggest locals ( ihad turned that off for a while). Also add a hack so we save the last good AST for a RubyScript, and use that when we get elements in the local document
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScript.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-03-26 13:08:53 UTC (rev 2224)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-03-26 13:18:35 UTC (rev 2225)
@@ -42,6 +42,7 @@
import org.rubypeople.rdt.core.RubyCore;
import org.rubypeople.rdt.core.RubyModelException;
import org.rubypeople.rdt.internal.core.RubyElement;
+import org.rubypeople.rdt.internal.core.RubyScript;
import org.rubypeople.rdt.internal.core.RubyType;
import org.rubypeople.rdt.internal.core.parser.RubyParser;
import org.rubypeople.rdt.internal.core.search.ExperimentalIndex;
@@ -95,10 +96,9 @@
// FIXME If we're invoked on the class declaration (it's super class) don't do this!
// FIXME Traverse the IRubyElement model, not nodes (and don't reparse)?
if (fContext.isMethodInvokationOrLocal()) {
- suggestMethodsForEnclosingType(script);
+ suggestMethodsForEnclosingType(script);
}
- // FIXME What about instance and class variables?
-// getDocumentsRubyElementsInScope();
+ getDocumentsRubyElementsInScope();
}
if (fContext.isGlobal()) { // looks like a global
suggestGlobals();
@@ -284,7 +284,7 @@
// FIXME Try to stop all the multiple re-parsing of the source! Can
// we parse once and pass the root node around?
// Parse
- Node rootNode = (new RubyParser()).parse(fContext.getCorrectedSource());
+ Node rootNode = ((RubyScript) fContext.getScript()).lastGoodAST;
if (rootNode == null) {
return;
}
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScript.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScript.java 2007-03-26 13:08:53 UTC (rev 2224)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScript.java 2007-03-26 13:18:35 UTC (rev 2225)
@@ -74,7 +74,8 @@
public WorkingCopyOwner owner;
protected String name;
-
+ public Node lastGoodAST;
+
/**
* @param name
*/
@@ -133,6 +134,7 @@
try {
RubyParser parser = new RubyParser();
ast = parser.parse((IFile) getResource(), new CharArrayReader(contents));
+ lastGoodAST = ast;
RubyScriptStructureBuilder visitor = new RubyScriptStructureBuilder(this, unitInfo, newElements);
if (ast != null) ast.accept(visitor);
unitInfo.setIsStructureKnown(true);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-03-26 01:47:19
|
Revision: 2221
http://svn.sourceforge.net/rubyeclipse/?rev=2221&view=rev
Author: cawilliams
Date: 2007-03-25 18:47:16 -0700 (Sun, 25 Mar 2007)
Log Message:
-----------
add new extension point which allows other plugins to contribute categroies and error/warnings to be shown in the Error/Warning preference page.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/plugin.xml
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.properties
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/ProblemSeveritiesConfigurationBlock.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.core/schema/errorProvider.exsd
Modified: trunk/org.rubypeople.rdt.core/plugin.xml
===================================================================
--- trunk/org.rubypeople.rdt.core/plugin.xml 2007-03-26 01:38:59 UTC (rev 2220)
+++ trunk/org.rubypeople.rdt.core/plugin.xml 2007-03-26 01:47:16 UTC (rev 2221)
@@ -4,6 +4,7 @@
<extension-point id="loadpathVariableInitializer" name="%loadpathVariableInitializersName" schema="schema/loadpathVariableInitializer.exsd"/>
<extension-point id="loadpathContainerInitializer" name="%loadpathContainerInitializersName" schema="schema/loadpathContainerInitializer.exsd"/>
<extension-point id="compilationParticipant" name="%compilationParticipantsName" schema="schema/compilationParticipant.exsd"/>
+ <extension-point id="errorProvider" name="%errorProvidersName" schema="schema/errorProvider.exsd"/>
<extension
id="rubynature"
@@ -111,4 +112,12 @@
<initializer class="org.rubypeople.rdt.internal.core.RubyCorePreferenceInitializer"/>
</extension>
+
+ <extension
+ point="org.rubypeople.rdt.core.errorProvider">
+ <category id="org.rubypeople.rdt.errors.codeComplexity" name="Code Complexity" />
+ <category id="org.rubypeople.rdt.errors.potentialProblems" name="Potential programming problems" />
+ <category id="org.rubypeople.rdt.errors.unneccesaryCode" name="Unnecessary code" />
+ </extension>
+
</plugin>
Added: trunk/org.rubypeople.rdt.core/schema/errorProvider.exsd
===================================================================
--- trunk/org.rubypeople.rdt.core/schema/errorProvider.exsd (rev 0)
+++ trunk/org.rubypeople.rdt.core/schema/errorProvider.exsd 2007-03-26 01:47:16 UTC (rev 2221)
@@ -0,0 +1,183 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.rubypeople.rdt.core">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.rubypeople.rdt.core" id="errorProvider" name="%errorProviderName"/>
+ </appInfo>
+ <documentation>
+ This extension point allows plugins to participate in surfacing their error/warning markers through the preference page. Use this point to add new categories (or groups) of errors/warnings, and to add hooks to set teh severity and argumnets for your new/custom error/warning markers. This point is likely to be used in conjucntion with the compilationParticipants (which would do the actual parsing/AST analysis).
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence minOccurs="0" maxOccurs="unbounded">
+ <choice>
+ <element ref="category"/>
+ <element ref="error"/>
+ </choice>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="category">
+ <annotation>
+ <documentation>
+ Categories group togetehr a set of Errors/Warnings in the preference page.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ A unique identifier for this category. Errors references this with their categoryId to be placed within this category.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+ The text used in the preference page to group the errors.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="error">
+ <annotation>
+ <documentation>
+ An error is a type of Error/Warning that can be configured by the user.
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="0" maxOccurs="1">
+ <element ref="argument"/>
+ </sequence>
+ <attribute name="prefKey" type="string" use="required">
+ <annotation>
+ <documentation>
+ the preference key used to store the severity of the error/warning (which will be RubyCore.IGNORE, RubyCore.WARNING, or RubyCore.ERROR).
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="label" type="string" use="required">
+ <annotation>
+ <documentation>
+ The text used on the preference page to describe the error/warning.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="categoryId" type="string" use="required">
+ <annotation>
+ <documentation>
+ the id of the category under which this error/warning resides.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="argument">
+ <annotation>
+ <documentation>
+ If this preference has a particular value or argument associated with it, this element is used.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="prefKey" type="string" use="required">
+ <annotation>
+ <documentation>
+ The preference key to store the value.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="type" use="default" value="int">
+ <annotation>
+ <documentation>
+ The type of value. Defaults to int.
+ </documentation>
+ </annotation>
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="int">
+ </enumeration>
+ <enumeration value="string">
+ </enumeration>
+ </restriction>
+ </simpleType>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ 0.9.0
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ (C) 2007 Big Day Coming
+ </documentation>
+ </annotation>
+
+</schema>
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.java 2007-03-26 01:38:59 UTC (rev 2220)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.java 2007-03-26 01:47:16 UTC (rev 2221)
@@ -165,6 +165,9 @@
public static String NewJavaProjectPreferencePage_error_decode;
public static String NewJavaProjectPreferencePage_jre_variable_description;
public static String NewJavaProjectPreferencePage_jre_container_description;
+
+ public static String RubyBuildConfigurationBlock_empty_input;
+ public static String RubyBuildConfigurationBlock_invalid_input;
static {
NLS.initializeMessages(BUNDLE_NAME, PreferencesMessages.class);
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.properties
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.properties 2007-03-26 01:38:59 UTC (rev 2220)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.properties 2007-03-26 01:47:16 UTC (rev 2221)
@@ -184,4 +184,7 @@
ProjectSelectionDialog_filter=&Filter projects with no project specific settings
FoldingConfigurationBlock_enable= Enable f&olding
-FoldingConfigurationBlock_combo_caption= Select folding to &use:
\ No newline at end of file
+FoldingConfigurationBlock_combo_caption= Select folding to &use:
+
+RubyBuildConfigurationBlock_empty_input=Number cannot be empty.
+RubyBuildConfigurationBlock_invalid_input={0} is not a valid number for ''{1}''.
\ No newline at end of file
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/ProblemSeveritiesConfigurationBlock.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/ProblemSeveritiesConfigurationBlock.java 2007-03-26 01:38:59 UTC (rev 2220)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/ProblemSeveritiesConfigurationBlock.java 2007-03-26 01:47:16 UTC (rev 2221)
@@ -10,7 +10,17 @@
*******************************************************************************/
package org.rubypeople.rdt.internal.ui.preferences;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
@@ -18,11 +28,14 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.forms.widgets.ExpandableComposite;
import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
import org.rubypeople.rdt.core.RubyCore;
+import org.rubypeople.rdt.internal.corext.util.Messages;
import org.rubypeople.rdt.internal.ui.RubyPlugin;
import org.rubypeople.rdt.internal.ui.dialogs.StatusInfo;
+import org.rubypeople.rdt.internal.ui.dialogs.StatusUtil;
import org.rubypeople.rdt.internal.ui.util.PixelConverter;
import org.rubypeople.rdt.internal.ui.wizards.IStatusChangeListener;
@@ -30,19 +43,8 @@
*/
public class ProblemSeveritiesConfigurationBlock extends OptionsConfigurationBlock {
- private static final String SETTINGS_SECTION_NAME= null; //"ProblemSeveritiesConfigurationBlock";
+ private static final String SETTINGS_SECTION_NAME= null; //"ProblemSeveritiesConfigurationBlock";
- // Preference store keys, see RubyCore.getOptions
- // TODO Actually implement checking for these things in the builders!
- private static final Key PREF_PB_ENSURE_BLOCK_NOT_COMPLETING = getRDTCoreKey(RubyCore.COMPILER_PB_ENSURE_BLOCK_NOT_COMPLETING);
- private static final Key PREF_PB_EMPTY_STATEMENT = getRDTCoreKey(RubyCore.COMPILER_PB_EMPTY_STATEMENT);
- private static final Key PREF_PB_HIDDEN_RESCUE_BLOCK = getRDTCoreKey(RubyCore.COMPILER_PB_HIDDEN_RESCUE_BLOCK);
- private static final Key PREF_PB_FALLTHROUGH_CASE = getRDTCoreKey(RubyCore.COMPILER_PB_FALLTHROUGH_CASE);
- private static final Key PREF_PB_NULL_REFERENCE = getRDTCoreKey(RubyCore.COMPILER_PB_NULL_REFERENCE);
- private static final Key PREF_PB_UNUSED_LOCAL = getRDTCoreKey(RubyCore.COMPILER_PB_UNUSED_LOCAL);
- private static final Key PREF_PB_UNUSED_PARAMETER = getRDTCoreKey(RubyCore.COMPILER_PB_UNUSED_PARAMETER);
- private static final Key PREF_PB_UNUSED_PRIVATE = getRDTCoreKey(RubyCore.COMPILER_PB_UNUSED_PRIVATE_MEMBER);
- private static final Key PREF_PB_UNNECESSARY_ELSE = getRDTCoreKey(RubyCore.COMPILER_PB_UNNECESSARY_ELSE);
// values
private static final String ERROR= RubyCore.ERROR;
private static final String WARNING= RubyCore.WARNING;
@@ -51,22 +53,98 @@
private static final String ENABLED= RubyCore.ENABLED;
private static final String DISABLED= RubyCore.DISABLED;
+ private static Key[] fgKeys;
+ private static Map<String, String> fgCategories;
+ private static HashMap<String, List<Error>> fgErrors;
-
private PixelConverter fPixelConverter;
+ private IStatus fStatus;
public ProblemSeveritiesConfigurationBlock(IStatusChangeListener context, IProject project, IWorkbenchPreferenceContainer container) {
super(context, project, getKeys(), container);
+ fStatus= new StatusInfo();
}
+ private static List<IConfigurationElement> getErrorProviderElements() {
+ List<IConfigurationElement> elements = new ArrayList<IConfigurationElement>();
+ IExtensionPoint extension = Platform.getExtensionRegistry().getExtensionPoint(RubyCore.PLUGIN_ID, "errorProvider");
+ if (extension == null)
+ return elements;
+ IExtension[] extensions = extension.getExtensions();
+ for(int i = 0; i < extensions.length; i++) {
+ IConfigurationElement[] configElements = extensions[i].getConfigurationElements();
+ for (int j = 0; j < configElements.length; j++) elements.add(configElements[j]);
+ }
+ return elements;
+ }
+
+ private static Map<String, String> getErrorCategories() {
+ if (fgCategories != null) return fgCategories;
+ Map<String, String> categories = new HashMap<String, String>();
+ List<IConfigurationElement> configElements = getErrorProviderElements();
+ for (IConfigurationElement configElement : configElements) {
+ String name = configElement.getName();
+ String contributorName = configElement.getContributor().getName();
+ if (name.equals("category")) { // Grab the categories
+ categories.put(configElement.getAttribute("id"), configElement.getAttribute("name"));
+ }
+ }
+ fgCategories = categories;
+ return fgCategories;
+ }
+
+ private static class Error {
+ private String id;
+ private String label;
+ private String contributor;
+ private String argument;
+ private String type;
+
+ Error(IConfigurationElement element) {
+ this.id = element.getAttribute("prefKey");
+ this.label = element.getAttribute("label");
+ this.contributor = element.getContributor().getName();
+ IConfigurationElement[] elements = element.getChildren("argument");
+ if (elements != null && elements.length > 0) {
+ this.argument = elements[0].getAttribute("prefKey");
+ this.type = elements[0].getAttribute("type");
+ if (type == null) {
+ type = "int";
+ }
+ }
+ }
+ public boolean hasArgument() {
+ return argument != null;
+ }
+ public String getContributor() {
+ return contributor;
+ }
+ public String getId() {
+ return id;
+ }
+ public String getLabel() {
+ return label;
+ }
+ public String getArgument() {
+ return argument;
+ }
+ public boolean argumentIsInt() {
+ return hasArgument() && type.equals("int");
+ }
+ }
+
private static Key[] getKeys() {
- return new Key[] {
-// PREF_PB_ENSURE_BLOCK_NOT_COMPLETING,
- PREF_PB_EMPTY_STATEMENT,
-// PREF_PB_HIDDEN_RESCUE_BLOCK,
-// PREF_PB_FALLTHROUGH_CASE, PREF_PB_NULL_REFERENCE, PREF_PB_UNUSED_LOCAL,
-// PREF_PB_UNUSED_PARAMETER, PREF_PB_UNUSED_PRIVATE, PREF_PB_UNNECESSARY_ELSE
- };
+ if (fgKeys != null) return fgKeys;
+ List<Key> keys = new ArrayList<Key>();
+ Map<String, String> categories = getErrorCategories();
+ for (String categoryId : categories.keySet()) {
+ List<Error> errors = getErrors(categoryId);
+ for (Error error : errors) {
+ keys.add(getKey(error.getContributor(), error.getId()));
+ }
+ }
+ fgKeys = keys.toArray(new Key[keys.size()]);
+ return fgKeys;
}
/*
@@ -127,59 +205,50 @@
ExpandableComposite excomposite;
Composite inner;
- // --- potential_programming_problems
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_section_potential_programming_problems;
- excomposite= createStyleSection(composite, label, nColumns);
-
- inner= new Composite(excomposite, SWT.NONE);
- inner.setFont(composite.getFont());
- inner.setLayout(new GridLayout(nColumns, false));
- excomposite.setClient(inner);
+ Map<String, String> categories = getErrorCategories();
+ for (String categoryId : categories.keySet()) {
+ excomposite= createStyleSection(composite, categories.get(categoryId), nColumns);
+ inner= new Composite(excomposite, SWT.NONE);
+ inner.setFont(composite.getFont());
+ inner.setLayout(new GridLayout(nColumns, false));
+ excomposite.setClient(inner);
+
+ List<Error> errors = getErrors(categoryId);
+ for (Error error : errors) {
+ addComboBox(inner, error.label + ':', getKey(error.getContributor(), error.getId()), errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
+ if (error.hasArgument()) {
+ Text text= addTextField(inner, "", getKey(error.getContributor(), error.getArgument()), 0, 0);
+ GridData gd= (GridData) text.getLayoutData();
+ gd.widthHint= fPixelConverter.convertWidthInCharsToPixels(8);
+ gd.horizontalAlignment= GridData.END;
+ text.setTextLimit(6);
+ }
+ }
+ }
-// label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_ensure_block_not_completing_label;
-// addComboBox(inner, label, PREF_PB_ENSURE_BLOCK_NOT_COMPLETING, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_empty_statement_label;
- addComboBox(inner, label, PREF_PB_EMPTY_STATEMENT, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
-// label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_hidden_rescueblock_label;
-// addComboBox(inner, label, PREF_PB_HIDDEN_RESCUE_BLOCK, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-//
-// label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_fall_through_case;
-// addComboBox(inner, label, PREF_PB_FALLTHROUGH_CASE, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-//
-// label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_null_reference;
-// addComboBox(inner, label, PREF_PB_NULL_REFERENCE, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
- // --- unnecessary_code
-
-// label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_section_unnecessary_code;
-// excomposite= createStyleSection(composite, label, nColumns);
-//
-// inner= new Composite(excomposite, SWT.NONE);
-// inner.setFont(composite.getFont());
-// inner.setLayout(new GridLayout(nColumns, false));
-// excomposite.setClient(inner);
-
-// label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_unused_local_label;
-// addComboBox(inner, label, PREF_PB_UNUSED_LOCAL, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-//
-// label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_unused_parameter_label;
-// addComboBox(inner, label, PREF_PB_UNUSED_PARAMETER, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-//
-// label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_unused_private_label;
-// addComboBox(inner, label, PREF_PB_UNUSED_PRIVATE, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-//
-// label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_unnecessary_else_label;
-// addComboBox(inner, label, PREF_PB_UNNECESSARY_ELSE, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
IDialogSettings section= RubyPlugin.getDefault().getDialogSettings().getSection(SETTINGS_SECTION_NAME);
restoreSectionExpansionStates(section);
return sc1;
}
+ private static List<Error> getErrors(String categoryId) {
+ if (fgErrors == null) {
+ fgErrors = new HashMap<String, List<Error>>();
+ }
+ if (fgErrors.get(categoryId) != null) return fgErrors.get(categoryId);
+ List<Error> categories = new ArrayList<Error>();
+ List<IConfigurationElement> configElements = getErrorProviderElements();
+ for (IConfigurationElement configElement : configElements) {
+ String name = configElement.getName();
+ if (name.equals("error") && configElement.getAttribute("categoryId").equals(categoryId)) { // Grab the errors for this category
+ categories.add(new Error(configElement));
+ }
+ }
+ fgErrors.put(categoryId, categories);
+ return categories;
+ }
+
/* (non-javadoc)
* Update fields and validate.
* @param changedKey Key that changed, or null, if all changed.
@@ -187,18 +256,53 @@
protected void validateSettings(Key changedKey, String oldValue, String newValue) {
if (!areSettingsEnabled()) {
return;
- }
-
+ }
if (changedKey != null) {
- return;
+ List<Error> errors = getErrors();
+ for (Error error : errors) {
+ if (error.hasArgument() && error.argumentIsInt() && changedKey.getName().equals(error.getArgument())) {
+ fStatus = validateMaxNumber(changedKey, error.getLabel());
+ fContext.statusChanged(fStatus);
+ return;
+ }
+ }
} else {
updateEnableStates();
}
- fContext.statusChanged(new StatusInfo());
+ IStatus status= StatusUtil.getMostSevere(new IStatus[] { fStatus });
+ fContext.statusChanged(status);
}
+ private static List<Error> getErrors() {
+ List<Error> errors = new ArrayList<Error>();
+ Map<String, String> categories = getErrorCategories();
+ for (String categoryId : categories.keySet()) {
+ errors.addAll(getErrors(categoryId));
+ }
+ return errors;
+ }
+
+ private IStatus validateMaxNumber(Key key, String label) {
+ String number= getValue(key);
+ StatusInfo status= new StatusInfo();
+ if (number.length() == 0) {
+ status.setError(PreferencesMessages.RubyBuildConfigurationBlock_empty_input);
+ } else {
+ try {
+ int value= Integer.parseInt(number);
+ if (value <= 0) {
+ status.setError(Messages.format(PreferencesMessages.RubyBuildConfigurationBlock_invalid_input, new Object[] {number, label}));
+ }
+ } catch (NumberFormatException e) {
+ status.setError(Messages.format(PreferencesMessages.RubyBuildConfigurationBlock_invalid_input, new Object[] {number, label}));
+ }
+ }
+ return status;
+ }
+
private void updateEnableStates() {
// TODO Handle enabling/disabling checkboxes as prefs change
+ // FIXME Iterate through errors which have "arguments", if error is set to ignore, disable value textbox!
}
protected String[] getFullBuildDialogStrings(boolean workspaceSettings) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-03-26 01:39:11
|
Revision: 2220
http://svn.sourceforge.net/rubyeclipse/?rev=2220&view=rev
Author: cawilliams
Date: 2007-03-25 18:38:59 -0700 (Sun, 25 Mar 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/MarkerUtility.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/MarkerUtility.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/MarkerUtility.java 2007-03-23 19:25:07 UTC (rev 2219)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/MarkerUtility.java 2007-03-26 01:38:59 UTC (rev 2220)
@@ -62,9 +62,9 @@
* @param resource
* @param problems
*/
- public static void createProblemMarkers(IResource resource, List problems) {
+ public static void createProblemMarkers(IResource resource, List<IProblem> problems) {
for (Iterator iter = problems.iterator(); iter.hasNext();) {
- createProblemMarker(resource, (DefaultProblem) iter.next());
+ createProblemMarker(resource, (IProblem) iter.next());
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-03-23 19:25:09
|
Revision: 2219
http://svn.sourceforge.net/rubyeclipse/?rev=2219&view=rev
Author: cawilliams
Date: 2007-03-23 12:25:07 -0700 (Fri, 23 Mar 2007)
Log Message:
-----------
use ProcessBuilder to create the external processes to RI, this allows us to force STDERR to redirect into input stream of process.
So we shouldn't be able to hang on reading input in case of errors (and we flow the error/stack trace on over to the view).
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java 2007-03-23 19:10:48 UTC (rev 2218)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java 2007-03-23 19:25:07 UTC (rev 2219)
@@ -3,7 +3,6 @@
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
-import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collection;
@@ -263,8 +262,10 @@
try {
List<String> args = getArgList();
args.add(0, riPath.toString());
- String[] argArray= (String[]) args.toArray(new String[args.size()]);
- Process p= Runtime.getRuntime().exec(argArray);
+ ProcessBuilder builder = new ProcessBuilder();
+ builder.command(args);
+ builder.redirectErrorStream(true);
+ Process p = builder.start();
handleOutput(p);
} catch (IOException e) {
// message of RuntimeException will be displayed in the RI View
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-03-23 19:10:54
|
Revision: 2218
http://svn.sourceforge.net/rubyeclipse/?rev=2218&view=rev
Author: cawilliams
Date: 2007-03-23 12:10:48 -0700 (Fri, 23 Mar 2007)
Log Message:
-----------
overhaul to the RI view: use Eclipse Job mechanism to launch long-running updates to RI view, get rid of some stuff (no need to hook into interpreter stuff), clean everything up a little.
There's still work to be done in terms of the case where querying for a class or method's description may hang us - we get an error or something and we block on reading from STDIN. that needs to be fixed badly!
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java 2007-03-23 17:24:35 UTC (rev 2217)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java 2007-03-23 19:10:48 UTC (rev 2218)
@@ -7,11 +7,14 @@
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Iterator;
import java.util.List;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IToolBarManager;
@@ -43,10 +46,6 @@
import org.rubypeople.rdt.internal.ui.RubyPluginImages;
import org.rubypeople.rdt.internal.ui.rdocexport.RDocUtility;
import org.rubypeople.rdt.internal.ui.rdocexport.RdocListener;
-import org.rubypeople.rdt.launching.IVMInstall;
-import org.rubypeople.rdt.launching.IVMInstallChangedListener;
-import org.rubypeople.rdt.launching.PropertyChangeEvent;
-import org.rubypeople.rdt.launching.RubyRuntime;
import org.rubypeople.rdt.ui.PreferenceConstants;
public class RIView extends ViewPart implements RdocListener {
@@ -54,15 +53,13 @@
private boolean riFound = false;
private PageBook pageBook;
private SashForm form;
- private Label interpreterNeededLabel, riNotFoundLabel;
+ private Label riNotFoundLabel;
private Text searchStr;
private TableViewer searchListViewer;
private Browser searchResult;
- private List possibleMatches = new ArrayList();
- private SearchValue itemToSearch = new SearchValue();
- private DescriptionUpdater descriptionUpdater = new DescriptionUpdater();
- private IVMInstallChangedListener runtimeListener;
+ private static List<String> fgPossibleMatches = new ArrayList<String>();
private ListContentProvider contentProvider = new ListContentProvider();
+ private RubyInvokerJob latestJob;
/**
* The constructor.
@@ -74,18 +71,17 @@
* it.
*/
public void createPartControl(Composite parent) {
+ contributeToActionBars();
- contributeToActionBars() ;
-
pageBook = new PageBook(parent, SWT.NONE);
-
- interpreterNeededLabel = new Label(pageBook, SWT.NONE);
- interpreterNeededLabel.setText(InfoViewMessages.getString("RubyInformation.interpreter_not_selected"));
-
+
riNotFoundLabel = new Label( pageBook, SWT.LEFT | SWT.TOP | SWT.WRAP );
riNotFoundLabel.setText( InfoViewMessages.getString( "RubyInformation.ri_not_found") );
+ Label inProgressLabel = new Label( pageBook, SWT.LEFT | SWT.TOP | SWT.WRAP );
+ inProgressLabel.setText("Please wait. Updating RI View...");
+
form = new SashForm(pageBook, SWT.HORIZONTAL);
Composite panel = new Composite(form, SWT.NONE);
@@ -135,23 +131,6 @@
searchResult = new Browser(form, SWT.BORDER);
form.setWeights(new int[]{1, 3});
-
- runtimeListener = new IVMInstallChangedListener() {
- public void defaultVMInstallChanged(IVMInstall previous,
- IVMInstall current) {
- updatePage();
- }
-
- public void vmAdded(IVMInstall newVm) {
- }
-
- public void vmChanged(PropertyChangeEvent event) {
- }
-
- public void vmRemoved(IVMInstall removedVm) {
- }
- };
- RubyRuntime.addVMInstallChangedListener(runtimeListener);
RubyPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(new IPropertyChangeListener() {
public void propertyChange(org.eclipse.jface.util.PropertyChangeEvent event) {
@@ -161,9 +140,8 @@
}
});
-
+ pageBook.showPage(inProgressLabel);
updatePage();
- descriptionUpdater.start();
RDocUtility.addRdocListener(this);
}
@@ -182,95 +160,61 @@
}
private void updatePage() {
- IVMInstall interpreter = RubyRuntime.getDefaultVMInstall();
- if (interpreter != null) {
- initSearchList();
- if( riFound ){
- pageBook.showPage(form);
- }
- }
- else {
- pageBook.showPage(interpreterNeededLabel);
- }
+ initSearchList();
+ if( riFound ){
+ pageBook.showPage(form);
+ }
}
private void showSelectedItem() {
String searchText = (String)((IStructuredSelection)searchListViewer.getSelection()).getFirstElement();
- synchronized(itemToSearch) { itemToSearch.set(searchText); }
+ if (latestJob != null && latestJob.getState() != Job.NONE) {
+ latestJob.cancel();
+ }
+ latestJob = new RubyInvokerJob(new RIDescriptionUpdater(searchText));
+ latestJob.setPriority(Job.INTERACTIVE);
+ latestJob.schedule();
}
public void dispose() {
- descriptionUpdater.requestStop();
- RubyRuntime.removeVMInstallChangedListener(runtimeListener);
RDocUtility.removeRdocListener(this);
super.dispose();
}
- private class SearchValue {
- String value = null;
-
- void set(String value) {
- this.value = value;
- notifyAll();
- }
-
- boolean isSet() {
- return value != null;
- }
-
- String get() {
- String result = value;
- value = null;
- return result;
- }
- }
-
- private void initSearchList() {
- RubyInvoker invoker = new RubyInvoker() {
- protected void handleOutput(Process process) {
- if (process == null) return;
- riFound = false;
- BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
- String line = null;
- int numberOfMatches = 0;
- possibleMatches = new ArrayList() ;
- try {
- while ((line = reader.readLine()) != null) {
- possibleMatches.add(line.trim());
- numberOfMatches++;
- }
- // if not matches were found display an error message
- if( numberOfMatches == 0 ){
- riFound = false;
- pageBook.showPage( riNotFoundLabel );
- } else {
- riFound = true;
- }
- }
- catch (IOException e) {
- RubyPlugin.log(e);
- }
- }
+ private synchronized void initSearchList() {
+ RubyInvoker invoker = new RIPopulator(this);
+ Job job = new RubyInvokerJob(invoker);
+ job.setPriority(Job.LONG);
+ job.schedule();
+ }
+
+ private static class RubyInvokerJob extends Job {
+ private RubyInvoker invoker;
- protected List getArgList() {
- List args = new ArrayList();
- args.add("--no-pager");
- args.add("-l");
- return args;
- }
- };
- invoker.invoke();
- filterSearchList();
- }
+ public RubyInvokerJob(RubyInvoker invoker) {
+ super("Updating RI View"); // $NON-NLS-1$
+ this.invoker = invoker;
+ }
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ invoker.invoke();
+ return Status.OK_STATUS;
+ }
+ }
+
+
private void filterSearchList() {
- List filteredList = new ArrayList();
+ List<String> filteredList = new ArrayList<String>();
String text = searchStr.getText();
- for (Iterator iter = possibleMatches.iterator(); iter.hasNext();) {
- String possibleMatch = (String) iter.next();
- if (possibleMatch.toLowerCase().indexOf(text.toLowerCase()) > -1 ) {
- filteredList.add(possibleMatch);
- }
+ if (text != null && text.trim().length() > 0) {
+ for (String string : fgPossibleMatches) {
+ if (string.toLowerCase().indexOf(text.toLowerCase()) > -1 ) {
+ filteredList.add(string);
+ }
+ }
+ } else {
+ filteredList = fgPossibleMatches;
}
searchListViewer.setInput(filteredList);
if (filteredList.size() > 0) searchListViewer.getTable().setSelection(0);
@@ -296,69 +240,7 @@
}
}
- private final class DescriptionUpdater extends Thread {
- private String searchValue;
- private volatile boolean stopped = false;
-
- public DescriptionUpdater() {
- super("RI Description Updater");
- }
-
- private RubyInvoker invoker = new RubyInvoker() {
- protected List getArgList() {
- ArrayList args = new ArrayList();
- args.add("--no-pager");
- args.add("-f");
- args.add("html");
- args.add(searchValue);
- return args;
- }
-
- protected void beforeInvoke() {
- searchResult.setText(InfoViewMessages.getString("RubyInformation.please_wait"));
- }
-
- protected void handleOutput(final Process process) {
- if (process == null) return;
- // any output?
- final StreamRedirector outputRedirect = new StreamRedirector(process.getInputStream(), "");
- // kick them off
- outputRedirect.start();
- final int rc;
- try {
- rc = process.waitFor();
- if (rc != 0) {
- outputRedirect.inQueue("<p>No matching results.</p>");
- }
- outputRedirect.done();
- }
- catch (InterruptedException IGNORE) {
- }
- }
- };
-
- public void requestStop() {
- stopped = true;
- interrupt();
- }
-
- public void run() {
- while (!stopped) {
- synchronized (itemToSearch) {
- try {
- while (!itemToSearch.isSet() && !stopped) { itemToSearch.wait(); }
- searchValue = itemToSearch.get();
- }
- catch (InterruptedException IGNORE) {
- }
- }
- if (stopped) return;
- invoker.invoke();
- }
- }
- }
-
- private abstract class RubyInvoker {
+ abstract class RubyInvoker {
protected abstract List<String> getArgList();
protected abstract void handleOutput(Process process);
protected void beforeInvoke(){}
@@ -390,32 +272,30 @@
}
}
}
-
- class StreamRedirector extends Thread {
- // TODO Add ability to style by CSS stylesheet!
- // FIXME Use the HTMLPrinter from rdt.internal.ui.text!
- InputStream is;
- String linePrefix;
- String line = null;
- boolean done = false;
- final java.util.List queue = new ArrayList();
- private StringBuffer buffer = new StringBuffer();
+
+ private class RIDescriptionUpdater extends RubyInvoker {
+ private String searchValue;
private final String HEADER = "<html><head></head><body>";
private final String TAIL = "</body></html>";
+ private StringBuffer buffer;
+
+ RIDescriptionUpdater(String value) {
+ this.searchValue = value;
+ }
+
+ protected List<String> getArgList() {
+ List<String> args = new ArrayList<String>();
+ args.add("--no-pager");
+ args.add("-f");
+ args.add("html");
+ args.add(searchValue);
+ return args;
+ }
- StreamRedirector(final InputStream is, final String type) {
- this.is = is;
- this.linePrefix = type;
- }
-
- void done() {
- done = true;
- }
-
- void inQueue(final String msg) {
- queue.add(msg);
- }
-
+ protected void beforeInvoke() {
+ searchResult.setText(InfoViewMessages.getString("RubyInformation.please_wait"));
+ }
+
void addToBuffer(int position, final String line) {
if (position < 0) position = 0;
StringBuffer modifiedLine = new StringBuffer(line);
@@ -424,56 +304,88 @@
buffer.insert(position, modifiedLine.toString());
}
- public void run() {
+ protected void handleOutput(final Process process) {
+ if (process == null)
+ return;
try {
- InputStreamReader isr = new InputStreamReader(is);
+ buffer = new StringBuffer();
+ InputStreamReader isr = new InputStreamReader(process.getInputStream());
BufferedReader br = new BufferedReader(isr);
// Insert all the text
+ String line = null; // FIXME What do we do if this process hits an error?
while ((line = br.readLine()) != null) {
- addToBuffer(buffer.length() - 1, linePrefix + line);
+ addToBuffer(buffer.length() - 1, line);
}
buffer.insert(0, HEADER); // Put the header before all the contents
buffer.append(TAIL); // Put the body and html close tags at end
-
- setText();
- // Insert later text at end, but before close body and html tags
- while ((!done) || (queue.size() > 0)) {
- if (queue.size() > 0) {
- String queued = (String) queue.get(0);
- if(queued == null) {
- queue.remove(0);
- continue;
- }
- addToBuffer(buffer.length() - TAIL.length(), linePrefix + queued);
- queue.remove(0);
- setText();
- } else {
- try {
- Thread.sleep(100);
- } catch (InterruptedException IGNORE) {}
+ final String text = buffer.toString();
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ searchResult.setText(text);
}
- }
+ });
} catch (IOException ioe) {
ioe.printStackTrace();
}
- }
-
- /**
- * Puts the contents of the buffer into the widget
- */
- private void setText() {
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- searchResult.setText(buffer.toString());
- }
- });
}
- }
+ }
- /**
+ /**
* When teh rdoc has changed, automatically update/regenerate the view
*/
public void rdocChanged() {
updatePage();
}
+
+ private class RIPopulator extends RubyInvoker {
+ private RIView view;
+
+ public RIPopulator(RIView view) {
+ this.view = view;
+ }
+
+ @Override
+ protected List<String> getArgList() {
+ List<String> args = new ArrayList<String>();
+ args.add("--no-pager");
+ args.add("-l");
+ return args;
+ }
+
+ @Override
+ protected void handleOutput(Process process) {
+ if (process == null) return;
+ view.riFound = false;
+ BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
+ String line = null;
+ fgPossibleMatches = new ArrayList<String>();
+ try {
+ while ((line = reader.readLine()) != null) {
+ fgPossibleMatches.add(line.trim());
+ }
+ // if not matches were found display an error message
+ if( fgPossibleMatches.size() == 0 ){
+ view.riNotFound();
+ } else {
+ view.riFound = true;
+ }
+ }
+ catch (IOException e) {
+ RubyPlugin.log(e);
+ }
+ final Display display = Display.getDefault();
+ display.asyncExec (new Runnable () {
+ public void run () {
+ filterSearchList();
+ if (riFound) pageBook.showPage(form);
+ }
+ });
+ }
+
+ }
+
+ void riNotFound() {
+ riFound = false;
+ pageBook.showPage( riNotFoundLabel );
+ }
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-03-23 17:24:36
|
Revision: 2217
http://svn.sourceforge.net/rubyeclipse/?rev=2217&view=rev
Author: cawilliams
Date: 2007-03-23 10:24:35 -0700 (Fri, 23 Mar 2007)
Log Message:
-----------
set default path for rdoc and ri to blank string. otherwise if a new user happens to hit the page and doesn't want to deal with setting those paths they used to get forced to (because "rodc" and "ri" were not valid paths).
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/PreferenceConstants.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/PreferenceConstants.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/PreferenceConstants.java 2007-03-23 15:16:20 UTC (rev 2216)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/PreferenceConstants.java 2007-03-23 17:24:35 UTC (rev 2217)
@@ -36,8 +36,8 @@
public static final String TEMPLATES_USE_CODEFORMATTER = "templatesUseCodeFormatter"; //$NON-NLS-1$
- private final static String DEFAULT_RDOC_CMD = "rdoc"; //$NON-NLS-1$
- private final static String DEFAULT_RI_CMD = "ri"; //$NON-NLS-1$
+ private final static String DEFAULT_RDOC_CMD = ""; //$NON-NLS-1$
+ private final static String DEFAULT_RI_CMD = ""; //$NON-NLS-1$
private static final String LOADPATH_RUBYVMLIBRARY_INDEX= PreferenceConstants.NEWPROJECT_JRELIBRARY_INDEX;
private static final String LOADPATH_RUBYVMLIBRARY_LIST= PreferenceConstants.NEWPROJECT_JRELIBRARY_LIST;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-03-23 15:16:22
|
Revision: 2216
http://svn.sourceforge.net/rubyeclipse/?rev=2216&view=rev
Author: cawilliams
Date: 2007-03-23 08:16:20 -0700 (Fri, 23 Mar 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_RubyLintVisitor.java
Modified: trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_RubyLintVisitor.java
===================================================================
--- trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_RubyLintVisitor.java 2007-03-23 15:01:37 UTC (rev 2215)
+++ trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_RubyLintVisitor.java 2007-03-23 15:16:20 UTC (rev 2216)
@@ -1,63 +1,38 @@
package org.rubypeople.rdt.internal.core.builder;
import java.io.StringReader;
-import java.util.ArrayList;
import java.util.List;
import junit.framework.TestCase;
import org.jruby.ast.Node;
-import org.jruby.ast.visitor.NodeVisitor;
import org.rubypeople.eclipse.shams.resources.ShamFile;
-import org.rubypeople.rdt.core.IProblemRequestor;
-import org.rubypeople.rdt.core.compiler.IProblem;
+import org.rubypeople.rdt.core.compiler.CategorizedProblem;
import org.rubypeople.rdt.internal.core.parser.RubyParser;
import org.rubypeople.rdt.internal.core.parser.warnings.DelegatingVisitor;
import org.rubypeople.rdt.internal.core.parser.warnings.RubyLintVisitor;
public class TC_RubyLintVisitor extends TestCase {
-
- class MockProblemRequestor implements IProblemRequestor {
- List problems;
-
- public MockProblemRequestor() {
- problems = new ArrayList();
- }
-
- public void acceptProblem(IProblem problem) {
- problems.add(problem);
- }
-
- public void beginReporting() {
- }
-
- public void endReporting() {
- }
-
- public boolean isActive() {
- return false;
- }
- }
- private MockProblemRequestor problemRequestor;
+ private List<CategorizedProblem> problems;
public void testUnlessModififerDoesntCreateEmptyConditionalWarning() throws Exception {
runLint("@var = 3 unless @blah");
- assertEquals(0, problemRequestor.problems.size());
+ assertEquals(0, problems.size());
}
public void testUnlessConditionalDoesntCreateEmptyConditionalWarning() throws Exception {
runLint("unless @blah\n @var = 3\nend");
- assertEquals(0, problemRequestor.problems.size());
+ assertEquals(0, problems.size());
}
private void runLint(String contents) {
RubyParser parser = new RubyParser();
Node rootNode = parser.parse(new ShamFile("fake/path.rb"), new StringReader(contents));
- problemRequestor = new MockProblemRequestor();
- List<RubyLintVisitor> visitors = DelegatingVisitor.createVisitors(contents, problemRequestor);
- NodeVisitor visitor = new DelegatingVisitor(visitors);
+ List<RubyLintVisitor> visitors = DelegatingVisitor.createVisitors(contents);
+ DelegatingVisitor visitor = new DelegatingVisitor(visitors);
rootNode.accept(visitor);
+ problems = visitor.getProblems();
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-03-23 15:01:40
|
Revision: 2215
http://svn.sourceforge.net/rubyeclipse/?rev=2215&view=rev
Author: cawilliams
Date: 2007-03-23 08:01:37 -0700 (Fri, 23 Mar 2007)
Log Message:
-----------
avoid classcastexception. domore work towards moving to a compilationParticipant model
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptProblemFinder.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/RubyCodeAnalyzer.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/RdtWarnings.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/TaskParser.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/ConstantReassignmentVisitor.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/DelegatingVisitor.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/EmptyStatementVisitor.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/RubyLintVisitor.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/StaticConditionalVisitor.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptProblemFinder.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptProblemFinder.java 2007-03-23 12:55:08 UTC (rev 2214)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptProblemFinder.java 2007-03-23 15:01:37 UTC (rev 2215)
@@ -4,20 +4,23 @@
package org.rubypeople.rdt.internal.core;
import java.io.StringReader;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IProgressMonitor;
import org.jruby.ast.Node;
-import org.jruby.ast.visitor.NodeVisitor;
import org.jruby.lexer.yacc.SyntaxException;
-import org.rubypeople.rdt.core.IProblemRequestor;
import org.rubypeople.rdt.core.IRubyModelMarker;
+import org.rubypeople.rdt.core.RubyCore;
import org.rubypeople.rdt.core.RubyModelException;
+import org.rubypeople.rdt.core.compiler.CategorizedProblem;
import org.rubypeople.rdt.internal.core.parser.RdtWarnings;
import org.rubypeople.rdt.internal.core.parser.RubyParser;
import org.rubypeople.rdt.internal.core.parser.TaskParser;
+import org.rubypeople.rdt.internal.core.parser.TaskTag;
+import org.rubypeople.rdt.internal.core.parser.Warning;
import org.rubypeople.rdt.internal.core.parser.warnings.DelegatingVisitor;
import org.rubypeople.rdt.internal.core.parser.warnings.RubyLintVisitor;
@@ -33,28 +36,30 @@
RubyParser parser = new RubyParser(warnings);
String contents = new String(charContents);
-// runLint(script, problemRequestor, parser, contents); FIXME Make all these compilationParticipants
+ List<CategorizedProblem> generatedProblems = runLint(script, parser, contents); // FIXME Make all these compilationParticipants
TaskParser taskParser = new TaskParser(script.getRubyProject().getOptions(true));
taskParser.parse(contents);
-
- problems.put(IRubyModelMarker.RUBY_MODEL_PROBLEM_MARKER, warnings.getWarnings());
- problems.put(IRubyModelMarker.TASK_MARKER, taskParser.getTasks());
+ generatedProblems.addAll(warnings.getWarnings());
+ List<TaskTag> tasks = taskParser.getTasks();
+ problems.put(IRubyModelMarker.RUBY_MODEL_PROBLEM_MARKER, generatedProblems.toArray(new CategorizedProblem[generatedProblems.size()]));
+ problems.put(IRubyModelMarker.TASK_MARKER, tasks.toArray(new CategorizedProblem[tasks.size()]));
}
- private static void runLint(RubyScript script, IProblemRequestor problemRequestor, RubyParser parser, String contents) {
+ private static List<CategorizedProblem> runLint(RubyScript script, RubyParser parser, String contents) {
try {
Node node = parser.parse((IFile) script.getUnderlyingResource(), new StringReader(contents));
- if (node == null) return;
- List<RubyLintVisitor> visitors = DelegatingVisitor.createVisitors(contents, problemRequestor);
- NodeVisitor visitor = new DelegatingVisitor(visitors);
+ if (node == null) return new ArrayList<CategorizedProblem>();
+ List<RubyLintVisitor> visitors = DelegatingVisitor.createVisitors(contents);
+ DelegatingVisitor visitor = new DelegatingVisitor(visitors);
node.accept(visitor);
+ return visitor.getProblems();
} catch (SyntaxException e) {
// Eat the exception
// problemRequestor.acceptProblem(new Error(e.getPosition(), e.getMessage()));
} catch (RubyModelException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ RubyCore.log(e);
}
+ return new ArrayList<CategorizedProblem>();
}
}
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/RubyCodeAnalyzer.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/RubyCodeAnalyzer.java 2007-03-23 12:55:08 UTC (rev 2214)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/RubyCodeAnalyzer.java 2007-03-23 15:01:37 UTC (rev 2215)
@@ -58,7 +58,7 @@
try {
Node rootNode = parser.parse(file, new StringReader(contents));
if (rootNode == null) return;
- List<RubyLintVisitor> visitors = DelegatingVisitor.createVisitors(contents, new ProblemRequestorMarkerManager(file, markerManager));
+ List<RubyLintVisitor> visitors = DelegatingVisitor.createVisitors(contents); // FIXME How do we hook the warnings/errors up now?!
NodeVisitor visitor = new DelegatingVisitor(visitors);
rootNode.accept(visitor);
indexUpdater.update(file, rootNode, true);
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/RdtWarnings.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/RdtWarnings.java 2007-03-23 12:55:08 UTC (rev 2214)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/RdtWarnings.java 2007-03-23 15:01:37 UTC (rev 2215)
@@ -15,13 +15,13 @@
*/
public class RdtWarnings implements IRdtWarnings {
- private List warnings;
+ private List<Warning> warnings;
public RdtWarnings() {
- warnings = new ArrayList();
+ warnings = new ArrayList<Warning>();
}
- public List getWarnings() {
+ public List<Warning> getWarnings() {
return Collections.unmodifiableList(warnings);
}
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/TaskParser.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/TaskParser.java 2007-03-23 12:55:08 UTC (rev 2214)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/TaskParser.java 2007-03-23 15:01:37 UTC (rev 2215)
@@ -25,7 +25,7 @@
private boolean fCaseSensitive = false;
private String[] fTags;
private int[] fPriorities;
- private List tasks;
+ private List<TaskTag> tasks;
public TaskParser(Map preferences) {
String caseSensitive = getString(preferences, RubyCore.COMPILER_TASK_CASE_SENSITIVE, RubyCore.ENABLED);
@@ -34,7 +34,7 @@
String priorities = getString(preferences, RubyCore.COMPILER_TASK_PRIORITIES, RubyCore.DEFAULT_TASK_PRIORITIES);
fTags = tokenize(tags, ",");
fPriorities = convertPriorities(tokenize(priorities, ","));
- tasks = new ArrayList();
+ tasks = new ArrayList<TaskTag>();
}
private String getString(Map preferences, String key, String def) {
@@ -140,7 +140,7 @@
}
}
- public List getTasks() {
+ public List<TaskTag> getTasks() {
return Collections.unmodifiableList(tasks);
}
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/ConstantReassignmentVisitor.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/ConstantReassignmentVisitor.java 2007-03-23 12:55:08 UTC (rev 2214)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/ConstantReassignmentVisitor.java 2007-03-23 15:01:37 UTC (rev 2215)
@@ -5,14 +5,13 @@
import org.jruby.ast.ConstDeclNode;
import org.jruby.evaluator.Instruction;
-import org.rubypeople.rdt.core.IProblemRequestor;
public class ConstantReassignmentVisitor extends RubyLintVisitor {
private Set<String> assignedConstants;
- public ConstantReassignmentVisitor(String contents, IProblemRequestor problemRequestor) {
- super(contents, problemRequestor);
+ public ConstantReassignmentVisitor(String contents) {
+ super(contents);
assignedConstants = new HashSet<String>();
}
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/DelegatingVisitor.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/DelegatingVisitor.java 2007-03-23 12:55:08 UTC (rev 2214)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/DelegatingVisitor.java 2007-03-23 15:01:37 UTC (rev 2215)
@@ -1,6 +1,7 @@
package org.rubypeople.rdt.internal.core.parser.warnings;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import org.jruby.ast.AliasNode;
@@ -99,6 +100,7 @@
import org.jruby.ast.ZSuperNode;
import org.jruby.evaluator.Instruction;
import org.rubypeople.rdt.core.IProblemRequestor;
+import org.rubypeople.rdt.core.compiler.CategorizedProblem;
import org.rubypeople.rdt.internal.core.parser.InOrderVisitor;
/**
@@ -117,15 +119,23 @@
private List<RubyLintVisitor> visitors;
- public static List<RubyLintVisitor> createVisitors(String contents, IProblemRequestor requestor) {
+ public static List<RubyLintVisitor> createVisitors(String contents) {
List<RubyLintVisitor> visitors = new ArrayList<RubyLintVisitor>();
// FIXME Run through a map of keys to classes and add instances of
// classes whose key is not set to ignore
- visitors.add(new EmptyStatementVisitor(contents, requestor));
- visitors.add(new StaticConditionalVisitor(contents, requestor));
- visitors.add(new ConstantReassignmentVisitor(contents, requestor));
+ visitors.add(new EmptyStatementVisitor(contents));
+ visitors.add(new StaticConditionalVisitor(contents));
+ visitors.add(new ConstantReassignmentVisitor(contents));
return visitors;
}
+
+ public List<CategorizedProblem> getProblems() {
+ List<CategorizedProblem> problems = new ArrayList<CategorizedProblem>();
+ for (RubyLintVisitor visitor : visitors) {
+ problems.addAll(visitor.getProblems());
+ }
+ return problems;
+ }
public DelegatingVisitor(List<RubyLintVisitor> visitors) {
this.visitors = visitors;
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/EmptyStatementVisitor.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/EmptyStatementVisitor.java 2007-03-23 12:55:08 UTC (rev 2214)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/EmptyStatementVisitor.java 2007-03-23 15:01:37 UTC (rev 2215)
@@ -6,13 +6,12 @@
import org.jruby.ast.IterNode;
import org.jruby.ast.WhenNode;
import org.jruby.evaluator.Instruction;
-import org.rubypeople.rdt.core.IProblemRequestor;
import org.rubypeople.rdt.core.RubyCore;
public class EmptyStatementVisitor extends RubyLintVisitor {
- public EmptyStatementVisitor(String contents, IProblemRequestor problemRequestor) {
- super(contents, problemRequestor);
+ public EmptyStatementVisitor(String contents) {
+ super(contents);
}
@Override
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/RubyLintVisitor.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/RubyLintVisitor.java 2007-03-23 12:55:08 UTC (rev 2214)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/RubyLintVisitor.java 2007-03-23 15:01:37 UTC (rev 2215)
@@ -1,5 +1,8 @@
package org.rubypeople.rdt.internal.core.parser.warnings;
+import java.util.ArrayList;
+import java.util.List;
+
import org.jruby.ast.BlockNode;
import org.jruby.ast.ClassNode;
import org.jruby.ast.DefnNode;
@@ -12,8 +15,8 @@
import org.jruby.ast.visitor.AbstractVisitor;
import org.jruby.evaluator.Instruction;
import org.jruby.lexer.yacc.ISourcePosition;
-import org.rubypeople.rdt.core.IProblemRequestor;
import org.rubypeople.rdt.core.RubyCore;
+import org.rubypeople.rdt.core.compiler.CategorizedProblem;
import org.rubypeople.rdt.core.compiler.IProblem;
import org.rubypeople.rdt.internal.core.parser.Error;
import org.rubypeople.rdt.internal.core.parser.NodeUtil;
@@ -21,28 +24,32 @@
public abstract class RubyLintVisitor extends AbstractVisitor {
- private IProblemRequestor problemRequestor;
private String contents;
+ private List<CategorizedProblem> problems;
- public RubyLintVisitor(String contents, IProblemRequestor problemRequestor) {
- this.problemRequestor = problemRequestor;
+ public RubyLintVisitor(String contents) {
+ this.problems = new ArrayList<CategorizedProblem>();
this.contents = contents;
}
protected String getSource(Node node) {
return NodeUtil.getSource(contents, node);
}
+
+ public List<CategorizedProblem> getProblems() {
+ return problems;
+ }
protected void createProblem(ISourcePosition position, String message) {
String value = RubyCore.getOption(getOptionKey());
if (value != null && value.equals(RubyCore.IGNORE))
return;
- IProblem problem;
+ CategorizedProblem problem;
if (value != null && value.equals(RubyCore.ERROR))
problem = new Error(position, message, getProblemID());
else
problem = new Warning(position, message, getProblemID());
- problemRequestor.acceptProblem(problem);
+ problems.add(problem);
}
@Override
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/StaticConditionalVisitor.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/StaticConditionalVisitor.java 2007-03-23 12:55:08 UTC (rev 2214)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/StaticConditionalVisitor.java 2007-03-23 15:01:37 UTC (rev 2215)
@@ -6,12 +6,11 @@
import org.jruby.ast.Node;
import org.jruby.ast.TrueNode;
import org.jruby.evaluator.Instruction;
-import org.rubypeople.rdt.core.IProblemRequestor;
public class StaticConditionalVisitor extends RubyLintVisitor {
- public StaticConditionalVisitor(String contents, IProblemRequestor problemRequestor) {
- super(contents, problemRequestor);
+ public StaticConditionalVisitor(String contents) {
+ super(contents);
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mir...@us...> - 2007-03-23 12:55:17
|
Revision: 2214
http://svn.sourceforge.net/rubyeclipse/?rev=2214&view=rev
Author: mirkostocker
Date: 2007-03-23 05:55:08 -0700 (Fri, 23 Mar 2007)
Log Message:
-----------
applied mnaglik's patch for #248 "The link with editor option in the code outline doesn't actually disable linking"
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyAbstractEditor.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyAbstractEditor.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyAbstractEditor.java 2007-03-23 11:24:36 UTC (rev 2213)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyAbstractEditor.java 2007-03-23 12:55:08 UTC (rev 2214)
@@ -668,7 +668,10 @@
class OutlineSelectionChangedListener extends AbstractSelectionChangedListener {
public void selectionChanged(SelectionChangedEvent event) {
- doSelectionChanged(event);
+ boolean isLinkingEnabled = PreferenceConstants.getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_SYNC_OUTLINE_ON_CURSOR_MOVE);
+ if (isLinkingEnabled) {
+ doSelectionChanged(event);
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tc...@us...> - 2007-03-23 11:24:38
|
Revision: 2213
http://svn.sourceforge.net/rubyeclipse/?rev=2213&view=rev
Author: tcorbat
Date: 2007-03-23 04:24:36 -0700 (Fri, 23 Mar 2007)
Log Message:
-----------
Fix: Removed the dependency on a not yet implemented functionality in JRuby.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/util/NodeUtil.java
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/util/NodeUtil.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/util/NodeUtil.java 2007-03-23 11:05:08 UTC (rev 2212)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/util/NodeUtil.java 2007-03-23 11:24:36 UTC (rev 2213)
@@ -111,10 +111,41 @@
List<Node> childList = node.childNodes();
for(Node currentChild : childList){
- enclosingPosition = SourcePosition.combinePosition(enclosingPosition, subPositionUnion(currentChild));
+// combinePosition() is not yet available in JRuby (SourcePosition), hope it will we soon.
+// While waiting for this use the posUnion method.
+// enclosingPosition = SourcePosition.combinePosition(enclosingPosition, subPositionUnion(currentChild));
+ enclosingPosition = posUnion(enclosingPosition, subPositionUnion(currentChild));
+
+
}
return enclosingPosition;
}
+
+
+ private static ISourcePosition posUnion(ISourcePosition firstPos, ISourcePosition secondPos) {
+ String fileName = firstPos.getFile();
+ int startOffset = firstPos.getStartOffset();
+ int endOffset = firstPos.getEndOffset();
+ int startLine = firstPos.getStartLine();
+ int endLine = firstPos.getEndLine();
+
+ if(startOffset > secondPos.getStartOffset()){
+ startOffset = secondPos.getStartOffset();
+ startLine = secondPos.getStartLine();
+ }
+
+ if(endOffset < secondPos.getEndOffset()){
+ endOffset = secondPos.getEndOffset();
+ endLine = secondPos.getEndLine();
+ }
+
+ SourcePosition combinedPosition = new SourcePosition(fileName, startLine, endLine, startOffset, endOffset);
+
+ return combinedPosition;
+
+
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tc...@us...> - 2007-03-23 11:05:11
|
Revision: 2212
http://svn.sourceforge.net/rubyeclipse/?rev=2212&view=rev
Author: tcorbat
Date: 2007-03-23 04:05:08 -0700 (Fri, 23 Mar 2007)
Log Message:
-----------
Improved position treatment in EditProviders for handing comments.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/editprovider/DeleteEditProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/editprovider/EditProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/util/NodeUtil.java
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/editprovider/DeleteEditProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/editprovider/DeleteEditProvider.java 2007-03-22 19:28:46 UTC (rev 2211)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/editprovider/DeleteEditProvider.java 2007-03-23 11:05:08 UTC (rev 2212)
@@ -12,6 +12,7 @@
* rights and limitations under the License.
*
* Copyright (C) 2006 Lukas Felber <lf...@hs...>
+ * Copyright (C) 2007 Lukas Felber <lf...@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"),
@@ -35,6 +36,7 @@
import org.eclipse.text.edits.TextEdit;
import org.jruby.ast.Node;
import org.rubypeople.rdt.refactoring.util.Constants;
+import org.rubypeople.rdt.refactoring.util.NodeUtil;
public class DeleteEditProvider extends EditProvider {
@@ -69,7 +71,7 @@
}
private int getStartOffset(String document) {
- int startLine = fromNode.getPosition().getStartLine();
+ int startLine = NodeUtil.subPositionUnion(fromNode).getStartLine();
int pos = -1;
for (int i = 0; i < startLine; i++) {
pos = document.indexOf(Constants.NL, pos + 1);
@@ -77,16 +79,16 @@
if (pos < 0) {
pos = 0;
}
- String leadingStr = document.substring(pos, fromNode.getPosition().getStartOffset());
+ String leadingStr = document.substring(pos, NodeUtil.subPositionUnion(fromNode).getStartOffset());
if (leadingStr.trim().equals("")) { //$NON-NLS-1$
return pos;
}
- return fromNode.getPosition().getStartOffset();
+ return NodeUtil.subPositionUnion(fromNode).getStartOffset();
}
private int getEndOffset(String document) {
- int offset = toNode.getPosition().getEndOffset();
+ int offset = NodeUtil.subPositionUnion(toNode).getEndOffset();
int aktPos = offset;
Matcher matcher = Pattern.compile("[\\s;]").matcher(document); //$NON-NLS-1$
while (matcher.find(aktPos)) {
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/editprovider/EditProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/editprovider/EditProvider.java 2007-03-22 19:28:46 UTC (rev 2211)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/editprovider/EditProvider.java 2007-03-23 11:05:08 UTC (rev 2212)
@@ -12,6 +12,7 @@
* rights and limitations under the License.
*
* Copyright (C) 2006 Lukas Felber <lf...@hs...>
+ * 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"),
@@ -29,10 +30,13 @@
package org.rubypeople.rdt.refactoring.editprovider;
import org.eclipse.text.edits.TextEdit;
+import org.jruby.ast.NewlineNode;
import org.jruby.ast.Node;
import org.jruby.ast.visitor.rewriter.DefaultFormatHelper;
import org.jruby.ast.visitor.rewriter.FormatHelper;
import org.jruby.ast.visitor.rewriter.ReWriteVisitor;
+import org.jruby.lexer.yacc.ISourcePosition;
+import org.rubypeople.rdt.refactoring.core.NodeFactory;
import org.rubypeople.rdt.refactoring.util.Constants;
import org.rubypeople.rdt.refactoring.util.HsrFormatter;
@@ -91,4 +95,18 @@
int pos = document.indexOf(Constants.NL, offset);
return (pos != -1) ? pos : document.length() - 1;
}
+
+ protected ISourcePosition getExtendedPosition(Node node){
+ if(node instanceof NewlineNode){
+ node = ((NewlineNode)node).getNextNode();
+ }
+ ISourcePosition extendedPosition = node.getPositionIncludingComments();
+
+ for(Object currentChild : node.childNodes()){
+ extendedPosition = NodeFactory.unionPositions(extendedPosition, getExtendedPosition((Node) currentChild));
+ }
+
+ return extendedPosition;
+
+ }
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/util/NodeUtil.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/util/NodeUtil.java 2007-03-22 19:28:46 UTC (rev 2211)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/util/NodeUtil.java 2007-03-23 11:05:08 UTC (rev 2212)
@@ -30,10 +30,13 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
+import java.util.List;
import org.jruby.ast.IterNode;
import org.jruby.ast.MethodDefNode;
import org.jruby.ast.Node;
+import org.jruby.lexer.yacc.ISourcePosition;
+import org.jruby.lexer.yacc.SourcePosition;
import org.jruby.parser.StaticScope;
public class NodeUtil {
@@ -100,4 +103,18 @@
}
return false;
}
+
+ public static ISourcePosition subPositionUnion(Node node){
+
+ ISourcePosition enclosingPosition = node.getPositionIncludingComments();
+
+ List<Node> childList = node.childNodes();
+
+ for(Node currentChild : childList){
+ enclosingPosition = SourcePosition.combinePosition(enclosingPosition, subPositionUnion(currentChild));
+ }
+
+ return enclosingPosition;
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-03-22 19:29:58
|
Revision: 2211
http://svn.sourceforge.net/rubyeclipse/?rev=2211&view=rev
Author: cawilliams
Date: 2007-03-22 12:28:46 -0700 (Thu, 22 Mar 2007)
Log Message:
-----------
start adding a new extension based on JDT's compilationParticipant extnesion point. This lets plugins hook into the build and reconcile process to garb the AST, script, file, or contents and also add/mange problem and task markers on the resource/working copy.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/plugin.xml
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ReconcileWorkingCopyOperation.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyElementDeltaBuilder.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelManager.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScript.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptProblemFinder.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.core/schema/compilationParticipant.exsd
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/BuildContext.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/CompilationParticipant.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/CompilationParticipantResult.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/ReconcileContext.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ASTHolderCUInfo.java
Modified: trunk/org.rubypeople.rdt.core/plugin.xml
===================================================================
--- trunk/org.rubypeople.rdt.core/plugin.xml 2007-03-22 15:59:32 UTC (rev 2210)
+++ trunk/org.rubypeople.rdt.core/plugin.xml 2007-03-22 19:28:46 UTC (rev 2211)
@@ -3,6 +3,7 @@
<plugin>
<extension-point id="loadpathVariableInitializer" name="%loadpathVariableInitializersName" schema="schema/loadpathVariableInitializer.exsd"/>
<extension-point id="loadpathContainerInitializer" name="%loadpathContainerInitializersName" schema="schema/loadpathContainerInitializer.exsd"/>
+ <extension-point id="compilationParticipant" name="%compilationParticipantsName" schema="schema/compilationParticipant.exsd"/>
<extension
id="rubynature"
Added: trunk/org.rubypeople.rdt.core/schema/compilationParticipant.exsd
===================================================================
--- trunk/org.rubypeople.rdt.core/schema/compilationParticipant.exsd (rev 0)
+++ trunk/org.rubypeople.rdt.core/schema/compilationParticipant.exsd 2007-03-22 19:28:46 UTC (rev 2211)
@@ -0,0 +1,191 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.rubypeople.rdt.core">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.rubypeople.rdt.core" id="compilationParticipant" name="Compilation Participants"/>
+ </appInfo>
+ <documentation>
+ This extension point allows clients to participate in the compilation process by receiving notifications at various stages of build and reconcile, via a org.rubypeople.rdt.core.compiler.CompilationParticipant.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence>
+ <element ref="compilationParticipant" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="compilationParticipant">
+ <annotation>
+ <documentation>
+ definition of a compilation participant. This definition allows to order participants. Participants are run by group. The group of participants that modify the environment is run first, then the group of participants that create problems is run, finally the group of other participants is run. Inside each group, participants are ordered using their 'requires' attributes. If a 'requires' attribute point to a participant that doesn't belong to the group, it is ignored.
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="requires" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="managedMarker" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ the class that implements this compilation participant. This class must implement a public subclass of <code>org.eclipse.jdt.core.compiler.CompilationParticipant</code> with a public 0-argument constructor.
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.jdt.core.compiler.CompilationParticipant"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ a unique identifier for this participant
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="modifiesEnvironment" type="boolean">
+ <annotation>
+ <documentation>
+ optionally specify whether this compilation participant modifies the environment, thus affecting binding resolution. If not specified, false is assumed.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="createsProblems" type="boolean">
+ <annotation>
+ <documentation>
+ optionally specifies whether this compilation participant creates problems. If not specified, false is assumed.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="requiredSourceLevel" type="string">
+ <annotation>
+ <documentation>
+ the required source level this participant needs (one of the JavaCore.VERSION* constants). If a project's source level is below this required source level, the participant will not be invoked. If this attribute is not specified, the participant will be invoked for any source level.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="requires">
+ <annotation>
+ <documentation>
+ a participant that is required to run this compilation participant
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ the unique identifier of the participant that is required
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="managedMarker">
+ <annotation>
+ <documentation>
+ a managed marker is created from the recorded problems (see BuildContext#recordNewProblems(CategorizedProblem[])) and is removed when the corresponding source file is re-built or when the project is cleaned
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="markerType" type="string" use="required">
+ <annotation>
+ <documentation>
+ the type of the managed marker
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ 0.9.0
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ Example of a declaration of a <code>compilationParticipant</code>: <pre>
+<extension
+ id="apt"
+ name="%annotationProcessingName"
+ point="org.rubypeoplee.rdt.core.compilationParticipant">
+ <compilationParticipant
+ class="org.eclipse.jdt.apt.core.internal.AptCompilationParticipant"
+ id="APT">
+ <managedMarker markerType="org.rubypeople.rdt.apt.core.compile.problem"/>
+ </compilationParticipant>
+</extension>
+</pre>
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ Copyright (c) 2006 BEA Systems, Inc and others.<br>
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Eclipse Public License v1.0
+which accompanies this distribution, and is available at
+<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
+ </documentation>
+ </annotation>
+
+</schema>
Added: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/BuildContext.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/BuildContext.java (rev 0)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/BuildContext.java 2007-03-22 19:28:46 UTC (rev 2211)
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *
+ *******************************************************************************/
+
+package org.rubypeople.rdt.core.compiler;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.rubypeople.rdt.internal.core.util.Util;
+
+/**
+ * The context of a build event that is notified to interested compilation
+ * participants when {@link CompilationParticipant#buildStarting(BuildContext[], boolean) a build is starting},
+ * or to annotations processors when {@link CompilationParticipant#processAnnotations(BuildContext[]) a source file has annotations}.
+ * <p>
+ * This class is not intended to be instanciated or subclassed by clients.
+ * </p>
+ * @since 0.9.0
+ */
+public class BuildContext extends CompilationParticipantResult {
+
+/**
+ * Creates a build context for the given source file.
+ * <p>
+ * This constructor is not intended to be called by clients.
+ * </p>
+ *
+ * @param sourceFile the source file being built
+ */
+public BuildContext(IFile resource) {
+ super(resource);
+}
+
+/**
+ * Returns the contents of the compilation unit.
+ *
+ * @return the contents of the compilation unit
+ */
+public char[] getContents() {
+ try {
+ return Util.getResourceContentsAsCharArray(this.resource);
+ } catch (CoreException e) {
+ throw new RuntimeException("Missing source file: " + this.resource);
+ }
+}
+
+/**
+ * Returns the <code>IFile</code> representing the compilation unit.
+ *
+ * @return the <code>IFile</code> representing the compilation unit
+ */
+public IFile getFile() {
+ return this.resource;
+}
+
+/**
+ * Returns whether the compilation unit contained any annotations when it was compiled.
+ *
+ * NOTE: This is only valid during {@link CompilationParticipant#processAnnotations(BuildContext[])}.
+ *
+ * @return whether the compilation unit contained any annotations when it was compiled
+ */
+public boolean hasAnnotations() {
+ return this.hasAnnotations; // only set during processAnnotations
+}
+
+/**
+ * Record new problems to report against this compilationUnit.
+ * Markers are persisted for these problems only for the declared managed marker type
+ * (see the 'compilationParticipant' extension point).
+ *
+ * @param newProblems the problems to report
+ */
+public void recordNewProblems(CategorizedProblem[] newProblems) {
+ int length2 = newProblems.length;
+ if (length2 == 0) return;
+
+ int length1 = this.problems == null ? 0 : this.problems.length;
+ CategorizedProblem[] merged = new CategorizedProblem[length1 + length2];
+ if (length1 > 0) // always make a copy even if currently empty
+ System.arraycopy(this.problems, 0, merged, 0, length1);
+ System.arraycopy(newProblems, 0, merged, length1, length2);
+ this.problems = merged;
+}
+
+}
Added: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/CompilationParticipant.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/CompilationParticipant.java (rev 0)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/CompilationParticipant.java 2007-03-22 19:28:46 UTC (rev 2211)
@@ -0,0 +1,128 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * mka...@be... - initial API as ICompilationParticipant
+ * IBM - changed from interface ICompilationParticipant to abstract class CompilationParticipant
+ * IBM - rewrote spec
+ *
+ *******************************************************************************/
+
+package org.rubypeople.rdt.core.compiler;
+
+import org.rubypeople.rdt.core.IRubyProject;
+
+/**
+ * A compilation participant is notified of events occuring during the compilation process.
+ * The compilation process not only involves generating .class files (i.e. building), it also involve
+ * cleaning the output directory, reconciling a working copy, etc.
+ * So the notified events are the result of a build action, a clean action, a reconcile operation
+ * (for a working copy), etc.
+ * <p>
+ * Clients wishing to participate in the compilation process must suclass this class, and implement
+ * {@link #isActive(IJavaProject)}, {@link #aboutToBuild(IJavaProject)},
+ * {@link #reconcile(ReconcileContext)}, etc.
+* </p><p>
+ * This class is intended to be subclassed by clients.
+ * </p>
+ * @since 3.2
+ */
+public abstract class CompilationParticipant {
+
+public static int READY_FOR_BUILD = 1;
+public static int NEEDS_FULL_BUILD = 2;
+
+/**
+ * Notifies this participant that a build is about to start and provides it the opportunity to
+ * create missing source folders for generated source files.
+ * Only sent to participants interested in the project.
+ * <p>
+ * Default is to return <code>READY_FOR_BUILD</code>.
+ * </p>
+ * @param project the project about to build
+ * @return READY_FOR_BUILD or NEEDS_FULL_BUILD
+ */
+public int aboutToBuild(IRubyProject project) {
+ return READY_FOR_BUILD;
+}
+
+/**
+ * Notifies this participant that a compile operation is about to start and provides it the opportunity to
+ * generate source files based on the source files about to be compiled.
+ * When isBatchBuild is true, then files contains all source files in the project.
+ * Only sent to participants interested in the current build project.
+ *
+ * @param files is an array of BuildContext
+ * @param isBatch identifies when the build is a batch build
+ */
+public void buildStarting(BuildContext[] files, boolean isBatch) {
+ // do nothing by default
+}
+
+/**
+ * Notifies this participant that a clean is about to start and provides it the opportunity to
+ * delete generated source files.
+ * Only sent to participants interested in the project.
+ * @param project the project about to be cleaned
+ */
+public void cleanStarting(IRubyProject project) {
+ // do nothing by default
+}
+
+/**
+ * Returns whether this participant is active for a given project.
+ * <p>
+ * Default is to return <code>false</code>.
+ * </p><p>
+ * For efficiency, participants that are not interested in the
+ * given project should return <code>false</code> for that project.
+ * </p>
+ * @param project the project to participate in
+ * @return whether this participant is active for a given project
+ */
+public boolean isActive(IRubyProject project) {
+ return false;
+}
+
+/**
+ * Returns whether this participant is interested in only Annotations.
+ * <p>
+ * Default is to return <code>false</code>.
+ * </p>
+ * @return whether this participant is interested in only Annotations.
+ */
+public boolean isAnnotationProcessor() {
+ return false;
+}
+
+/**
+ * Notifies this participant that a compile operation has found source files using Annotations.
+ * Only sent to participants interested in the current build project that answer true to isAnnotationProcessor().
+ * Each BuildContext was informed whether its source file currently hasAnnotations().
+ *
+ * @param files is an array of BuildContext
+ */
+public void processAnnotations(BuildContext[] files) {
+ // do nothing by default
+}
+
+/**
+ * Notifies this participant that a reconcile operation is happening. The participant can act on this reconcile
+ * operation by using the given context. Other participant can then see the result of this participation
+ * on this context.
+ * <p>
+ * Note that a participant should not modify the buffer of the working copy that is being reconciled.
+ * </p><p>
+ * Default is to do nothing.
+ * </p>
+ * @param context the reconcile context to act on
+ */
+public void reconcile(ReconcileContext context) {
+ // do nothing by default
+}
+
+}
Added: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/CompilationParticipantResult.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/CompilationParticipantResult.java (rev 0)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/CompilationParticipantResult.java 2007-03-22 19:28:46 UTC (rev 2211)
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - rewrote spec
+ *
+ *******************************************************************************/
+
+package org.rubypeople.rdt.core.compiler;
+
+import org.eclipse.core.resources.IFile;
+
+public class CompilationParticipantResult {
+ protected IFile resource;
+ protected boolean hasAnnotations; // only set during processAnnotations
+ protected IFile[] addedFiles; // added/changed generated source files that need to be compiled
+ protected IFile[] deletedFiles; // previously generated source files that should be deleted
+ protected CategorizedProblem[] problems; // new problems to report against this compilationUnit
+ protected String[] dependencies; // fully-qualified type names of any new dependencies, each name is of the form 'p1.p2.A.B'
+
+protected CompilationParticipantResult(IFile resource) {
+ this.resource = resource;
+ this.hasAnnotations = false;
+ this.addedFiles = null;
+ this.deletedFiles = null;
+ this.problems = null;
+ this.dependencies = null;
+}
+
+void reset(boolean detectedAnnotations) {
+ // called prior to processAnnotations
+ this.hasAnnotations = detectedAnnotations;
+ this.addedFiles = null;
+ this.deletedFiles = null;
+ this.problems = null;
+ this.dependencies = null;
+}
+
+public String toString() {
+ return this.resource.toString();
+}
+
+}
Added: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/ReconcileContext.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/ReconcileContext.java (rev 0)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/compiler/ReconcileContext.java 2007-03-22 19:28:46 UTC (rev 2211)
@@ -0,0 +1,163 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * mka...@be... - initial API and implementation
+ * IBM - renamed from PreReconcileCompilationResult to ReconcileContext
+ * IBM - rewrote spec
+ *
+ *******************************************************************************/
+
+package org.rubypeople.rdt.core.compiler;
+
+import java.util.HashMap;
+
+import org.jruby.ast.RootNode;
+import org.rubypeople.rdt.core.IRubyElementDelta;
+import org.rubypeople.rdt.core.IRubyModelMarker;
+import org.rubypeople.rdt.core.IRubyScript;
+import org.rubypeople.rdt.core.RubyModelException;
+import org.rubypeople.rdt.internal.core.ReconcileWorkingCopyOperation;
+import org.rubypeople.rdt.internal.core.RubyScript;
+
+/**
+ * The context of a reconcile event that is notified to interested compilation
+ * participants while a reconcile operation is running.
+ * <p>
+ * A reconcile participant can get the AST for the reconcile-operation using
+ * {@link #getAST()}. If the participant modifies in any way the AST
+ * (either by modifying the source of the working copy, or modifying another entity
+ * that would result in different bindings for the AST), it is expected to reset the
+ * AST in the context using {@link #resetAST()}.
+ * </p><p>
+ * A reconcile participant can also create and return problems using
+ * {@link #putProblems(String, CategorizedProblem[])}. These problems are then reported
+ * to the problem requestor of the reconcile operation.
+ * </p><p>
+ * This class is not intended to be instanciated or subclassed by clients.
+ * </p>
+ *
+ * @see CompilationParticipant#reconcile(ReconcileContext)
+ * @since 0.9.0
+ */
+public class ReconcileContext {
+
+ private ReconcileWorkingCopyOperation operation;
+ private RubyScript workingCopy;
+
+/**
+ * Creates a reconcile context for the given reconcile operation.
+ * <p>
+ * This constructor is not intended to be called by clients.
+ * </p>
+ *
+ * @param operation the reconcile operation
+ */
+public ReconcileContext(ReconcileWorkingCopyOperation operation, RubyScript workingCopy) {
+ this.operation = operation;
+ this.workingCopy = workingCopy;
+}
+
+/**
+ * Returns a resolved AST with {@link AST#JLS3 JLS3} level.
+ * It is created from the current state of the working copy.
+ * Creates one if none exists yet.
+ * Returns <code>null</code> if the current state of the working copy
+ * doesn't allow the AST to be created (e.g. if the working copy's content
+ * cannot be parsed).
+ * <p>
+ * If the AST level requested during reconciling is not {@link AST#JLS3}
+ * or if binding resolutions was not requested, then a different AST is created.
+ * Note that this AST does not become the current AST and it is only valid for
+ * the requestor.
+ * </p>
+ *
+ * @return the AST created from the current state of the working copy,
+ * or <code>null</code> if none could be created
+ * @exception RubyModelException if the contents of the working copy
+ * cannot be accessed. Reasons include:
+ * <ul>
+ * <li> The working copy does not exist (ELEMENT_DOES_NOT_EXIST)</li>
+ * </ul>
+ */
+public RootNode getAST() throws RubyModelException {
+ return this.operation.makeConsistent(this.workingCopy, null/*don't report problems to the working copy's problem requestor*/);
+}
+
+
+/**
+ * Returns the delta describing the change to the working copy being reconciled.
+ * Returns <code>null</code> if there is no change.
+ * Note that the delta's AST is not yet positionnned at this stage. Use {@link #getAST3()}
+ * to get the current AST.
+ *
+ * @return the delta describing the change, or <code>null</code> if none
+ */
+public IRubyElementDelta getDelta() {
+ return this.operation.deltaBuilder.delta;
+}
+
+/**
+ * Returns the problems to be reported to the problem requestor of the reconcile operation
+ * for the given marker type.
+ * Returns <code>null</code> if no problems need to be reported for this marker type.
+ *
+ * @param markerType the given marker type
+ * @return problems to be reported to the problem requesto
+ */
+public CategorizedProblem[] getProblems(String markerType) {
+ if (this.operation.problems == null) return null;
+ return (CategorizedProblem[]) this.operation.problems.get(markerType);
+}
+
+/**
+ * Returns the working copy this context refers to.
+ *
+ * @return the working copy this context refers to
+ */
+public IRubyScript getWorkingCopy() {
+ return this.workingCopy;
+}
+
+/**
+ * Resets the AST carried by this context.
+ * A compilation participant that modifies the environment that would result in different
+ * bindings for the AST is expected to reset the AST on this context, so that other
+ * participants don't get a stale AST.
+ * <p>
+ * Note that resetting the AST will not restart the reconcile process. Only further
+ * participants will see the new AST. Thus participants running before the one that
+ * resets the AST will have a stale view of the AST and its problems. Use
+ * the compilation participant extension point to order the participants.
+ * </p>
+ */
+public void resetAST() {
+ this.operation.ast = null;
+ putProblems(IRubyModelMarker.RUBY_MODEL_PROBLEM_MARKER, null);
+ putProblems(IRubyModelMarker.TASK_MARKER, null);
+}
+
+/**
+ * Sets the problems to be reported to the problem requestor of the reconcile operation
+ * for the given marker type.
+ * <code>null</code> indicates that no problems need to be reported.
+ * <p>
+ * Using this functionality, a participant that resolves problems for a given marker type
+ * can hide those problems since they don't exist any longer.
+ * </p>
+ *
+ * @param markerType the marker type of the given problems
+ * @param problems the problems to be reported to the problem requestor of the reconcile operation,
+ * or <code>null</code> if none
+ */
+public void putProblems(String markerType, CategorizedProblem[] problems) {
+ if (this.operation.problems == null)
+ this.operation.problems = new HashMap();
+ this.operation.problems.put(markerType, problems);
+}
+
+}
Added: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ASTHolderCUInfo.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ASTHolderCUInfo.java (rev 0)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ASTHolderCUInfo.java 2007-03-22 19:28:46 UTC (rev 2211)
@@ -0,0 +1,12 @@
+package org.rubypeople.rdt.internal.core;
+
+import java.util.HashMap;
+
+import org.jruby.ast.RootNode;
+
+public class ASTHolderCUInfo extends RubyScriptElementInfo {
+
+ public HashMap problems;
+ public RootNode ast;
+
+}
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ReconcileWorkingCopyOperation.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ReconcileWorkingCopyOperation.java 2007-03-22 15:59:32 UTC (rev 2210)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ReconcileWorkingCopyOperation.java 2007-03-22 19:28:46 UTC (rev 2211)
@@ -10,109 +10,205 @@
*******************************************************************************/
package org.rubypeople.rdt.internal.core;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.SafeRunner;
+import org.jruby.ast.RootNode;
import org.rubypeople.rdt.core.IProblemRequestor;
import org.rubypeople.rdt.core.IRubyElement;
import org.rubypeople.rdt.core.IRubyModelStatus;
import org.rubypeople.rdt.core.IRubyModelStatusConstants;
+import org.rubypeople.rdt.core.IRubyProject;
import org.rubypeople.rdt.core.RubyModelException;
import org.rubypeople.rdt.core.WorkingCopyOwner;
+import org.rubypeople.rdt.core.compiler.CategorizedProblem;
+import org.rubypeople.rdt.core.compiler.CompilationParticipant;
+import org.rubypeople.rdt.core.compiler.ReconcileContext;
import org.rubypeople.rdt.internal.core.util.Messages;
+import org.rubypeople.rdt.internal.core.util.Util;
/**
* Reconcile a working copy and signal the changes through a delta.
*/
public class ReconcileWorkingCopyOperation extends RubyModelOperation {
- public static boolean PERF = false;
- boolean createAST;
- boolean forceProblemDetection;
- WorkingCopyOwner workingCopyOwner;
- RubyScript ast;
+ public static boolean PERF = false;
+ boolean createAST;
+ boolean forceProblemDetection;
+ WorkingCopyOwner workingCopyOwner;
+ public RootNode ast;
+ public RubyElementDeltaBuilder deltaBuilder;
+ public HashMap problems;
- public ReconcileWorkingCopyOperation(IRubyElement workingCopy,
- boolean forceProblemDetection, WorkingCopyOwner workingCopyOwner) {
- super(new IRubyElement[] { workingCopy});
- this.forceProblemDetection = forceProblemDetection;
- this.workingCopyOwner = workingCopyOwner;
- }
+ public ReconcileWorkingCopyOperation(IRubyElement workingCopy, boolean forceProblemDetection, WorkingCopyOwner workingCopyOwner) {
+ super(new IRubyElement[] { workingCopy });
+ this.forceProblemDetection = forceProblemDetection;
+ this.workingCopyOwner = workingCopyOwner;
+ }
- /**
- * @exception RubyModelException
- * if setting the source of the original compilation unit
- * fails
- */
- protected void executeOperation() throws RubyModelException {
- if (this.progressMonitor != null) {
- if (this.progressMonitor.isCanceled()) throw new OperationCanceledException();
- this.progressMonitor.beginTask(Messages.bind(Messages.element_reconciling), 2);
- }
- RubyScript workingCopy = getWorkingCopy();
- boolean wasConsistent = workingCopy.isConsistent();
- try {
- if (!wasConsistent) {
- // create the delta builder (this remembers the current content
- // of the cu)
- RubyElementDeltaBuilder deltaBuilder = new RubyElementDeltaBuilder(workingCopy);
+ /**
+ * @exception RubyModelException
+ * if setting the source of the original compilation unit
+ * fails
+ */
+ protected void executeOperation() throws RubyModelException {
+ if (this.progressMonitor != null) {
+ if (this.progressMonitor.isCanceled())
+ throw new OperationCanceledException();
+ this.progressMonitor.beginTask(Messages.element_reconciling, 2);
+ }
- workingCopy.makeConsistent(this.progressMonitor);
- deltaBuilder.buildDeltas();
+ RubyScript workingCopy = getWorkingCopy();
+ boolean wasConsistent = workingCopy.isConsistent();
+ IProblemRequestor problemRequestor = workingCopy.getPerWorkingCopyInfo();
- if (progressMonitor != null) progressMonitor.worked(2);
+ // create the delta builder (this remembers the current content of the
+ // cu)
+ this.deltaBuilder = new RubyElementDeltaBuilder(workingCopy);
- // register the deltas
- RubyElementDelta delta = deltaBuilder.delta;
- if (delta != null) {
- delta.changedAST(this.ast);
- addReconcileDelta(workingCopy, delta);
- }
- } else {
- // force problem detection? - if structure was consistent
- if (forceProblemDetection) {
- IProblemRequestor problemRequestor = workingCopy.getPerWorkingCopyInfo();
- boolean computeProblems = RubyProject.hasRubyNature(workingCopy
- .getRubyProject().getProject())
- && problemRequestor != null && problemRequestor.isActive();
- if (computeProblems) {
+ // make working copy consistent if needed and compute AST if needed
+ makeConsistent(workingCopy, problemRequestor);
- char[] contents = workingCopy.getContents();
- problemRequestor.beginReporting();
- RubyScriptProblemFinder.process(workingCopy, contents, problemRequestor,
- progressMonitor);
- problemRequestor.endReporting();
- if (progressMonitor != null) progressMonitor.worked(1);
- // TODO Create AST?
- }
- }
- }
- } finally {
- if (progressMonitor != null) progressMonitor.done();
- }
- }
+ // notify reconcile participants
+ notifyParticipants(workingCopy);
- /**
- * Returns the working copy this operation is working on.
- */
- protected RubyScript getWorkingCopy() {
- return (RubyScript) getElementToProcess();
- }
+ // recreate ast if needed
+ if (this.ast == null)
+ makeConsistent(workingCopy, problemRequestor);
- /**
- * @see RubyModelOperation#isReadOnly
- */
- public boolean isReadOnly() {
- return true;
- }
+ // report problems
+ if (this.problems != null && (this.forceProblemDetection || !wasConsistent)) {
+ try {
+ problemRequestor.beginReporting();
+ for (Iterator iteraror = this.problems.values().iterator(); iteraror.hasNext();) {
+ CategorizedProblem[] categorizedProblems = (CategorizedProblem[]) iteraror.next();
+ if (categorizedProblems == null)
+ continue;
+ for (int i = 0, length = categorizedProblems.length; i < length; i++) {
+ CategorizedProblem problem = categorizedProblems[i];
+ if (RubyModelManager.VERBOSE) {
+ System.out.println("PROBLEM FOUND while reconciling : " + problem.getMessage());//$NON-NLS-1$
+ }
+ if (this.progressMonitor != null && this.progressMonitor.isCanceled())
+ break;
+ problemRequestor.acceptProblem(problem);
+ }
+ }
+ } finally {
+ problemRequestor.endReporting();
+ }
+ }
- protected IRubyModelStatus verify() {
- IRubyModelStatus status = super.verify();
- if (!status.isOK()) { return status; }
- RubyScript workingCopy = getWorkingCopy();
- if (!workingCopy.isWorkingCopy()) { return new RubyModelStatus(
- IRubyModelStatusConstants.ELEMENT_DOES_NOT_EXIST, workingCopy); // was
- // destroyed
- }
- return status;
- }
+ // report delta
+ try {
+ RubyElementDelta delta = this.deltaBuilder.delta;
+ if (delta != null) {
+ addReconcileDelta(workingCopy, delta);
+ }
+ } finally {
+ if (this.progressMonitor != null)
+ this.progressMonitor.done();
+ }
+ }
+ /*
+ * Makes the given working copy consistent, computes the delta and computes
+ * an AST if needed. Returns the AST.
+ */
+ public RootNode makeConsistent(RubyScript workingCopy, IProblemRequestor problemRequestor) throws RubyModelException {
+ if (!workingCopy.isConsistent()) {
+ // make working copy consistent
+ if (this.problems == null)
+ this.problems = new HashMap();
+ this.ast = workingCopy.makeConsistent(true, this.problems, this.progressMonitor);
+ this.deltaBuilder.buildDeltas();
+ // if (this.ast != null && this.deltaBuilder.delta != null)
+ // this.deltaBuilder.delta.changedAST(this.ast);
+ return this.ast;
+ }
+ if (this.ast != null)
+ return this.ast; // no need to recompute AST if known already
+ if (this.forceProblemDetection) {
+ if (RubyProject.hasRubyNature(workingCopy.getRubyProject().getProject())) {
+ HashMap problemMap;
+ if (this.problems == null) {
+ problemMap = new HashMap();
+ if (this.forceProblemDetection)
+ this.problems = problemMap;
+ } else
+ problemMap = this.problems;
+ // find problems
+ char[] contents = workingCopy.getContents();
+ RubyScriptProblemFinder.process(workingCopy, contents, problemMap, this.progressMonitor);
+ if (this.progressMonitor != null)
+ this.progressMonitor.worked(1);
+
+ } // else working copy not in a Ruby project
+ return this.ast;
+ }
+ return null;
+ }
+
+ /**
+ * Returns the working copy this operation is working on.
+ */
+ protected RubyScript getWorkingCopy() {
+ return (RubyScript) getElementToProcess();
+ }
+
+ /**
+ * @see RubyModelOperation#isReadOnly
+ */
+ public boolean isReadOnly() {
+ return true;
+ }
+
+ protected IRubyModelStatus verify() {
+ IRubyModelStatus status = super.verify();
+ if (!status.isOK()) {
+ return status;
+ }
+ RubyScript workingCopy = getWorkingCopy();
+ if (!workingCopy.isWorkingCopy()) {
+ return new RubyModelStatus(IRubyModelStatusConstants.ELEMENT_DOES_NOT_EXIST, workingCopy); // was
+ // destroyed
+ }
+ return status;
+ }
+
+ private void notifyParticipants(final RubyScript workingCopy) {
+ IRubyProject rubyProject = getWorkingCopy().getRubyProject();
+ CompilationParticipant[] participants = RubyModelManager.getRubyModelManager().compilationParticipants.getCompilationParticipants(rubyProject);
+ if (participants == null)
+ return;
+
+ final ReconcileContext context = new ReconcileContext(this, workingCopy);
+ for (int i = 0, length = participants.length; i < length; i++) {
+ final CompilationParticipant participant = participants[i];
+ SafeRunner.run(new ISafeRunnable() {
+ public void handleException(Throwable exception) {
+ if (exception instanceof Error) {
+ throw (Error) exception; // errors are not supposed
+ // to be caught
+ } else if (exception instanceof OperationCanceledException)
+ throw (OperationCanceledException) exception;
+ else if (exception instanceof UnsupportedOperationException) {
+ // might want to disable participant as it tried to
+ // modify the buffer of the working copy being
+ // reconciled
+ Util.log(exception, "Reconcile participant attempted to modify the buffer of the working copy being reconciled"); //$NON-NLS-1$
+ } else
+ Util.log(exception, "Exception occurred in reconcile participant"); //$NON-NLS-1$
+ }
+
+ public void run() throws Exception {
+ participant.reconcile(context);
+ }
+ });
+ }
+ }
+
}
\ No newline at end of file
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyElementDeltaBuilder.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyElementDeltaBuilder.java 2007-03-22 15:59:32 UTC (rev 2210)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyElementDeltaBuilder.java 2007-03-22 19:28:46 UTC (rev 2211)
@@ -60,7 +60,7 @@
/**
* Change delta
*/
- RubyElementDelta delta;
+ public RubyElementDelta delta;
/**
* List of added elements
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-03-22 15:59:32 UTC (rev 2210)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelManager.java 2007-03-22 19:28:46 UTC (rev 2211)
@@ -45,6 +45,7 @@
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Path;
@@ -53,6 +54,7 @@
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.content.IContentTypeManager.ContentTypeChangeEvent;
import org.eclipse.core.runtime.content.IContentTypeManager.IContentTypeChangeListener;
@@ -77,6 +79,7 @@
import org.rubypeople.rdt.core.RubyCore;
import org.rubypeople.rdt.core.RubyModelException;
import org.rubypeople.rdt.core.WorkingCopyOwner;
+import org.rubypeople.rdt.core.compiler.CompilationParticipant;
import org.rubypeople.rdt.core.compiler.IProblem;
import org.rubypeople.rdt.internal.compiler.util.HashtableOfObjectToInt;
import org.rubypeople.rdt.internal.core.buffer.BufferManager;
@@ -197,7 +200,7 @@
public final IEclipsePreferences[] preferencesLookup = new IEclipsePreferences[2];
private WeakHashSet stringSymbols = new WeakHashSet(5);
- static final int PREF_INSTANCE = 0;
+ static final int PREF_INSTANCE = 0;
static final int PREF_DEFAULT = 1;
public static final IRubyScript[] NO_WORKING_COPY = new IRubyScript[0];
@@ -223,6 +226,137 @@
public static boolean PERF_VARIABLE_INITIALIZER = false;
public static boolean PERF_CONTAINER_INITIALIZER = false;
+
+ private static final Object[] NO_PARTICIPANTS = new Object[0];
+ /**
+ * Name of the extension point for contributing a compilation participant
+ */
+ public static final String COMPILATION_PARTICIPANT_EXTPOINT_ID = "compilationParticipant" ; //$NON-NLS-1$
+
+
+ public class CompilationParticipants {
+
+ private Object[] registeredParticipants = null;
+ private HashSet managedMarkerTypes;
+
+ public CompilationParticipant[] getCompilationParticipants(IRubyProject project) {
+ final Object[] participants = getRegisteredParticipants();
+ if (participants == NO_PARTICIPANTS)
+ return null;
+
+ int length = participants.length;
+ CompilationParticipant[] result = new CompilationParticipant[length];
+ int index = 0;
+ for (int i = 0; i < length; i++) {
+ if (participants[i] instanceof IConfigurationElement) {
+ final IConfigurationElement configElement = (IConfigurationElement) participants[i];
+ final int participantIndex = i;
+ SafeRunner.run(new ISafeRunnable() {
+ public void handleException(Throwable exception) {
+ Util.log(exception, "Exception occurred while creating compilation participant"); //$NON-NLS-1$
+ }
+ public void run() throws Exception {
+ Object executableExtension = configElement.createExecutableExtension("class"); //$NON-NLS-1$
+ participants[participantIndex] = executableExtension;
+ }
+ });
+ }
+ CompilationParticipant participant = (CompilationParticipant) participants[i];
+ if (participant != null && participant.isActive(project))
+ result[index++] = participant;
+ }
+ if (index == 0)
+ return null;
+ if (index < length)
+ System.arraycopy(result, 0, result = new CompilationParticipant[index], 0, index);
+ return result;
+ }
+
+ public HashSet managedMarkerTypes() {
+ if (this.managedMarkerTypes == null) {
+ // force extension points to be read
+ getRegisteredParticipants();
+ }
+ return this.managedMarkerTypes;
+ }
+
+ private synchronized Object[] getRegisteredParticipants() {
+ if (this.registeredParticipants != null) {
+ return this.registeredParticipants;
+ }
+ this.managedMarkerTypes = new HashSet();
+ IExtensionPoint extension = Platform.getExtensionRegistry().getExtensionPoint(RubyCore.PLUGIN_ID, COMPILATION_PARTICIPANT_EXTPOINT_ID);
+ if (extension == null)
+ return this.registeredParticipants = NO_PARTICIPANTS;
+ final ArrayList modifyingEnv = new ArrayList();
+ final ArrayList creatingProblems = new ArrayList();
+ final ArrayList others = new ArrayList();
+ IExtension[] extensions = extension.getExtensions();
+ // for all extensions of this point...
+ for(int i = 0; i < extensions.length; i++) {
+ IConfigurationElement[] configElements = extensions[i].getConfigurationElements();
+ // for all config elements named "compilationParticipant"
+ for(int j = 0; j < configElements.length; j++) {
+ final IConfigurationElement configElement = configElements[j];
+ String elementName =configElement.getName();
+ if (!("compilationParticipant".equals(elementName))) { //$NON-NLS-1$
+ continue;
+ }
+ // add config element in the group it belongs to
+ if ("true".equals(configElement.getAttribute("modifiesEnvironment"))) //$NON-NLS-1$ //$NON-NLS-2$
+ modifyingEnv.add(configElement);
+ else if ("true".equals(configElement.getAttribute("createsProblems"))) //$NON-NLS-1$ //$NON-NLS-2$
+ creatingProblems.add(configElement);
+ else
+ others.add(configElement);
+ // add managed marker types
+ IConfigurationElement[] managedMarkers = configElement.getChildren("managedMarker"); //$NON-NLS-1$
+ for (int k = 0, length = managedMarkers.length; k < length; k++) {
+ IConfigurationElement element = managedMarkers[k];
+ String markerType = element.getAttribute("markerType"); //$NON-NLS-1$
+ if (markerType != null)
+ this.managedMarkerTypes.add(markerType);
+ }
+ }
+ }
+ int size = modifyingEnv.size() + creatingProblems.size() + others.size();
+ if (size == 0)
+ return this.registeredParticipants = NO_PARTICIPANTS;
+
+ // sort config elements in each group
+ IConfigurationElement[] configElements = new IConfigurationElement[size];
+ int index = 0;
+ index = sortParticipants(modifyingEnv, configElements, index);
+ index = sortParticipants(creatingProblems, configElements, index);
+ index = sortParticipants(others, configElements, index);
+ return this.registeredParticipants = configElements;
+ }
+
+ private int sortParticipants(ArrayList group, IConfigurationElement[] configElements, int index) {
+ int size = group.size();
+ if (size == 0) return index;
+ Object[] elements = group.toArray();
+ Util.sort(elements, new Util.Comparer() {
+ public int compare(Object a, Object b) {
+ if (a == b) return 0;
+ String id = ((IConfigurationElement) a).getAttribute("id"); //$NON-NLS-1$
+ if (id == null) return -1;
+ IConfigurationElement[] requiredElements = ((IConfigurationElement) b).getChildren("requires"); //$NON-NLS-1$
+ for (int i = 0, length = requiredElements.length; i < length; i++) {
+ IConfigurationElement required = requiredElements[i];
+ if (id.equals(required.getAttribute("id"))) //$NON-NLS-1$
+ return 1;
+ }
+ return -1;
+ }
+ });
+ for (int i = 0; i < size; i++)
+ configElements[index+i] = (IConfigurationElement) elements[i];
+ return index + size;
+ }
+ }
+
+ public final CompilationParticipants compilationParticipants = new CompilationParticipants();
/**
* Update the classpath variable cache
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScript.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScript.java 2007-03-22 15:59:32 UTC (rev 2210)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScript.java 2007-03-22 19:28:46 UTC (rev 2211)
@@ -26,6 +26,8 @@
import java.io.CharArrayReader;
import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
import java.util.Map;
import org.eclipse.core.resources.IContainer;
@@ -36,6 +38,7 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.jruby.ast.Node;
+import org.jruby.ast.RootNode;
import org.jruby.lexer.yacc.SyntaxException;
import org.rubypeople.rdt.core.CompletionRequestor;
import org.rubypeople.rdt.core.IBuffer;
@@ -55,6 +58,7 @@
import org.rubypeople.rdt.core.RubyCore;
import org.rubypeople.rdt.core.RubyModelException;
import org.rubypeople.rdt.core.WorkingCopyOwner;
+import org.rubypeople.rdt.core.compiler.CategorizedProblem;
import org.rubypeople.rdt.internal.codeassist.CompletionEngine;
import org.rubypeople.rdt.internal.core.buffer.BufferManager;
import org.rubypeople.rdt.internal.core.parser.RubyParser;
@@ -112,13 +116,25 @@
RubyModelManager.PerWorkingCopyInfo perWorkingCopyInfo = getPerWorkingCopyInfo();
IRubyProject project = getRubyProject();
+
+ boolean createAST;
+ HashMap problems;
+ if (info instanceof ASTHolderCUInfo) {
+ ASTHolderCUInfo astHolder = (ASTHolderCUInfo) info;
+ createAST = true;
+ problems = astHolder.problems;
+ } else {
+ createAST = false;
+ problems = null;
+ }
boolean computeProblems = RubyProject.hasRubyNature(project.getProject()) && perWorkingCopyInfo != null && perWorkingCopyInfo.isActive();
+ Node ast = null;
try {
RubyParser parser = new RubyParser();
- Node node = parser.parse((IFile) getResource(), new CharArrayReader(contents));
+ ast = parser.parse((IFile) getResource(), new CharArrayReader(contents));
RubyScriptStructureBuilder visitor = new RubyScriptStructureBuilder(this, unitInfo, newElements);
- if (node != null) node.accept(visitor);
+ if (ast != null) ast.accept(visitor);
unitInfo.setIsStructureKnown(true);
} catch (SyntaxException e) {
unitInfo.setIsStructureKnown(false);
@@ -137,9 +153,32 @@
// compute other problems if needed
if (computeProblems) {
perWorkingCopyInfo.beginReporting();
- RubyScriptProblemFinder.process(this, contents, perWorkingCopyInfo, pm);
+ RubyScriptProblemFinder.process(this, contents, problems, pm);
+ if (problems == null) {
+ // report problems to the problem requestor
+ problems = new HashMap();
+ RubyScriptProblemFinder.process(this, contents, problems, pm);
+ try {
+ perWorkingCopyInfo.beginReporting();
+ for (Iterator iteraror = problems.values().iterator(); iteraror.hasNext();) {
+ CategorizedProblem[] categorizedProblems = (CategorizedProblem[]) iteraror.next();
+ if (categorizedProblems == null) continue;
+ for (int i = 0, length = categorizedProblems.length; i < length; i++) {
+ perWorkingCopyInfo.acceptProblem(categorizedProblems[i]);
+ }
+ }
+ } finally {
+ perWorkingCopyInfo.endReporting();
+ }
+ } else {
+ // collect problems
+ RubyScriptProblemFinder.process(this, contents, problems, pm);
+ }
perWorkingCopyInfo.endReporting();
}
+ if (createAST) {
+ ((ASTHolderCUInfo) info).ast = (RootNode) ast;
+ }
return unitInfo.isStructureKnown();
}
@@ -529,25 +568,22 @@
* @see IOpenable#makeConsistent(IProgressMonitor)
*/
public void makeConsistent(IProgressMonitor monitor) throws RubyModelException {
- makeConsistent(false, monitor);
+ makeConsistent(false, null, monitor);
}
- public RubyScript makeConsistent(boolean createAST, IProgressMonitor monitor) throws RubyModelException {
+ public RootNode makeConsistent(boolean createAST, HashMap problems, IProgressMonitor monitor) throws RubyModelException {
if (isConsistent()) return null;
- // create a new info and make it the current info
- // (this will remove the info and its children just before storing the new infos)
- // TODO When createAST is specified, actually do it!
-// if (createAST) {
-// ASTHolderCUInfo info = new ASTHolderCUInfo();
-// openWhenClosed(info, monitor);
-// RubyScript result = info.ast;
-// info.ast = null;
-// return result;
-// } else {
- openWhenClosed(createElementInfo(), monitor);
- return null;
-// }
+ if (createAST) {
+ ASTHolderCUInfo info = new ASTHolderCUInfo();
+ info.problems = problems;
+ openWhenClosed(info, monitor);
+ RootNode result = info.ast;
+ info.ast = null;
+ return result;
+ }
+ openWhenClosed(createElementInfo(), monitor);
+ return null;
}
/*
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptProblemFinder.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptProblemFinder.java 2007-03-22 15:59:32 UTC (rev 2210)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptProblemFinder.java 2007-03-22 19:28:46 UTC (rev 2211)
@@ -4,8 +4,7 @@
package org.rubypeople.rdt.internal.core;
import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.Iterator;
+import java.util.HashMap;
import java.util.List;
import org.eclipse.core.resources.IFile;
@@ -14,8 +13,8 @@
import org.jruby.ast.visitor.NodeVisitor;
import org.jruby.lexer.yacc.SyntaxException;
import org.rubypeople.rdt.core.IProblemRequestor;
+import org.rubypeople.rdt.core.IRubyModelMarker;
import org.rubypeople.rdt.core.RubyModelException;
-import org.rubypeople.rdt.core.compiler.IProblem;
import org.rubypeople.rdt.internal.core.parser.RdtWarnings;
import org.rubypeople.rdt.internal.core.parser.RubyParser;
import org.rubypeople.rdt.internal.core.parser.TaskParser;
@@ -29,24 +28,18 @@
public class RubyScriptProblemFinder {
// DSC convert to ImmediateWarnings
- public static void process(RubyScript script, char[] charContents,
- IProblemRequestor problemRequestor, IProgressMonitor pm) {
+ public static void process(RubyScript script, char[] charContents, HashMap problems, IProgressMonitor pm) {
RdtWarnings warnings = new RdtWarnings();
RubyParser parser = new RubyParser(warnings);
String contents = new String(charContents);
- runLint(script, problemRequestor, parser, contents);
+// runLint(script, problemRequestor, parser, contents); FIXME Make all these compilationParticipants
TaskParser taskParser = new TaskParser(script.getRubyProject().getOptions(true));
taskParser.parse(contents);
- List problems = new ArrayList();
- problems.addAll(warnings.getWarnings());
- problems.addAll(taskParser.getTasks());
- for (Iterator iter = problems.iterator(); iter.hasNext();) {
- IProblem problem = (IProblem) iter.next();
- problemRequestor.acceptProblem(problem);
- }
+ problems.put(IRubyModelMarker.RUBY_MODEL_PROBLEM_MARKER, warnings.getWarnings());
+ problems.put(IRubyModelMarker.TASK_MARKER, taskParser.getTasks());
}
private static void runLint(RubyScript script, IProblemRequestor problemRequestor, RubyParser parser, String contents) {
@@ -64,5 +57,4 @@
e.printStackTrace();
}
}
-
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-03-22 15:59:34
|
Revision: 2210
http://svn.sourceforge.net/rubyeclipse/?rev=2210&view=rev
Author: cawilliams
Date: 2007-03-22 08:59:32 -0700 (Thu, 22 Mar 2007)
Log Message:
-----------
add test and fix for comments who get "discolored" at end. Lines with just spaces in them tend to mess up comment positions before. This should fix the problem...
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyTokenScanner.java
trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/ruby/TC_RubyTokenScanner.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyTokenScanner.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyTokenScanner.java 2007-03-22 15:32:20 UTC (rev 2209)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyTokenScanner.java 2007-03-22 15:59:32 UTC (rev 2210)
@@ -110,8 +110,13 @@
List comments = result.getCommentNodes();
if (comments != null && !comments.isEmpty()) {
CommentNode comment;
+ boolean firstComment = true;
while (!comments.isEmpty()) {
comment = (CommentNode) comments.remove(0);
+ if (firstComment) {
+ firstComment = false;
+ oldOffset = origOffset + comment.getPosition().getStartOffset(); // correct start offset, since when a line with nothing but spaces on it appears before comment, we get messed up positions
+ }
tokenLength += comment.getContent().length() + 1;
}
fSavedToken = returnValue;
Modified: trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/ruby/TC_RubyTokenScanner.java
===================================================================
--- trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/ruby/TC_RubyTokenScanner.java 2007-03-22 15:32:20 UTC (rev 2209)
+++ trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/ruby/TC_RubyTokenScanner.java 2007-03-22 15:59:32 UTC (rev 2210)
@@ -61,7 +61,7 @@
assertToken(IRubyColorConstants.RUBY_DEFAULT, 5, 6);
assertToken(IRubyColorConstants.RUBY_DEFAULT, 11, 1);
assertToken(IRubyColorConstants.RUBY_KEYWORD, 12, 3);
- assertToken(IRubyColorConstants.RUBY_SINGLE_LINE_COMMENT, 15, 10);
+ assertToken(IRubyColorConstants.RUBY_SINGLE_LINE_COMMENT, 16, 10);
}
public void testCommentAfterEndWhileEditing() {
@@ -76,7 +76,7 @@
"end";
setUpScanner(code, 75, 14);
assertToken(IRubyColorConstants.RUBY_KEYWORD, 75, 5);
- assertToken(IRubyColorConstants.RUBY_SINGLE_LINE_COMMENT, 80, 7);
+ assertToken(IRubyColorConstants.RUBY_SINGLE_LINE_COMMENT, 82, 7);
}
public void testCommentAtEndOfLineWithStringAtBeginning() {
@@ -97,7 +97,19 @@
assertToken(IRubyColorConstants.RUBY_DEFAULT, 19, 3);
assertToken(IRubyColorConstants.RUBY_DEFAULT, 22, 2);
- assertToken(IRubyColorConstants.RUBY_SINGLE_LINE_COMMENT, 24, 10);
+ assertToken(IRubyColorConstants.RUBY_SINGLE_LINE_COMMENT, 25, 10);
}
+ public void testLinesWithJustSpaceBeforeComment() {
+ String code = " \n" +
+ " # comment\n" +
+ " def method\n" +
+ " \n" +
+ " end";
+ setUpScanner(code);
+ assertToken(IRubyColorConstants.RUBY_SINGLE_LINE_COMMENT, 5, 10); // '# comment'
+ assertToken(IRubyColorConstants.RUBY_KEYWORD, 15, 5); // ' def'
+ assertToken(IRubyColorConstants.RUBY_DEFAULT, 20, 7); // ' method'
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-03-22 15:32:22
|
Revision: 2209
http://svn.sourceforge.net/rubyeclipse/?rev=2209&view=rev
Author: cawilliams
Date: 2007-03-22 08:32:20 -0700 (Thu, 22 Mar 2007)
Log Message:
-----------
ugly hacks to make closer parents in inheritance hierarchy more relevant for method suggestions. Aslo when sorting proposals, sort by relevance, then by name.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionProposalComparator.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-03-22 15:06:49 UTC (rev 2208)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-03-22 15:32:20 UTC (rev 2209)
@@ -180,8 +180,8 @@
proposals.put(proposal.getName(), proposal); // If a method name matches an existing suggestion (i.e. its overriden in the subclass), don't suggest it again!
}
}
- proposals.putAll(addModuleMethods(confidence, type));
- if (!type.isModule()) proposals.putAll(addSuperClassMethods(confidence, type));
+ proposals.putAll(addModuleMethods(confidence - 1, type)); // Decrement confidence by one as a hack to make sure as we move up the inheritance chain we suggest "closer" parents methods first
+ if (!type.isModule()) proposals.putAll(addSuperClassMethods(confidence - 1, type));
return proposals;
}
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionProposalComparator.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionProposalComparator.java 2007-03-22 15:06:49 UTC (rev 2208)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionProposalComparator.java 2007-03-22 15:32:20 UTC (rev 2209)
@@ -7,7 +7,10 @@
public class CompletionProposalComparator implements Comparator<CompletionProposal> {
public int compare(CompletionProposal o1, CompletionProposal o2) {
- return o1.getName().compareTo(o2.getName());
+ if (o1.getRelevance() == o2.getRelevance())
+ return o1.getName().compareTo(o2.getName());
+ else
+ return o2.getRelevance() - o1.getRelevance();
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-03-22 15:06:51
|
Revision: 2208
http://svn.sourceforge.net/rubyeclipse/?rev=2208&view=rev
Author: cawilliams
Date: 2007-03-22 08:06:49 -0700 (Thu, 22 Mar 2007)
Log Message:
-----------
handle case where user selects the bin directory where ruby executable resides (which is a common case)
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/AddVMDialog.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/AddVMDialog.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/AddVMDialog.java 2007-03-22 13:58:39 UTC (rev 2207)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/AddVMDialog.java 2007-03-22 15:06:49 UTC (rev 2208)
@@ -111,13 +111,7 @@
if (segs == 1) {
genName = path.segment(0);
} else if (segs >= 2) {
- String last = path.lastSegment();
- // FIXME What is this reference to a jre directory?
- if ("jre".equalsIgnoreCase(last)) { //$NON-NLS-1$
- genName = path.segment(segs - 2);
- } else {
- genName = last;
- }
+ genName = path.lastSegment();
}
if (genName != null) {
fVMName.setText(genName);
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java 2007-03-22 13:58:39 UTC (rev 2207)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java 2007-03-22 15:06:49 UTC (rev 2208)
@@ -42,7 +42,7 @@
* VM install locations, relative to the VM install location.
*/
private static final String[] fgCandidateRubyFiles = {"rubyw", "rubyw.exe", "ruby", "ruby.exe"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- private static final String[] fgCandidateRubyLocations = {"bin" + fgSeparator}; //$NON-NLS-1$
+ private static final String[] fgCandidateRubyLocations = {"", "bin" + fgSeparator}; //$NON-NLS-1$ //$NON-NLS-2$
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-03-22 13:58:42
|
Revision: 2207
http://svn.sourceforge.net/rubyeclipse/?rev=2207&view=rev
Author: cawilliams
Date: 2007-03-22 06:58:39 -0700 (Thu, 22 Mar 2007)
Log Message:
-----------
add test for bug found by murphee (for lines that start with strings and end with a comment), and implement the fix.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyTokenScanner.java
trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/ruby/TC_RubyTokenScanner.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyTokenScanner.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyTokenScanner.java 2007-03-22 12:48:47 UTC (rev 2206)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyTokenScanner.java 2007-03-22 13:58:39 UTC (rev 2207)
@@ -147,6 +147,8 @@
@Override
public Token getToken(String key) {
+ if (key.equals(IRubyColorConstants.RUBY_SINGLE_LINE_COMMENT)) // if we know it's a comment, force it!
+ return super.getToken(key);
if (isInSymbol)
return super.getToken(IRubyColorConstants.RUBY_SYMBOL);
if (isInRegexp)
Modified: trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/ruby/TC_RubyTokenScanner.java
===================================================================
--- trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/ruby/TC_RubyTokenScanner.java 2007-03-22 12:48:47 UTC (rev 2206)
+++ trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/ruby/TC_RubyTokenScanner.java 2007-03-22 13:58:39 UTC (rev 2207)
@@ -79,4 +79,25 @@
assertToken(IRubyColorConstants.RUBY_SINGLE_LINE_COMMENT, 80, 7);
}
+ public void testCommentAtEndOfLineWithStringAtBeginning() {
+ String code = "hash = {\n" +
+ " \"string\" => { # comment\n" +
+ " 123\n" +
+ " }\n" +
+ "}";
+ setUpScanner(code);
+ assertToken(IRubyColorConstants.RUBY_DEFAULT, 0, 4); // 'hash'
+ assertToken(IRubyColorConstants.RUBY_DEFAULT, 4, 2); // ' ='
+ assertToken(IRubyColorConstants.RUBY_DEFAULT, 6, 2); // ' {'
+ assertToken(IRubyColorConstants.RUBY_DEFAULT, 8, 4); // whitespace
+
+ assertToken(IRubyColorConstants.RUBY_STRING, 12, 6);
+ assertToken(IRubyColorConstants.RUBY_STRING, 18, 1);
+
+ assertToken(IRubyColorConstants.RUBY_DEFAULT, 19, 3);
+ assertToken(IRubyColorConstants.RUBY_DEFAULT, 22, 2);
+
+ assertToken(IRubyColorConstants.RUBY_SINGLE_LINE_COMMENT, 24, 10);
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-03-22 12:48:49
|
Revision: 2206
http://svn.sourceforge.net/rubyeclipse/?rev=2206&view=rev
Author: cawilliams
Date: 2007-03-22 05:48:47 -0700 (Thu, 22 Mar 2007)
Log Message:
-----------
Apply Martin Krauskopf's patch:
"I've fixed bug which seems to cause Classic Debugger to fails on Windows
(but would be strange if nobody did not encounter it so far) and under
particular situation on Linux as well. It was committed into
debug-commons project. Here is the quick fix against RDT trunk
(attached).
Particularly, problem shows up when there were more than one semicolons
in breakpoint command like:
b c:/path/.../script:3 # Windows
b /path/path spaces semi:colon.rb:3 # odd edge case on Linux/Unix like,
but possible"
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/ruby/classic-debug.rb
Modified: trunk/org.rubypeople.rdt.launching/ruby/classic-debug.rb
===================================================================
--- trunk/org.rubypeople.rdt.launching/ruby/classic-debug.rb 2007-03-22 09:12:10 UTC (rev 2205)
+++ trunk/org.rubypeople.rdt.launching/ruby/classic-debug.rb 2007-03-22 12:48:47 UTC (rev 2206)
@@ -141,6 +141,9 @@
class DEBUGGER__
+ # type: 0 - breakpoint, 1 - watchpoint
+ Breakpoint = Struct.new("Breakpoint", :valid, :type, :file, :pos)
+
class CommandLinePrinter
def printXml(s)
# print XML only
@@ -547,13 +550,9 @@
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)
+ when /^\s*b(?:reak)?\s+(?:(.+):)?([^.:]+)$/
+ pos = $2
+ file = File.basename($1)
if pos =~ /^\d+$/
pname = pos
pos = pos.to_i
@@ -561,7 +560,7 @@
pname = pos = pos.intern.id2name
end
# TODO: pname is not used
- break_points.push [true, 0, file, pos]
+ break_points.push Breakpoint.new(true, 0, file, pos)
@printer.printXml("<breakpointAdded no=\"%d\" location=\"%s:%s\"/>", break_points.size, file, pos)
when /^\s*delete\s+(\d+)$/
@@ -796,13 +795,14 @@
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.debug("file=%s, pos=%s; breakpoint=[valid=%s, type=%s, file=%s, pos=%s]\n ",
+ file, pos, b.valid, b.type, b.file, b.pos)
+ if b.valid
+ if b.type == 0 and b.file == file and b.pos == pos # breakpoint
@printer.printBreakpoint(n, debug_funcname(id), file, pos)
return true
- elsif b[1] == 1 # watchpoint
- if debug_silent_eval(b[2], binding)
+ elsif b.type == 1 # watchpoint
+ if debug_silent_eval(b.file, binding)
stdout.printf "Watchpoint %d, %s at %s:%s\n", n, debug_funcname(id), file, pos
return true
end
@@ -898,8 +898,6 @@
@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 = []
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mir...@us...> - 2007-03-22 09:12:12
|
Revision: 2205
http://svn.sourceforge.net/rubyeclipse/?rev=2205&view=rev
Author: mirkostocker
Date: 2007-03-22 02:12:10 -0700 (Thu, 22 Mar 2007)
Log Message:
-----------
rename "temp" to "local" in the tests.. this should be the last one.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/TS_All.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/LocalToFieldTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/TS_LocalToField.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/LocalToFieldConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TS_LocalToFieldChecks.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/LocalInlinerTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/TS_InlineLocal.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/InlineLocalConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/TS_InlineLocalConditionChecks.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocal/TS_RenameLocal.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splitlocal/SplitLocalTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splitlocal/TS_SplitLocal.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splitlocal/conditionchecks/SplitLocalConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splitlocal/conditionchecks/TS_SplitLocalChecks.java
Removed Paths:
-------------
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splittemp/
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/TS_TempToField.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/TempToFieldTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TS_TempToFieldChecks.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TempToFieldConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/converttemptofield/
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/formatsource/conditionchecks/
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/TS_InlineTemp.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/TempInlinerTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/InlineTempConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/TS_InlineTempConditionChecks.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinetemp/
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocal/TS_RenameLocalVariable.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocalvariable/
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splitlocal/SplitTempTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splitlocal/TS_SplitTemp.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splitlocal/conditionchecks/SplitTempConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splitlocal/conditionchecks/TS_SplitTempChecks.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splittemp/
Modified: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/TS_All.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/TS_All.java 2007-03-21 21:44:55 UTC (rev 2204)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/TS_All.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -33,14 +33,14 @@
import org.rubypeople.rdt.refactoring.tests.classnodeprovider.TS_ClassNodeProvider;
import org.rubypeople.rdt.refactoring.tests.core.TS_Core;
-import org.rubypeople.rdt.refactoring.tests.core.convertlocaltofield.TS_TempToField;
+import org.rubypeople.rdt.refactoring.tests.core.convertlocaltofield.TS_LocalToField;
import org.rubypeople.rdt.refactoring.tests.core.encapsulatefield.TS_EncapsulateField;
import org.rubypeople.rdt.refactoring.tests.core.extractmethod.TS_ExtractMethod;
import org.rubypeople.rdt.refactoring.tests.core.formatsource.TS_FormatSource;
import org.rubypeople.rdt.refactoring.tests.core.generateaccessors.TS_GenerateAccessors;
import org.rubypeople.rdt.refactoring.tests.core.generateconstructor.TS_GenerateConstructor;
import org.rubypeople.rdt.refactoring.tests.core.inlineclass.TS_InlineClass;
-import org.rubypeople.rdt.refactoring.tests.core.inlinelocal.TS_InlineTemp;
+import org.rubypeople.rdt.refactoring.tests.core.inlinelocal.TS_InlineLocal;
import org.rubypeople.rdt.refactoring.tests.core.inlinemethod.TS_InlineMethod;
import org.rubypeople.rdt.refactoring.tests.core.mergeclasspartsinfile.TS_MergeClassPartsInFile;
import org.rubypeople.rdt.refactoring.tests.core.mergewithexternalclassparts.TS_MergeWithExternalClassParts;
@@ -52,9 +52,9 @@
import org.rubypeople.rdt.refactoring.tests.core.rename.TS_Rename;
import org.rubypeople.rdt.refactoring.tests.core.renameclass.TS_RenameClass;
import org.rubypeople.rdt.refactoring.tests.core.renamefield.TS_RenameField;
-import org.rubypeople.rdt.refactoring.tests.core.renamelocal.TS_RenameLocalVariable;
+import org.rubypeople.rdt.refactoring.tests.core.renamelocal.TS_RenameLocal;
import org.rubypeople.rdt.refactoring.tests.core.renamemethod.TS_RenameMethod;
-import org.rubypeople.rdt.refactoring.tests.core.splitlocal.TS_SplitTemp;
+import org.rubypeople.rdt.refactoring.tests.core.splitlocal.TS_SplitLocal;
import org.rubypeople.rdt.refactoring.tests.util.TS_Util;
public class TS_All
@@ -67,17 +67,17 @@
suite.addTest(TS_GenerateConstructor.suite());
suite.addTest(TS_OverrideMethod.suite());
suite.addTest(TS_PushDown.suite());
- suite.addTest(TS_RenameLocalVariable.suite());
+ suite.addTest(TS_RenameLocal.suite());
suite.addTest(TS_Util.suite());
suite.addTest(TS_ClassNodeProvider.suite());
suite.addTest(TS_FormatSource.suite());
- suite.addTest(TS_TempToField.suite());
+ suite.addTest(TS_LocalToField.suite());
suite.addTest(TS_Core.suite());
suite.addTest(TS_ExtractMethod.suite());
suite.addTest(TS_MergeWithExternalClassParts.suite());
suite.addTest(TS_MergeClassPartsInFile.suite());
- suite.addTest(TS_InlineTemp.suite());
- suite.addTest(TS_SplitTemp.suite());
+ suite.addTest(TS_InlineLocal.suite());
+ suite.addTest(TS_SplitLocal.suite());
suite.addTest(TS_EncapsulateField.suite());
suite.addTest(TS_InlineMethod.suite());
suite.addTest(TS_RenameField.suite());
Copied: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/LocalToFieldTester.java (from rev 2204, trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/TempToFieldTester.java)
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/LocalToFieldTester.java (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/LocalToFieldTester.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -0,0 +1,94 @@
+/***** 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.tests.core.convertlocaltofield;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.rubypeople.rdt.refactoring.core.convertlocaltofield.LocalToFieldConditionChecker;
+import org.rubypeople.rdt.refactoring.core.convertlocaltofield.LocalToFieldConfig;
+import org.rubypeople.rdt.refactoring.core.convertlocaltofield.LocalToFieldConverter;
+import org.rubypeople.rdt.refactoring.tests.FilePropertyData;
+import org.rubypeople.rdt.refactoring.tests.FileTestData;
+import org.rubypeople.rdt.refactoring.tests.RefactoringTestCase;
+
+public class LocalToFieldTester extends RefactoringTestCase {
+
+ private String fileName;
+
+ public LocalToFieldTester(String fileName) {
+ this.fileName = fileName;
+ }
+
+ protected int getInitPlace(String initPlace) {
+ if (initPlace.equalsIgnoreCase("TempToFieldConverter.INIT_IN_METHOD")) {
+ return LocalToFieldConverter.INIT_IN_METHOD;
+ } else if (initPlace.equalsIgnoreCase("TempToFieldConverter.INIT_IN_CONSTRUCTOR")) {
+ return LocalToFieldConverter.INIT_IN_CONSTRUCTOR;
+ } else {
+ assertTrue(false);
+ return 0;
+ }
+
+ }
+
+ protected void runTempToFieldTest(FilePropertyData data, String sourceDocument, String expectedDocument, String newName, boolean isClassField, int initPlace,
+ int cursorPosition) throws BadLocationException {
+ LocalToFieldConfig config = new LocalToFieldConfig(data, cursorPosition);
+ LocalToFieldConditionChecker checker = new LocalToFieldConditionChecker(config);
+ if (!checker.shouldPerform()) {
+ fail();
+ }
+ LocalToFieldConverter converter = new LocalToFieldConverter(config);
+ converter.setInitPlace(initPlace);
+ converter.setIsClassField(isClassField);
+ converter.setNewName(newName);
+ createEditAndCompareResult(sourceDocument, expectedDocument, converter);
+ }
+
+ @Override
+ public void runTest() throws FileNotFoundException, IOException, BadLocationException {
+ FileTestData data = new FileTestData(fileName, getClass());
+ String source = data.getSource();
+ String expected = data.getExpectedResult();
+ String newName = data.getProperty("newName");
+ boolean isClassField = data.getBoolProperty("isClassField");
+ int initPlace = getInitPlace(data.getProperty("initPlace"));
+ int cursorPos = data.getIntProperty("cursorPosition");
+ runTempToFieldTest(data, source, expected, newName, isClassField, initPlace, cursorPos);
+ }
+
+ @Override
+ public String getName() {
+ return fileName;
+ }
+}
Copied: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/TS_LocalToField.java (from rev 2204, trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/TS_TempToField.java)
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/TS_LocalToField.java (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/TS_LocalToField.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -0,0 +1,46 @@
+/***** 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.tests.core.convertlocaltofield;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.rubypeople.rdt.refactoring.tests.FileTestSuite;
+import org.rubypeople.rdt.refactoring.tests.core.convertlocaltofield.conditionchecks.TS_LocalToFieldChecks;
+
+public class TS_LocalToField extends FileTestSuite
+{
+ public static Test suite() {
+ TestSuite suite = createSuite("TempToField", "temp_to_field_test*test_source", LocalToFieldTester.class);
+ suite.addTest(TS_LocalToFieldChecks.suite());
+ return suite;
+ }
+}
\ No newline at end of file
Deleted: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/TS_TempToField.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/TS_TempToField.java 2007-03-21 21:44:55 UTC (rev 2204)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/TS_TempToField.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -1,46 +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.tests.core.convertlocaltofield;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.rubypeople.rdt.refactoring.tests.FileTestSuite;
-import org.rubypeople.rdt.refactoring.tests.core.convertlocaltofield.conditionchecks.TS_TempToFieldChecks;
-
-public class TS_TempToField extends FileTestSuite
-{
- public static Test suite() {
- TestSuite suite = createSuite("TempToField", "temp_to_field_test*test_source", TempToFieldTester.class);
- suite.addTest(TS_TempToFieldChecks.suite());
- return suite;
- }
-}
\ No newline at end of file
Deleted: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/TempToFieldTester.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/TempToFieldTester.java 2007-03-21 21:44:55 UTC (rev 2204)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/TempToFieldTester.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -1,94 +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.tests.core.convertlocaltofield;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.rubypeople.rdt.refactoring.core.convertlocaltofield.LocalToFieldConditionChecker;
-import org.rubypeople.rdt.refactoring.core.convertlocaltofield.LocalToFieldConfig;
-import org.rubypeople.rdt.refactoring.core.convertlocaltofield.LocalToFieldConverter;
-import org.rubypeople.rdt.refactoring.tests.FilePropertyData;
-import org.rubypeople.rdt.refactoring.tests.FileTestData;
-import org.rubypeople.rdt.refactoring.tests.RefactoringTestCase;
-
-public class TempToFieldTester extends RefactoringTestCase {
-
- private String fileName;
-
- public TempToFieldTester(String fileName) {
- this.fileName = fileName;
- }
-
- protected int getInitPlace(String initPlace) {
- if (initPlace.equalsIgnoreCase("TempToFieldConverter.INIT_IN_METHOD")) {
- return LocalToFieldConverter.INIT_IN_METHOD;
- } else if (initPlace.equalsIgnoreCase("TempToFieldConverter.INIT_IN_CONSTRUCTOR")) {
- return LocalToFieldConverter.INIT_IN_CONSTRUCTOR;
- } else {
- assertTrue(false);
- return 0;
- }
-
- }
-
- protected void runTempToFieldTest(FilePropertyData data, String sourceDocument, String expectedDocument, String newName, boolean isClassField, int initPlace,
- int cursorPosition) throws BadLocationException {
- LocalToFieldConfig config = new LocalToFieldConfig(data, cursorPosition);
- LocalToFieldConditionChecker checker = new LocalToFieldConditionChecker(config);
- if (!checker.shouldPerform()) {
- fail();
- }
- LocalToFieldConverter converter = new LocalToFieldConverter(config);
- converter.setInitPlace(initPlace);
- converter.setIsClassField(isClassField);
- converter.setNewName(newName);
- createEditAndCompareResult(sourceDocument, expectedDocument, converter);
- }
-
- @Override
- public void runTest() throws FileNotFoundException, IOException, BadLocationException {
- FileTestData data = new FileTestData(fileName, getClass());
- String source = data.getSource();
- String expected = data.getExpectedResult();
- String newName = data.getProperty("newName");
- boolean isClassField = data.getBoolProperty("isClassField");
- int initPlace = getInitPlace(data.getProperty("initPlace"));
- int cursorPos = data.getIntProperty("cursorPosition");
- runTempToFieldTest(data, source, expected, newName, isClassField, initPlace, cursorPos);
- }
-
- @Override
- public String getName() {
- return fileName;
- }
-}
Copied: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/LocalToFieldConditionTester.java (from rev 2204, trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TempToFieldConditionTester.java)
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/LocalToFieldConditionTester.java (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/LocalToFieldConditionTester.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -0,0 +1,65 @@
+/***** 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.tests.core.convertlocaltofield.conditionchecks;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import org.rubypeople.rdt.refactoring.core.convertlocaltofield.LocalToFieldConditionChecker;
+import org.rubypeople.rdt.refactoring.core.convertlocaltofield.LocalToFieldConfig;
+import org.rubypeople.rdt.refactoring.core.convertlocaltofield.LocalToFieldConverter;
+import org.rubypeople.rdt.refactoring.tests.FilePropertyData;
+import org.rubypeople.rdt.refactoring.tests.FileTestData;
+import org.rubypeople.rdt.refactoring.tests.RefactoringConditionTestCase;
+
+public class LocalToFieldConditionTester extends RefactoringConditionTestCase {
+ private FilePropertyData testData;
+ private LocalToFieldConfig config;
+
+ public LocalToFieldConditionTester(String fileName) {
+ super(fileName);
+ }
+
+ @Override
+ public void runTest() throws FileNotFoundException, IOException {
+ testData = new FileTestData(getName(), ".test_source", ".test_source");
+ config = new LocalToFieldConfig(testData, testData.getIntProperty("cursorPosition"));
+ LocalToFieldConditionChecker checker = new LocalToFieldConditionChecker(config);
+ checkConditions(checker, testData);
+ }
+
+ @Override
+ protected void createEditProviderAndSetUserInput() {
+ LocalToFieldConverter converter = new LocalToFieldConverter(config);
+ converter.setIsClassField(testData.getBoolProperty("isClassField"));
+ converter.setNewName(testData.getProperty("newName"));
+ }
+}
Copied: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TS_LocalToFieldChecks.java (from rev 2204, trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TS_TempToFieldChecks.java)
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TS_LocalToFieldChecks.java (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TS_LocalToFieldChecks.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -0,0 +1,43 @@
+/***** 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.tests.core.convertlocaltofield.conditionchecks;
+
+import junit.framework.Test;
+
+import org.rubypeople.rdt.refactoring.tests.FileTestSuite;
+
+public class TS_LocalToFieldChecks extends FileTestSuite {
+
+ public static Test suite() {
+ return createSuite("ConvertTempToFieldTests", "temp_to_field_checker_test_*test_source", LocalToFieldConditionTester.class);
+ }
+
+}
Deleted: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TS_TempToFieldChecks.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TS_TempToFieldChecks.java 2007-03-21 21:44:55 UTC (rev 2204)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TS_TempToFieldChecks.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -1,43 +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.tests.core.convertlocaltofield.conditionchecks;
-
-import junit.framework.Test;
-
-import org.rubypeople.rdt.refactoring.tests.FileTestSuite;
-
-public class TS_TempToFieldChecks extends FileTestSuite {
-
- public static Test suite() {
- return createSuite("ConvertTempToFieldTests", "temp_to_field_checker_test_*test_source", TempToFieldConditionTester.class);
- }
-
-}
Deleted: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TempToFieldConditionTester.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TempToFieldConditionTester.java 2007-03-21 21:44:55 UTC (rev 2204)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TempToFieldConditionTester.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -1,65 +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.tests.core.convertlocaltofield.conditionchecks;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-
-import org.rubypeople.rdt.refactoring.core.convertlocaltofield.LocalToFieldConditionChecker;
-import org.rubypeople.rdt.refactoring.core.convertlocaltofield.LocalToFieldConfig;
-import org.rubypeople.rdt.refactoring.core.convertlocaltofield.LocalToFieldConverter;
-import org.rubypeople.rdt.refactoring.tests.FilePropertyData;
-import org.rubypeople.rdt.refactoring.tests.FileTestData;
-import org.rubypeople.rdt.refactoring.tests.RefactoringConditionTestCase;
-
-public class TempToFieldConditionTester extends RefactoringConditionTestCase {
- private FilePropertyData testData;
- private LocalToFieldConfig config;
-
- public TempToFieldConditionTester(String fileName) {
- super(fileName);
- }
-
- @Override
- public void runTest() throws FileNotFoundException, IOException {
- testData = new FileTestData(getName(), ".test_source", ".test_source");
- config = new LocalToFieldConfig(testData, testData.getIntProperty("cursorPosition"));
- LocalToFieldConditionChecker checker = new LocalToFieldConditionChecker(config);
- checkConditions(checker, testData);
- }
-
- @Override
- protected void createEditProviderAndSetUserInput() {
- LocalToFieldConverter converter = new LocalToFieldConverter(config);
- converter.setIsClassField(testData.getBoolProperty("isClassField"));
- converter.setNewName(testData.getProperty("newName"));
- }
-}
Copied: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/LocalInlinerTester.java (from rev 2204, trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/TempInlinerTester.java)
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/LocalInlinerTester.java (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/LocalInlinerTester.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -0,0 +1,77 @@
+/***** 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.tests.core.inlinelocal;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.rubypeople.rdt.refactoring.core.inlinelocal.InlineLocalConditionChecker;
+import org.rubypeople.rdt.refactoring.core.inlinelocal.InlineLocalConfig;
+import org.rubypeople.rdt.refactoring.core.inlinelocal.LocalVariableInliner;
+import org.rubypeople.rdt.refactoring.tests.FileTestData;
+import org.rubypeople.rdt.refactoring.tests.RefactoringTestCase;
+
+public class LocalInlinerTester extends RefactoringTestCase {
+
+ private String fileName;
+
+ private FileTestData testData;
+
+ public LocalInlinerTester(String fileName) {
+ this.fileName = fileName;
+ }
+
+ private void runInlineTempTest(FileTestData data) throws BadLocationException {
+
+ InlineLocalConfig config = new InlineLocalConfig(data, data.getIntProperty("caretPosition"));
+ InlineLocalConditionChecker checker = new InlineLocalConditionChecker(config);
+ if (!checker.shouldPerform()) {
+ fail();
+ }
+ LocalVariableInliner inliner = new LocalVariableInliner(config);
+ config.setReplaceTempWithQuery(data.getBoolProperty("replaceWithQuery"));
+ config.setNewMethodName(data.getProperty("newMethodName"));
+
+ createEditAndCompareResult(data.getActiveFileContent(), data.getExpectedResult(), inliner);
+ }
+
+ @Override
+ public void runTest() throws FileNotFoundException, IOException, BadLocationException {
+ testData = new FileTestData(fileName, getClass());
+ runInlineTempTest(testData);
+ }
+
+ @Override
+ public String getName() {
+ return fileName;
+ }
+}
Copied: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/TS_InlineLocal.java (from rev 2204, trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/TS_InlineTemp.java)
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/TS_InlineLocal.java (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/TS_InlineLocal.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -0,0 +1,44 @@
+/***** 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...>
+ *
+ * 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.tests.core.inlinelocal;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.rubypeople.rdt.refactoring.tests.FileTestSuite;
+import org.rubypeople.rdt.refactoring.tests.core.inlinelocal.conditionchecks.TS_InlineLocalConditionChecks;
+
+public class TS_InlineLocal extends FileTestSuite {
+
+ public static Test suite() {
+ TestSuite suite = createSuite("Inline Temp", "inline_temp_test_*.test_properties", LocalInlinerTester.class);
+ suite.addTest(TS_InlineLocalConditionChecks.suite());
+ return suite;
+ }
+}
\ No newline at end of file
Deleted: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/TS_InlineTemp.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/TS_InlineTemp.java 2007-03-21 21:44:55 UTC (rev 2204)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/TS_InlineTemp.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -1,44 +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...>
- *
- * 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.tests.core.inlinelocal;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.rubypeople.rdt.refactoring.tests.FileTestSuite;
-import org.rubypeople.rdt.refactoring.tests.core.inlinelocal.conditionchecks.TS_InlineTempConditionChecks;
-
-public class TS_InlineTemp extends FileTestSuite {
-
- public static Test suite() {
- TestSuite suite = createSuite("Inline Temp", "inline_temp_test_*.test_properties", TempInlinerTester.class);
- suite.addTest(TS_InlineTempConditionChecks.suite());
- return suite;
- }
-}
\ No newline at end of file
Deleted: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/TempInlinerTester.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/TempInlinerTester.java 2007-03-21 21:44:55 UTC (rev 2204)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/TempInlinerTester.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -1,77 +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.tests.core.inlinelocal;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.rubypeople.rdt.refactoring.core.inlinelocal.InlineLocalConditionChecker;
-import org.rubypeople.rdt.refactoring.core.inlinelocal.InlineLocalConfig;
-import org.rubypeople.rdt.refactoring.core.inlinelocal.LocalVariableInliner;
-import org.rubypeople.rdt.refactoring.tests.FileTestData;
-import org.rubypeople.rdt.refactoring.tests.RefactoringTestCase;
-
-public class TempInlinerTester extends RefactoringTestCase {
-
- private String fileName;
-
- private FileTestData testData;
-
- public TempInlinerTester(String fileName) {
- this.fileName = fileName;
- }
-
- private void runInlineTempTest(FileTestData data) throws BadLocationException {
-
- InlineLocalConfig config = new InlineLocalConfig(data, data.getIntProperty("caretPosition"));
- InlineLocalConditionChecker checker = new InlineLocalConditionChecker(config);
- if (!checker.shouldPerform()) {
- fail();
- }
- LocalVariableInliner inliner = new LocalVariableInliner(config);
- config.setReplaceTempWithQuery(data.getBoolProperty("replaceWithQuery"));
- config.setNewMethodName(data.getProperty("newMethodName"));
-
- createEditAndCompareResult(data.getActiveFileContent(), data.getExpectedResult(), inliner);
- }
-
- @Override
- public void runTest() throws FileNotFoundException, IOException, BadLocationException {
- testData = new FileTestData(fileName, getClass());
- runInlineTempTest(testData);
- }
-
- @Override
- public String getName() {
- return fileName;
- }
-}
Copied: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/InlineLocalConditionTester.java (from rev 2204, trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/InlineTempConditionTester.java)
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/InlineLocalConditionTester.java (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/InlineLocalConditionTester.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -0,0 +1,69 @@
+/***** 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.tests.core.inlinelocal.conditionchecks;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import org.rubypeople.rdt.refactoring.core.inlinelocal.InlineLocalConditionChecker;
+import org.rubypeople.rdt.refactoring.core.inlinelocal.InlineLocalConfig;
+import org.rubypeople.rdt.refactoring.core.inlinelocal.LocalVariableInliner;
+import org.rubypeople.rdt.refactoring.tests.FileTestData;
+import org.rubypeople.rdt.refactoring.tests.RefactoringConditionTestCase;
+
+public class InlineLocalConditionTester extends RefactoringConditionTestCase {
+
+ private InlineLocalConfig config;
+ private FileTestData testData;
+
+ public InlineLocalConditionTester(String fileName) {
+ super(fileName);
+ }
+
+ @Override
+ public void runTest() throws FileNotFoundException, IOException {
+ testData = new FileTestData(getName(), ".test_source", ".test_source");
+
+ config = new InlineLocalConfig(testData, testData.getIntProperty("cursorPosition"));
+ InlineLocalConditionChecker checker = new InlineLocalConditionChecker(config);
+ checkConditions(checker, testData);
+ }
+
+ @Override
+ protected void createEditProviderAndSetUserInput() {
+ new LocalVariableInliner(config);
+ if(testData.hasProperty("newName")) {
+ config.setReplaceTempWithQuery(true);
+ config.setNewMethodName(testData.getProperty("newName"));
+ }
+ }
+
+}
Deleted: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/InlineTempConditionTester.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/InlineTempConditionTester.java 2007-03-21 21:44:55 UTC (rev 2204)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/InlineTempConditionTester.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -1,69 +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.tests.core.inlinelocal.conditionchecks;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-
-import org.rubypeople.rdt.refactoring.core.inlinelocal.InlineLocalConditionChecker;
-import org.rubypeople.rdt.refactoring.core.inlinelocal.InlineLocalConfig;
-import org.rubypeople.rdt.refactoring.core.inlinelocal.LocalVariableInliner;
-import org.rubypeople.rdt.refactoring.tests.FileTestData;
-import org.rubypeople.rdt.refactoring.tests.RefactoringConditionTestCase;
-
-public class InlineTempConditionTester extends RefactoringConditionTestCase {
-
- private InlineLocalConfig config;
- private FileTestData testData;
-
- public InlineTempConditionTester(String fileName) {
- super(fileName);
- }
-
- @Override
- public void runTest() throws FileNotFoundException, IOException {
- testData = new FileTestData(getName(), ".test_source", ".test_source");
-
- config = new InlineLocalConfig(testData, testData.getIntProperty("cursorPosition"));
- InlineLocalConditionChecker checker = new InlineLocalConditionChecker(config);
- checkConditions(checker, testData);
- }
-
- @Override
- protected void createEditProviderAndSetUserInput() {
- new LocalVariableInliner(config);
- if(testData.hasProperty("newName")) {
- config.setReplaceTempWithQuery(true);
- config.setNewMethodName(testData.getProperty("newName"));
- }
- }
-
-}
Copied: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/TS_InlineLocalConditionChecks.java (from rev 2204, trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/TS_InlineTempConditionChecks.java)
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/TS_InlineLocalConditionChecks.java (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/TS_InlineLocalConditionChecks.java 2007-03-22 09:12:10 UTC (rev 2205)
@@ -0,0 +1,43 @@
+/***** 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.tests.core.inlinelocal.conditionchecks;
+
+import junit.framework.TestSuite;
+
+import org.rubypeople.rdt.refactoring.tests.FileTestSuite;
+
+public class TS_InlineLocalConditionChecks extends FileTestSuite {
+
+ public static TestSuite suite() {
+ return createSuite("InlineTempConditionChecks", "inline_temp_checker_test_*test_source", InlineLocalConditionTester.class);
+ }
+
+}
Deleted: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/TS_InlineTempConditionChecks.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/...
[truncated message content] |
|
From: <mba...@us...> - 2007-03-21 21:45:14
|
Revision: 2204
http://svn.sourceforge.net/rubyeclipse/?rev=2204&view=rev
Author: mbarchfe
Date: 2007-03-21 14:44:55 -0700 (Wed, 21 Mar 2007)
Log Message:
-----------
Provide a more meaningful message if a user tries to open/save a ruby script in a project without ruby nature
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IRubyModelStatusConstants.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelStatus.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/Messages.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/messages.properties
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IRubyModelStatusConstants.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IRubyModelStatusConstants.java 2007-03-21 16:02:43 UTC (rev 2203)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IRubyModelStatusConstants.java 2007-03-21 21:44:55 UTC (rev 2204)
@@ -307,4 +307,5 @@
* @since 3.1
*/
// public static final int INVALID_COMPILER_OPTION = 1007;
+ public static final int PROJECT_HAS_NO_RUBY_NATURE = 1007;
}
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelStatus.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelStatus.java 2007-03-21 16:02:43 UTC (rev 2203)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelStatus.java 2007-03-21 21:44:55 UTC (rev 2204)
@@ -308,6 +308,11 @@
newPath = path.removeFirstSegments(1);
}
return Messages.bind(Messages.classpath_disabledMultipleOutputLocations, newPath.makeRelative().toString(), projectName);
+
+ case PROJECT_HAS_NO_RUBY_NATURE:
+ javaProject = (IRubyProject)elements[0];
+ projectName = javaProject.getElementName();
+ return Messages.bind(Messages.project_has_no_ruby_nature, projectName);
}
if (string != null) {
return string;
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-03-21 16:02:43 UTC (rev 2203)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java 2007-03-21 21:44:55 UTC (rev 2204)
@@ -469,7 +469,7 @@
// check whether the ruby project can be opened
if (!hasRubyNature((IProject) underlyingResource)) {
- throw newNotPresentException();
+ throw new RubyModelException(new RubyModelStatus(IRubyModelStatusConstants.PROJECT_HAS_NO_RUBY_NATURE, this));
}
// cannot refresh cp markers on opening (emulate cp check on startup)
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/Messages.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/Messages.java 2007-03-21 16:02:43 UTC (rev 2203)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/Messages.java 2007-03-21 21:44:55 UTC (rev 2204)
@@ -153,6 +153,7 @@
public static String convention_package_uppercaseName;
public static String build_saveStateProgress;
public static String build_saveStateComplete;
+ public static String project_has_no_ruby_nature;
static {
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/messages.properties
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/messages.properties 2007-03-21 16:02:43 UTC (rev 2203)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/messages.properties 2007-03-21 21:44:55 UTC (rev 2204)
@@ -159,3 +159,5 @@
convention_package_nameWithBlanks = A package name must not start or end with a blank
convention_package_consecutiveDotsName = A package name must not contain two consecutive dots
convention_package_uppercaseName = By convention, package names usually start with a lowercase letter
+
+project_has_no_ruby_nature = The project {0} is supposed to have a ruby nature.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mir...@us...> - 2007-03-21 16:03:07
|
Revision: 2203
http://svn.sourceforge.net/rubyeclipse/?rev=2203&view=rev
Author: mirkostocker
Date: 2007-03-21 09:02:43 -0700 (Wed, 21 Mar 2007)
Log Message:
-----------
rename "temp" to "local" in the tests
Modified Paths:
--------------
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/TS_All.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/create_stub.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_1.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_1.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_10.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_10.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_2.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_2.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_3.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_3.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_4.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_4.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_5.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_5.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_6.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_6.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_7.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_7.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_8.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_8.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_9.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_9.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/create_stub.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_1.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_1.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_1.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_10.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_10.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_10.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_12.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_12.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_12.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_13.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_13.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_13.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_14.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_14.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_14.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_15.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_15.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_15.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_16.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_16.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_16.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_17.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_17.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_17.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_2.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_2.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_2.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_3.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_3.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_3.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_4.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_4.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_4.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_5.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_5.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_5.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_6.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_6.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_6.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_7.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_7.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_7.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_8.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_8.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_8.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_9.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_9.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/temp_to_field_test_9.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/conditionchecks/
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/conditionchecks/create_stub.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/conditionchecks/inline_temp_checker_test_1.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/conditionchecks/inline_temp_checker_test_1.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/conditionchecks/inline_temp_checker_test_2.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/conditionchecks/inline_temp_checker_test_2.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/conditionchecks/inline_temp_checker_test_3.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/conditionchecks/inline_temp_checker_test_3.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/conditionchecks/inline_temp_checker_test_4.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/conditionchecks/inline_temp_checker_test_4.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/conditionchecks/inline_temp_checker_test_5.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/conditionchecks/inline_temp_checker_test_5.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/conditionchecks/inline_temp_checker_test_6.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/conditionchecks/inline_temp_checker_test_6.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/conditionchecks/inline_temp_checker_test_7.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/conditionchecks/inline_temp_checker_test_7.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_1.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_1.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_1.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_10.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_10.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_10.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_11.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_11.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_11.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_2.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_2.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_2.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_3.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_3.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_3.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_4.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_4.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_4.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_5.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_5.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_5.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_6.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_6.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_6.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_7.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_7.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_7.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_8.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_8.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_8.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_9.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_9.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/inline_temp_test_9.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/conditionchecks/
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/conditionchecks/rename_local_condition_test_1.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/conditionchecks/rename_local_condition_test_1.test_source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/conditionchecks/rename_local_condition_test_2.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/conditionchecks/rename_local_condition_test_2.test_source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_1.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_1.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_1.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_10.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_10.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_10.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_11.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_11.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_11.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_12.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_12.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_12.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_13.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_13.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_13.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_14.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_14.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_14.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_15.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_15.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_15.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_16.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_16.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_16.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_17.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_17.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_17.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_18.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_18.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_18.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_19.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_19.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_19.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_2.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_2.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_2.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_20.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_20.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_20.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_3.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_3.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_3.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_4.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_4.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_4.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_5.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_5.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_5.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_6.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_6.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_6.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_7.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_7.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_7.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_8.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_8.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_8.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_9.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_9.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/rename_local_test_9.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splitlocal/
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splitlocal/conditionchecks/
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splitlocal/conditionchecks/create_stub.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splitlocal/conditionchecks/split_temp_checker_test_1.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splitlocal/conditionchecks/split_temp_checker_test_1.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splitlocal/split_temp_test_1.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splitlocal/split_temp_test_1.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splitlocal/split_temp_test_1.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splitlocal/split_temp_test_2.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splitlocal/split_temp_test_2.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splitlocal/split_temp_test_2.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splitlocal/split_temp_test_3.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splitlocal/split_temp_test_3.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splitlocal/split_temp_test_3.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splitlocal/split_temp_test_4.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splitlocal/split_temp_test_4.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splitlocal/split_temp_test_4.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splitlocal/testFindLocalUsages_1.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splitlocal/testFindLocalUsages_11.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splitlocal/testFindLocalUsages_2.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splitlocal/testFindLocalUsages_3.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splitlocal/testFindLocalUsages_4.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splitlocal/testFindLocalUsages_5.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splitlocal/testFindLocalUsages_6.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splitlocal/testFindLocalUsages_7.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splitlocal/testFindLocalUsages_8.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splitlocal/testFindLocalUsages_9.rb
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/TS_TempToField.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/TempToFieldTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TS_TempToFieldChecks.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TempToFieldConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/TS_InlineTemp.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/TempInlinerTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/InlineTempConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/TS_InlineTempConditionChecks.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocal/
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocal/RenameLocalTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocal/TS_RenameLocalVariable.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocal/conditionchecks/
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocal/conditionchecks/RenameLocalConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocal/conditionchecks/TS_RenameLocalCondition.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splitlocal/
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splitlocal/SplitTempTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splitlocal/TC_LocalVarFinder.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splitlocal/TC_SplittedVariableRenamer.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splitlocal/TS_SplitTemp.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splitlocal/conditionchecks/
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splitlocal/conditionchecks/SplitTempConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splitlocal/conditionchecks/TS_SplitTempChecks.java
Removed Paths:
-------------
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/create_stub.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_1.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_1.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_10.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_10.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_2.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_2.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_3.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_3.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_4.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_4.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_5.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_5.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_6.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_6.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_7.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_7.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_8.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_8.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_9.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_9.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/conditionchecks/
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/inlinelocal/conditionchecks/create_stub.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/conditionchecks/inline_temp_checker_test_1.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/conditionchecks/inline_temp_checker_test_1.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/conditionchecks/inline_temp_checker_test_2.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/conditionchecks/inline_temp_checker_test_2.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/conditionchecks/inline_temp_checker_test_3.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/conditionchecks/inline_temp_checker_test_3.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/conditionchecks/inline_temp_checker_test_4.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/conditionchecks/inline_temp_checker_test_4.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/conditionchecks/inline_temp_checker_test_5.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/conditionchecks/inline_temp_checker_test_5.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/conditionchecks/inline_temp_checker_test_6.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/conditionchecks/inline_temp_checker_test_6.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/conditionchecks/inline_temp_checker_test_7.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinelocal/conditionchecks/inline_temp_checker_test_7.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/conditionchecks/
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_1.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_1.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_1.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_10.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_10.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_10.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_11.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_11.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_11.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_2.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_2.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_2.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_3.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_3.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_3.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_4.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_4.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_4.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_5.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_5.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_5.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_6.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_6.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_6.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_7.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_7.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_7.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_8.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_8.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_8.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_9.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_9.test_result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlinetemp/inline_temp_test_9.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/conditionchecks/rename_local_condition_test_1.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/conditionchecks/rename_local_condition_test_1.test_source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/conditionchecks/rename_local_condition_test_2.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocal/conditionchecks/rename_local_condition_test_2.test_source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/conditionchecks/
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_1.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_1.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_1.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_10.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_10.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_10.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_11.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_11.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_11.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_12.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_12.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_12.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_13.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_13.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_13.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_14.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_14.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_14.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_15.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_15.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_15.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_16.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_16.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_16.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_17.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_17.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_17.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_18.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_18.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_18.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_19.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_19.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_19.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_2.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_2.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_2.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_20.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_20.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_20.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_3.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_3.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_3.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_4.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_4.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_4.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_5.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_5.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_5.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_6.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_6.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_6.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_7.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_7.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_7.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_8.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_8.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_8.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_9.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_9.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamelocalvariable/rename_local_test_9.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splitlocal/conditionchecks/create_stub.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splitlocal/conditionchecks/split_temp_checker_test_1.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splitlocal/conditionchecks/split_temp_checker_test_1.test_source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splittemp/conditionchecks/
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splittemp/split_temp_test_1.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splittemp/split_temp_test_1.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splittemp/split_temp_test_1.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splittemp/split_temp_test_2.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splittemp/split_temp_test_2.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splittemp/split_temp_test_2.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splittemp/split_temp_test_3.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splittemp/split_temp_test_3.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splittemp/split_temp_test_3.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splittemp/split_temp_test_4.result.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splittemp/split_temp_test_4.source.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splittemp/split_temp_test_4.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splittemp/testFindLocalUsages_1.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splittemp/testFindLocalUsages_11.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splittemp/testFindLocalUsages_2.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splittemp/testFindLocalUsages_3.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splittemp/testFindLocalUsages_4.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splittemp/testFindLocalUsages_5.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splittemp/testFindLocalUsages_6.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splittemp/testFindLocalUsages_7.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splittemp/testFindLocalUsages_8.rb
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/splittemp/testFindLocalUsages_9.rb
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TS_TempToFieldChecks.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/convertlocaltofield/conditionchecks/TempToFieldConditionTester.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/TempToFieldTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/converttemptofield/conditionchecks/
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/InlineTempConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinelocal/conditionchecks/TS_InlineTempConditionChecks.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/TempInlinerTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinetemp/conditionchecks/
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocal/conditionchecks/RenameLocalConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocal/conditionchecks/TS_RenameLocalCondition.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocalvariable/RenameLocalTester.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/
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splitlocal/conditionchecks/SplitTempConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splitlocal/conditionchecks/TS_SplitTempChecks.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/
Copied: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks (from rev 2181, trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/conditionchecks)
Deleted: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/create_stub.rb
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/conditionchecks/create_stub.rb 2007-03-15 16:01:31 UTC (rev 2181)
+++ trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/create_stub.rb 2007-03-21 16:02:43 UTC (rev 2203)
@@ -1,37 +0,0 @@
-#!/usr/bin/ruby
-
-name = "temp_to_field_checker_test_"
-max = 0
-Dir.new(".").each do |file|
- if file =~ /temp_to_field_checker_test_(\d+)/
- max = $1.to_i if $1.to_i > max
- end
-end
-
-name = name + (max + 1).to_s
-puts name
-
-`touch #{name}.test_source`
-
-property = <<EOF
-#true of false
-isClassField=false
-newName=
-cursorPosition=
-initialError0=
-initialError1=
-#....
-initialWarning0=
-initialWarning1=
-#...
-finalError0=
-finalError1=
-#...
-finalWarning0=
-finalWarning1=
-#...
-EOF
-
-`echo "#{property}" > #{name}.test_properties`
-
-
Copied: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/create_stub.rb (from rev 2202, trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/conditionchecks/create_stub.rb)
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/create_stub.rb (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/create_stub.rb 2007-03-21 16:02:43 UTC (rev 2203)
@@ -0,0 +1,37 @@
+#!/usr/bin/ruby
+
+name = "temp_to_field_checker_test_"
+max = 0
+Dir.new(".").each do |file|
+ if file =~ /temp_to_field_checker_test_(\d+)/
+ max = $1.to_i if $1.to_i > max
+ end
+end
+
+name = name + (max + 1).to_s
+puts name
+
+`touch #{name}.test_source`
+
+property = <<EOF
+#true of false
+isClassField=false
+newName=
+cursorPosition=
+initialError0=
+initialError1=
+#....
+initialWarning0=
+initialWarning1=
+#...
+finalError0=
+finalError1=
+#...
+finalWarning0=
+finalWarning1=
+#...
+EOF
+
+`echo "#{property}" > #{name}.test_properties`
+
+
Deleted: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/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_properties 2007-03-15 16:01:31 UTC (rev 2181)
+++ trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_1.test_properties 2007-03-21 16:02:43 UTC (rev 2203)
@@ -1,4 +0,0 @@
-isClassField=false
-newName=d
-cursorPosition=0
-initialError0=Nothing to do in empty document.
Copied: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_1.test_properties (from rev 2202, 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/convertlocaltofield/conditionchecks/temp_to_field_checker_test_1.test_properties (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_1.test_properties 2007-03-21 16:02:43 UTC (rev 2203)
@@ -0,0 +1,4 @@
+isClassField=false
+newName=d
+cursorPosition=0
+initialError0=Nothing to do in empty document.
Deleted: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_1.test_source
===================================================================
Copied: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_1.test_source (from rev 2202, trunk/org.rubypeople.rdt.refactoring.tests/resources/core/converttemptofield/conditionchecks/temp_to_field_checker_test_1.test_source)
===================================================================
Deleted: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/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_properties 2007-03-15 16:01:31 UTC (rev 2181)
+++ trunk/org.rubypeople.rdt.refactoring.tests/resources/core/convertlocaltofield/conditionchecks/temp_to_field_checker_test_10.test_properties 2007-03-21 16:02:43 UTC (rev 2203)
@@ -1,5 +0,0 @@
-#true of false
-isClassField=false
-newName=d
-cursorPosition=...
[truncated message content] |
|
From: <mir...@us...> - 2007-03-21 13:44:07
|
Revision: 2202
http://svn.sourceforge.net/rubyeclipse/?rev=2202&view=rev
Author: mirkostocker
Date: 2007-03-21 06:44:04 -0700 (Wed, 21 Mar 2007)
Log Message:
-----------
fix the new test case wizard and validate the classname
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/CreateMethodOperation.java
trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/wizards/RubyNewTestCaseWizardPage.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewClassWizardPage.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewTypeWizardPage.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/CreateMethodOperation.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/CreateMethodOperation.java 2007-03-19 13:08:24 UTC (rev 2201)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/CreateMethodOperation.java 2007-03-21 13:44:04 UTC (rev 2202)
@@ -7,6 +7,7 @@
import org.jruby.ast.DefsNode;
import org.jruby.ast.NewlineNode;
import org.jruby.ast.Node;
+import org.jruby.ast.RootNode;
import org.rubypeople.rdt.core.IRubyElement;
import org.rubypeople.rdt.core.IRubyModelStatus;
import org.rubypeople.rdt.core.IRubyModelStatusConstants;
@@ -224,8 +225,7 @@
private Node generateElementAST(IDocument document, IRubyScript cu) {
RubyParser parser = new RubyParser();
Node root = parser.parse(this.source);
- NewlineNode newline = (NewlineNode) root;
- this.createdNode = newline.getNextNode(); // Grab node from our parsed source!
+ this.createdNode = ((NewlineNode) ((RootNode) root).getBodyNode()).getNextNode(); // Grab node from our parsed source!
return this.createdNode;
}
Modified: trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/wizards/RubyNewTestCaseWizardPage.java
===================================================================
--- trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/wizards/RubyNewTestCaseWizardPage.java 2007-03-19 13:08:24 UTC (rev 2201)
+++ trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/wizards/RubyNewTestCaseWizardPage.java 2007-03-21 13:44:04 UTC (rev 2202)
@@ -22,7 +22,6 @@
import org.eclipse.swt.widgets.Text;
import org.rubypeople.rdt.core.IRubyElement;
import org.rubypeople.rdt.core.IRubyProject;
-import org.rubypeople.rdt.core.IRubyScript;
import org.rubypeople.rdt.core.ISourceFolderRoot;
import org.rubypeople.rdt.core.IType;
import org.rubypeople.rdt.core.RubyConventions;
@@ -281,6 +280,7 @@
fClassUnderTestStatus= classUnderTestChanged();
handleFieldChanged(CLASS_UNDER_TEST);
}
+
/**
* Hook method that gets called when the class under test has changed. The method class under test
@@ -359,19 +359,19 @@
// TODO Uncomment to set up type page
// initTypePage(element);
// put default class to test
- if (element != null) {
- IType classToTest= null;
+// if (element != null) {
+// IType classToTest= null;
// evaluate the enclosing type
- IType typeInCompUnit= (IType) element.getAncestor(IRubyElement.TYPE);
- if (typeInCompUnit != null) {
- if (typeInCompUnit.getRubyScript() != null) {
- classToTest= typeInCompUnit;
- }
- } else {
- IRubyScript cu= (IRubyScript) element.getAncestor(IRubyElement.SCRIPT);
- if (cu != null)
- classToTest= cu.findPrimaryType();
- }
+// IType typeInCompUnit= (IType) element.getAncestor(IRubyElement.TYPE);
+// if (typeInCompUnit != null) {
+// if (typeInCompUnit.getRubyScript() != null) {
+// classToTest= typeInCompUnit;
+// }
+// } else {
+// IRubyScript cu= (IRubyScript) element.getAncestor(IRubyElement.SCRIPT);
+// if (cu != null)
+// classToTest= cu.findPrimaryType();
+// }
// TODO uncomment to set class under test
// if (classToTest != null) {
// try {
@@ -382,7 +382,7 @@
// TestunitPlugin.log(e);
// }
// }
- }
+// }
restoreWidgetValues();
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewClassWizardPage.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewClassWizardPage.java 2007-03-19 13:08:24 UTC (rev 2201)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewClassWizardPage.java 2007-03-21 13:44:04 UTC (rev 2202)
@@ -12,7 +12,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -91,31 +90,7 @@
setMethodStubSelection(createConstructors, true);
}
- // ------ validation --------
- private void doStatusUpdate() {
- // status of all used components
- IStatus[] status= new IStatus[] {
- fContainerStatus,
- fTypeNameStatus,
- fSuperClassStatus,
- fSuperInterfacesStatus
- };
-
- // the mode severe status will be displayed and the OK button enabled/disabled.
- updateStatus(status);
- }
-
- /*
- * @see NewContainerWizardPage#handleFieldChanged
- */
- protected void handleFieldChanged(String fieldName) {
- super.handleFieldChanged(fieldName);
-
- doStatusUpdate();
- }
-
-
// ------ UI --------
/*
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewTypeWizardPage.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewTypeWizardPage.java 2007-03-19 13:08:24 UTC (rev 2201)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewTypeWizardPage.java 2007-03-21 13:44:04 UTC (rev 2202)
@@ -794,6 +794,31 @@
return status;
}
+
+ // ------ validation --------
+ protected void doStatusUpdate() {
+ // status of all used components
+ IStatus[] status= new IStatus[] {
+ fContainerStatus,
+ fTypeNameStatus,
+ fSuperClassStatus,
+ fSuperInterfacesStatus
+ };
+
+ // the mode severe status will be displayed and the OK button enabled/disabled.
+ updateStatus(status);
+ }
+
+
+ /*
+ * @see NewContainerWizardPage#handleFieldChanged
+ */
+ protected void handleFieldChanged(String fieldName) {
+ super.handleFieldChanged(fieldName);
+
+ doStatusUpdate();
+ }
+
/**
* Initializes all fields provided by the page with a given selection.
*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
Revision: 2201
http://svn.sourceforge.net/rubyeclipse/?rev=2201&view=rev
Author: mirkostocker
Date: 2007-03-19 06:08:24 -0700 (Mon, 19 Mar 2007)
Log Message:
-----------
forgot to add the new testcases
Added Paths:
-----------
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/nodewrapper/TC_MethodNodeWrapper.java
Added: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/nodewrapper/TC_MethodNodeWrapper.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/nodewrapper/TC_MethodNodeWrapper.java (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/nodewrapper/TC_MethodNodeWrapper.java 2007-03-19 13:08:24 UTC (rev 2201)
@@ -0,0 +1,118 @@
+/***** 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) 2007 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.tests.core.nodewrapper;
+
+import junit.framework.TestCase;
+
+import org.jruby.ast.ArgsNode;
+import org.jruby.ast.ArgumentNode;
+import org.jruby.ast.ArrayNode;
+import org.jruby.ast.DefnNode;
+import org.jruby.ast.NewlineNode;
+import org.jruby.ast.RootNode;
+import org.jruby.lexer.yacc.SourcePosition;
+import org.rubypeople.rdt.refactoring.documentprovider.StringDocumentProvider;
+import org.rubypeople.rdt.refactoring.nodewrapper.ClassNodeWrapper;
+import org.rubypeople.rdt.refactoring.nodewrapper.MethodNodeWrapper;
+import org.rubypeople.rdt.refactoring.nodewrapper.RealClassNodeWrapper;
+
+public class TC_MethodNodeWrapper extends TestCase {
+
+ private static final SourcePosition EMPTY_POSITION = new SourcePosition();
+ ClassNodeWrapper klass;
+
+ public void setUp() {
+ RootNode rootNode = new StringDocumentProvider("TC_MethodNodeWrapper", "class T; def i; @var1; @var2; @var3; end; end").getRootNode("TC_MethodNodeWrapper");
+ klass = new ClassNodeWrapper(new RealClassNodeWrapper(((NewlineNode) rootNode.getBodyNode()).getNextNode()));
+ }
+
+ private MethodNodeWrapper createReaderMethod(String name) {
+ MethodNodeWrapper wrapper = new MethodNodeWrapper(new DefnNode(EMPTY_POSITION, new ArgumentNode(EMPTY_POSITION, name), new ArgsNode(EMPTY_POSITION, null, null, 0, null), null, null, null), klass);
+ return wrapper;
+ }
+
+ private MethodNodeWrapper createWriterMethod(String name) {
+ MethodNodeWrapper wrapper = new MethodNodeWrapper(new DefnNode(EMPTY_POSITION, new ArgumentNode(EMPTY_POSITION, name), new ArgsNode(EMPTY_POSITION, new ArrayNode(EMPTY_POSITION, new ArgumentNode(EMPTY_POSITION, "value")), null, 0, null), null, null, null), klass);
+ return wrapper;
+ }
+
+ private MethodNodeWrapper createInvalidWriterMethod(String name) {
+ MethodNodeWrapper wrapper = new MethodNodeWrapper(new DefnNode(EMPTY_POSITION, new ArgumentNode(EMPTY_POSITION, name), new ArgsNode(EMPTY_POSITION, new ArrayNode(EMPTY_POSITION, new ArgumentNode(EMPTY_POSITION, "value")).add(new ArgumentNode(EMPTY_POSITION, "value2")), null, 0, null), null, null, null), klass);
+ return wrapper;
+ }
+
+ public void testIsNotAccessor() {
+ MethodNodeWrapper wrapper = createReaderMethod("test");
+ assertFalse(wrapper.isAccessor());
+
+ wrapper = createReaderMethod("var");
+ assertFalse(wrapper.isAccessor());
+ }
+
+ public void testIsAccessor() {
+ MethodNodeWrapper wrapper = createReaderMethod("var1");
+ assertTrue(wrapper.isAccessor());
+
+ wrapper = createReaderMethod("var2");
+ assertTrue(wrapper.isAccessor());
+
+ wrapper = createReaderMethod("var3");
+ assertTrue(wrapper.isAccessor());
+ }
+
+ public void testIsWriter() {
+ MethodNodeWrapper wrapper = createWriterMethod("var1=");
+ assertTrue(wrapper.isAccessor());
+
+ wrapper = createWriterMethod("var2=");
+ assertTrue(wrapper.isAccessor());
+
+ wrapper = createWriterMethod("var3=");
+ assertTrue(wrapper.isAccessor());
+ }
+
+ public void testIsNotWriter() {
+ MethodNodeWrapper wrapper = createWriterMethod("var1");
+ assertFalse(wrapper.isAccessor());
+
+ wrapper = createWriterMethod("va=");
+ assertFalse(wrapper.isAccessor());
+
+ wrapper = createWriterMethod("v=");
+ assertFalse(wrapper.isAccessor());
+
+ wrapper = createInvalidWriterMethod("var1=");
+ assertFalse(wrapper.isAccessor());
+ }
+
+ public void testWithoutClass() {
+ MethodNodeWrapper nodeWrapper = new MethodNodeWrapper(null, null);
+ assertFalse(nodeWrapper.isAccessor());
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mir...@us...> - 2007-03-19 13:07:51
|
Revision: 2200
http://svn.sourceforge.net/rubyeclipse/?rev=2200&view=rev
Author: mirkostocker
Date: 2007-03-19 06:07:45 -0700 (Mon, 19 Mar 2007)
Log Message:
-----------
rename fields if an accessor method is renamed
Modified Paths:
--------------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movemethod/DelegateMethodEditProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movemethod/MoveMethodConditionChecker.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/core/renamefield/FieldRenamer.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamefield/RenameFieldConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/MethodRenamer.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/documentprovider/StringDocumentProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/nodewrapper/ClassNodeWrapper.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/nodewrapper/MethodNodeWrapper.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/nodewrapper/PartialClassNodeWrapper.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/signatureprovider/MethodSignature.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/OccurenceReplaceSelectionPage.java
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_10.activeFile.rb.result
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/TS_All.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/nodewrapper/TS_NodeWrapper.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamemethod/selection/RenameMethodSelectionTester.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamefield/InstVarAccessesFinder.java
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_16.activeFile.rb.result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_16.activeFile.rb.source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_16.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_17.activeFile.rb.result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_17.activeFile.rb.source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_17.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_18.activeFile.rb.result
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_18.activeFile.rb.source
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_18.test_properties
Removed Paths:
-------------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/FieldProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/MethodDefinitionWrapper.java
Deleted: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/FieldProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/FieldProvider.java 2007-03-17 15:08:16 UTC (rev 2199)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/FieldProvider.java 2007-03-19 13:07:45 UTC (rev 2200)
@@ -1,206 +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.core;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-
-import org.jruby.ast.FCallNode;
-import org.jruby.ast.InstAsgnNode;
-import org.jruby.ast.InstVarNode;
-import org.jruby.ast.Node;
-import org.jruby.ast.SymbolNode;
-import org.jruby.lexer.yacc.ISourcePosition;
-import org.rubypeople.rdt.refactoring.nodewrapper.AttrAccessorNodeWrapper;
-import org.rubypeople.rdt.refactoring.nodewrapper.ClassNodeWrapper;
-
-public class FieldProvider {
-
- private ClassNodeWrapper classNode;
-
- private LinkedHashMap<String, ArrayList<FCallNode>> attrs;
-
- private LinkedHashMap<String, ArrayList<AttrAccessorNodeWrapper>> accessors;
-
- private LinkedHashMap<String, ArrayList<InstVarNode>> instVars;
-
- private LinkedHashMap<String, ArrayList<InstAsgnNode>> instAsgns;
-
- public FieldProvider(ClassNodeWrapper classNode){
- this.classNode = classNode;
- initAttrs();
- initAccessors();
- }
-
- private void initAccessors() {
-
- accessors = new LinkedHashMap<String, ArrayList<AttrAccessorNodeWrapper>>();
-
- for(AttrAccessorNodeWrapper currentAccessor : classNode.getAccessorNodes()){
-
- String name = fieldName(currentAccessor.getAttrName());
-
- if(!accessors.containsKey(name)){
- accessors.put(name, new ArrayList<AttrAccessorNodeWrapper>());
- }
- ArrayList<AttrAccessorNodeWrapper> accessorList = accessors.get(name);
- accessorList.add(currentAccessor);
- }
- }
-
- private void initAttrs() {
-
- attrs = new LinkedHashMap<String, ArrayList<FCallNode>>();
- instVars = new LinkedHashMap<String, ArrayList<InstVarNode>>();
- instAsgns = new LinkedHashMap<String, ArrayList<InstAsgnNode>>();
-
- Collection<Node> allAttrs = classNode.getAttrNodes();
-
- for(Node currentAttr : allAttrs){
- if(currentAttr instanceof FCallNode){
- addAttr((FCallNode)currentAttr);
- }
- else if (currentAttr instanceof InstVarNode){
- addInstVar((InstVarNode)currentAttr );
- }
- else if (currentAttr instanceof InstAsgnNode){
- addInstAsgn((InstAsgnNode)currentAttr);
- }
- }
- }
-
- private void addInstAsgn(InstAsgnNode currentAttr) {
-
- String name = fieldName(currentAttr.getName());
-
- if(!attrs.containsKey(name)){
- instAsgns.put(name, new ArrayList<InstAsgnNode>());
- }
- ArrayList<InstAsgnNode> asgnList = instAsgns.get(name);
- asgnList.add(currentAttr);
- }
-
-
- public static String fieldName(String name) {
- return name.replaceAll("@|:", ""); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- private void addInstVar(InstVarNode currentAttr) {
- String name = fieldName(currentAttr.getName());
-
- if(!attrs.containsKey(name)){
- instVars.put(name, new ArrayList<InstVarNode>());
- }
- ArrayList<InstVarNode> varList = instVars.get(name);
- varList.add(currentAttr);
- }
-
- private void addAttr(FCallNode currentAttr) {
- SymbolNode symbol = (SymbolNode)currentAttr.getArgsNode();
- String name = fieldName(symbol.getName());
-
- if(!attrs.containsKey(name)){
- attrs.put(name, new ArrayList<FCallNode>());
- }
- ArrayList<FCallNode> attrList = attrs.get(name);
- attrList.add(currentAttr);
- }
-
- public ArrayList<AttrAccessorNodeWrapper> getAccessors(String fieldName) {
- return accessors.get(fieldName);
- }
-
- public ArrayList<FCallNode> getAttrs(String fieldName) {
- return attrs.get(fieldName);
- }
-
- public ArrayList<InstAsgnNode> getInstAsgns(String fieldName) {
- return instAsgns.get(fieldName);
- }
-
- public ArrayList<InstVarNode> getInstVars(String fieldName) {
- return instVars.get(fieldName);
- }
-
- public Collection<String> getFieldNames() {
- HashSet<String> names = new HashSet<String>();
- names.addAll(attrs.keySet());
- names.addAll(accessors.keySet());
- names.addAll(instVars.keySet());
- names.addAll(instAsgns.keySet());
- return names;
- }
-
- public String getNameAtPosition(int caretPosition) {
-
- for(String currentName : attrs.keySet()){
- for(FCallNode currentFCall : attrs.get(currentName)){
- if(containsPosition(caretPosition, currentFCall.getArgsNode().getPosition())){
- return currentName;
- }
- }
- }
-
- for(String currentName : accessors.keySet()){
- for(AttrAccessorNodeWrapper currentAccessorWrapper : accessors.get(currentName)){
- for(FCallNode currentAccessor : currentAccessorWrapper.getAccessorNodes()){
- if(containsPosition(caretPosition, currentAccessor.getArgsNode().getPosition())){
- return currentName;
- }
- }
- }
- }
-
- for(String currentName : instVars.keySet()){
- for(InstVarNode currentInstVar : instVars.get(currentName)){
- if(containsPosition(caretPosition, currentInstVar.getPosition())){
- return currentName;
- }
- }
- }
-
- for(String currentName : instAsgns.keySet()){
- for(InstAsgnNode currentInstAsgn : instAsgns.get(currentName)){
- if(containsPosition(caretPosition, currentInstAsgn.getPosition())){
- return currentName;
- }
- }
- }
-
- return null;
- }
-
- private boolean containsPosition(int offset, ISourcePosition pos){
- return (pos.getStartOffset() <= offset) && (pos.getEndOffset() >= offset);
- }
-}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movemethod/DelegateMethodEditProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movemethod/DelegateMethodEditProvider.java 2007-03-17 15:08:16 UTC (rev 2199)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movemethod/DelegateMethodEditProvider.java 2007-03-19 13:07:45 UTC (rev 2200)
@@ -49,7 +49,7 @@
super(false);
this.config = config;
oldMethod = config.getMethodNode();
- scopePos = NodeProvider.unwrap(oldMethod.getScopeNode()).getPosition();
+ scopePos = NodeProvider.unwrap(oldMethod.getBodyNode()).getPosition();
}
@Override
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movemethod/MoveMethodConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movemethod/MoveMethodConditionChecker.java 2007-03-17 15:08:16 UTC (rev 2199)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movemethod/MoveMethodConditionChecker.java 2007-03-19 13:07:45 UTC (rev 2200)
@@ -68,7 +68,7 @@
/*don't care*/
}
MethodDefNode methodDefNode = (MethodDefNode) SelectionNodeProvider.getSelectedNodeOfType(rootNode, caretPos, MethodDefNode.class);
- MethodNodeWrapper methodNode = (methodDefNode == null) ? null : new MethodNodeWrapper(methodDefNode);
+ MethodNodeWrapper methodNode = (methodDefNode == null) ? null : new MethodNodeWrapper(methodDefNode, config.getSourceClassNode());
config.setMethodNode(methodNode);
initTargetClassNames();
if(config.getSourceClassNode() != null) {
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-03-17 15:08:16 UTC (rev 2199)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamefield/FieldProvider.java 2007-03-19 13:07:45 UTC (rev 2200)
@@ -220,7 +220,7 @@
public ArrayList<FieldItem> getFieldItems(String fieldName, boolean concernsClassField) {
ArrayList<FieldItem> matchingItems = new ArrayList<FieldItem>();
-
+
for(FieldItem currentItem : fields.get(fieldName)){
if(currentItem.concernsClassField() == concernsClassField){
matchingItems.add(currentItem);
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamefield/FieldRenamer.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamefield/FieldRenamer.java 2007-03-17 15:08:16 UTC (rev 2199)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamefield/FieldRenamer.java 2007-03-19 13:07:45 UTC (rev 2200)
@@ -80,6 +80,7 @@
ISourcePosition methodPosition = currentMethod.getWrappedNode().getPosition();
RenameMethodConfig methodConfig = new RenameMethodConfig(config.getDocumentProvider(), methodPosition.getStartOffset());
new RenameMethodConditionChecker(methodConfig);
+ methodConfig.setRenameFields(false);
if(currentMethod.getName().equals(config.getSelectedName())){
methodConfig.setNewName(config.getNewName());
MethodRenamer methodRenamer = new MethodRenamer(methodConfig);
Added: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamefield/InstVarAccessesFinder.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamefield/InstVarAccessesFinder.java (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamefield/InstVarAccessesFinder.java 2007-03-19 13:07:45 UTC (rev 2200)
@@ -0,0 +1,76 @@
+/***** 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.core.renamefield;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.jruby.ast.CallNode;
+import org.jruby.ast.Node;
+import org.rubypeople.rdt.refactoring.core.SelectionNodeProvider;
+import org.rubypeople.rdt.refactoring.core.renamefield.fielditems.FieldCallItem;
+import org.rubypeople.rdt.refactoring.core.renamefield.fielditems.FieldItem;
+import org.rubypeople.rdt.refactoring.documentprovider.IDocumentProvider;
+import org.rubypeople.rdt.refactoring.exception.NoClassNodeException;
+
+public class InstVarAccessesFinder {
+
+ public static Collection<FieldItem> find(IDocumentProvider document, String selectedName) {
+ ArrayList<FieldItem> fieldCallNodes = new ArrayList<FieldItem>();
+
+ Collection<Node> allNodes = document.getAllNodes();
+ for (Node currentNode : allNodes) {
+ if (isPossibleCall(currentNode, document, selectedName)) {
+ fieldCallNodes.add(new FieldCallItem((CallNode) currentNode));
+ }
+ }
+
+ return fieldCallNodes;
+ }
+
+ private static boolean isPossibleCall(Node candidateNode, IDocumentProvider document, String selectedName) {
+ if ((candidateNode instanceof CallNode)) {
+
+ CallNode callNode = (CallNode) candidateNode;
+ if (callNode.getName().replaceAll("=", "").equals(selectedName)) { //$NON-NLS-1$ //$NON-NLS-2$
+ String fileName = callNode.getPosition().getFile();
+ Node rootNode = document.getRootNode(fileName);
+ try {
+ SelectionNodeProvider.getSelectedClassNode(rootNode, callNode.getPosition().getStartOffset());
+ } catch (NoClassNodeException e) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamefield/RenameFieldConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamefield/RenameFieldConditionChecker.java 2007-03-17 15:08:16 UTC (rev 2199)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamefield/RenameFieldConditionChecker.java 2007-03-19 13:07:45 UTC (rev 2200)
@@ -33,16 +33,12 @@
import java.util.ArrayList;
import java.util.Collection;
-import org.jruby.ast.CallNode;
-import org.jruby.ast.Node;
import org.jruby.ast.RootNode;
import org.rubypeople.rdt.refactoring.classnodeprovider.ClassNodeProvider;
import org.rubypeople.rdt.refactoring.classnodeprovider.IncludedClassesProvider;
import org.rubypeople.rdt.refactoring.core.IRefactoringConfig;
-import org.rubypeople.rdt.refactoring.core.NodeProvider;
import org.rubypeople.rdt.refactoring.core.RefactoringConditionChecker;
import org.rubypeople.rdt.refactoring.core.SelectionNodeProvider;
-import org.rubypeople.rdt.refactoring.core.renamefield.fielditems.FieldCallItem;
import org.rubypeople.rdt.refactoring.core.renamefield.fielditems.FieldItem;
import org.rubypeople.rdt.refactoring.documentprovider.DocumentWithIncluding;
import org.rubypeople.rdt.refactoring.exception.NoClassNodeException;
@@ -98,42 +94,13 @@
possibleItems.addAll(selectedItems);
if (!concernsClassField) {
- possibleItems.addAll(getInstVarAccesses());
+ possibleItems.addAll(InstVarAccessesFinder.find(config.getDocumentProvider(), config.getSelectedName()));
}
config.setPossibleCalls(possibleItems);
}
- private Collection<FieldItem> getInstVarAccesses() {
- ArrayList<FieldItem> fieldCallNodes = new ArrayList<FieldItem>();
- Collection<Node> allNodes = NodeProvider.getAllNodes(rootNode);
- for (Node currentNode : allNodes) {
- if (isPossibleCall(currentNode)) {
- fieldCallNodes.add(new FieldCallItem((CallNode) currentNode));
- }
- }
-
- return fieldCallNodes;
- }
-
- private boolean isPossibleCall(Node candidateNode) {
- if ((candidateNode instanceof CallNode)) {
-
- CallNode callNode = (CallNode) candidateNode;
- if (callNode.getName().replaceAll("=", "").equals(config.getSelectedName())) { //$NON-NLS-1$ //$NON-NLS-2$
- String fileName = callNode.getPosition().getFile();
- Node rootNode = config.getDocumentProvider().getRootNode(fileName);
- try {
- SelectionNodeProvider.getSelectedClassNode(rootNode, callNode.getPosition().getStartOffset());
- } catch (NoClassNodeException e) {
- return true;
- }
- }
- }
- return false;
- }
-
@Override
protected void checkFinalConditions() {
String newName = config.getNewName();
Deleted: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/MethodDefinitionWrapper.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/MethodDefinitionWrapper.java 2007-03-17 15:08:16 UTC (rev 2199)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/MethodDefinitionWrapper.java 2007-03-19 13:07:45 UTC (rev 2200)
@@ -1,65 +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.core.renamemethod;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.jruby.ast.MethodDefNode;
-import org.jruby.ast.SymbolNode;
-import org.rubypeople.rdt.refactoring.nodewrapper.ClassNodeWrapper;
-import org.rubypeople.rdt.refactoring.nodewrapper.MethodCallNodeWrapper;
-import org.rubypeople.rdt.refactoring.nodewrapper.MethodNodeWrapper;
-
-public class MethodDefinitionWrapper extends MethodNodeWrapper{
-
- public MethodDefinitionWrapper(MethodDefNode methodDefinition){
- super(methodDefinition);
- }
-
- public Collection<MethodCallNodeWrapper> getCallCandidatesInClass(ClassNodeWrapper classNode) {
- if(classNode == null){
- return new ArrayList<MethodCallNodeWrapper>();
- }
- Collection<MethodCallNodeWrapper> calls = classNode.getMethodCalls(methodNode);
-
- return calls;
- }
-
- public Collection<SymbolNode> getSymbolCandidatesInClass(ClassNodeWrapper classNode) {
- if(classNode == null){
- return new ArrayList<SymbolNode>();
- }
- Collection<SymbolNode> symbols = classNode.getMethodSymbols(methodNode);
-
- return symbols;
- }
-}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/MethodRenamer.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/MethodRenamer.java 2007-03-17 15:08:16 UTC (rev 2199)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/MethodRenamer.java 2007-03-19 13:07:45 UTC (rev 2200)
@@ -43,6 +43,8 @@
import org.rubypeople.rdt.refactoring.classnodeprovider.ClassNodeProvider;
import org.rubypeople.rdt.refactoring.core.NodeProvider;
import org.rubypeople.rdt.refactoring.core.SelectionNodeProvider;
+import org.rubypeople.rdt.refactoring.core.renamefield.FieldRenameEditProvider;
+import org.rubypeople.rdt.refactoring.core.renamefield.fielditems.FieldItem;
import org.rubypeople.rdt.refactoring.core.renamemethod.methoditems.CallCandidateItem;
import org.rubypeople.rdt.refactoring.core.renamemethod.methoditems.MethodNameArgumentItem;
import org.rubypeople.rdt.refactoring.core.renamemethod.methoditems.SymbolItem;
@@ -62,12 +64,11 @@
public Collection<String> getAllMethodsFromClass() {
Collection<String> names = new ArrayList<String>();
- try {
- for(MethodNodeWrapper method : config.getAllMethodsInClass()) {
+
+ if(config.getSelectedClass() != null) {
+ for(MethodNodeWrapper method : config.getSelectedClass().getMethods()) {
names.add(method.getName());
}
- } catch (NoClassNodeException e) {
- /*we don't care*/
}
return names;
}
@@ -75,8 +76,9 @@
public MethodRenamer(RenameMethodConfig config){
this.config = config;
- Collection<MethodCallNodeWrapper> probableClass = getCallCandidatesInClass();
+ Collection<INodeWrapper> probableClass = getCallCandidatesInClass();
probableClass.addAll(getSubsequentCalls());
+ probableClass.addAll(config.getSelectedCalls());
config.setSelectedCalls(probableClass);
}
@@ -91,7 +93,7 @@
if(!config.getTargetMethod().isClassMethod()){
addSymbolRenamers(fileEdits);
}
-
+
return fileEdits.getFileEditProviders();
}
@@ -101,18 +103,33 @@
}
String file = config.getDocumentProvider().getActiveFileName();
for(SymbolNode currentNode : getSymbolCandidatesInClass()){
- SymbolItem currentItem = new SymbolItem(currentNode);
- fileEdits.addEditProvider(new FileEditProvider(file, new MethodRenameEditProvider(currentItem, config.getNewName())));
+ addSymbolRenamer(fileEdits, file, currentNode, config.getNewName());
}
}
+ private void addSymbolRenamer(MultiFileEditProvider fileEdits, String file, SymbolNode currentNode, String name) {
+ SymbolItem currentItem = new SymbolItem(currentNode);
+ fileEdits.addEditProvider(new FileEditProvider(file, new MethodRenameEditProvider(currentItem, name)));
+ }
+
private void addCallRenamers(MultiFileEditProvider fileEdits) {
for(INodeWrapper currentCandidate : config.getSelectedCalls()){
String file = currentCandidate.getWrappedNode().getPosition().getFile();
- //Were expecting only MethodCallNodeWrappers in this refactoring
- CallCandidateItem candidateItem = new CallCandidateItem((MethodCallNodeWrapper)currentCandidate);
- fileEdits.addEditProvider(new FileEditProvider(file, new MethodRenameEditProvider(candidateItem, config.getNewName())));
+
+ String newName = config.getNewName();
+
+ if(currentCandidate instanceof MethodCallNodeWrapper) {
+ CallCandidateItem candidateItem = new CallCandidateItem((MethodCallNodeWrapper) currentCandidate);
+ fileEdits.addEditProvider(new FileEditProvider(file, new MethodRenameEditProvider(candidateItem, newName)));
+ } else if(config.renameFields()) {
+ if(config.getTargetMethod().isWriter()) {
+ newName = newName.replace("=", "");
+ }
+
+ FieldRenameEditProvider currentRenameProvider = new FieldRenameEditProvider((FieldItem) currentCandidate, newName);
+ fileEdits.addEditProvider(new FileEditProvider(file, currentRenameProvider));
+ }
}
}
@@ -129,12 +146,37 @@
continue;
}
String currentFile = currentMethodDef.getPosition().getFile();
- MethodNameArgumentItem argumentItem = new MethodNameArgumentItem(currentMethodDef.getWrappedNode().getNameNode());
- fileEdits.addEditProvider(new FileEditProvider(currentFile, new MethodRenameEditProvider(argumentItem, config.getNewName())));
+ addMethodNameRenamer(fileEdits, currentMethodDef, currentFile, config.getNewName());
}
}
+
+ if(config.getTargetMethod().isAccessor() && config.renameFields()) {
+ String theOtherAccessor;
+ String newName;
+ if(config.getTargetMethod().isReader()) {
+ theOtherAccessor = config.getTargetMethod().getName() + "=";
+ newName = config.getNewName() + "=";
+ } else {
+ theOtherAccessor = config.getTargetMethod().getName().replace("=", "");
+ newName = config.getNewName().replace("=", "");
+ }
+
+ MethodNodeWrapper method = config.getSelectedClass().getMethod(theOtherAccessor);
+ if(method != null) {
+ addMethodNameRenamer(fileEdits, method, method.getPosition().getFile(), newName);
+
+ for (SymbolNode node : method.getSymbolCandidatesInClass(config.getSelectedClass())) {
+ addSymbolRenamer(fileEdits, method.getPosition().getFile(), node, newName);
+ }
+ }
+ }
}
+ private void addMethodNameRenamer(MultiFileEditProvider fileEdits, MethodNodeWrapper currentMethodDef, String currentFile, String newName) {
+ MethodNameArgumentItem argumentItem = new MethodNameArgumentItem(currentMethodDef.getWrappedNode().getNameNode());
+ fileEdits.addEditProvider(new FileEditProvider(currentFile, new MethodRenameEditProvider(argumentItem, newName)));
+ }
+
private ArrayList<ClassNodeWrapper> findRelatedClasses() {
ClassNodeProvider projectClassProvider = config.getDocumentProvider().getProjectClassNodeProvider();
@@ -148,9 +190,9 @@
return config;
}
- public Collection<MethodCallNodeWrapper> getCallCandidatesInClass(){
+ public Collection<INodeWrapper> getCallCandidatesInClass(){
- ArrayList<MethodCallNodeWrapper> callCandidates = new ArrayList<MethodCallNodeWrapper>();
+ ArrayList<INodeWrapper> callCandidates = new ArrayList<INodeWrapper>();
if(config.getSelectedClass() != null){
for(ClassNodeWrapper currentClass : findRelatedClasses()){
Modified: 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/RenameMethodConditionChecker.java 2007-03-17 15:08:16 UTC (rev 2199)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/RenameMethodConditionChecker.java 2007-03-19 13:07:45 UTC (rev 2200)
@@ -42,10 +42,13 @@
import org.rubypeople.rdt.refactoring.core.NodeProvider;
import org.rubypeople.rdt.refactoring.core.RefactoringConditionChecker;
import org.rubypeople.rdt.refactoring.core.SelectionNodeProvider;
+import org.rubypeople.rdt.refactoring.core.renamefield.FieldProvider;
+import org.rubypeople.rdt.refactoring.core.renamefield.InstVarAccessesFinder;
import org.rubypeople.rdt.refactoring.documentprovider.DocumentWithIncluding;
import org.rubypeople.rdt.refactoring.exception.NoClassNodeException;
import org.rubypeople.rdt.refactoring.nodewrapper.ArgsNodeWrapper;
import org.rubypeople.rdt.refactoring.nodewrapper.ClassNodeWrapper;
+import org.rubypeople.rdt.refactoring.nodewrapper.INodeWrapper;
import org.rubypeople.rdt.refactoring.nodewrapper.MethodCallNodeWrapper;
import org.rubypeople.rdt.refactoring.nodewrapper.MethodNodeWrapper;
import org.rubypeople.rdt.refactoring.nodewrapper.PartialClassNodeWrapper;
@@ -58,7 +61,6 @@
public RenameMethodConditionChecker(RenameMethodConfig config) {
super(config);
}
-
@Override
public void init(IRefactoringConfig configObj) {
@@ -75,9 +77,8 @@
}
}
-
private void setSelectedMethodNode(Node rootNode) {
-
+
MethodDefNode methodNode = (MethodDefNode) SelectionNodeProvider.getSelectedNodeOfType(rootNode, this.config.getCaretPosition(), MethodDefNode.class);
if(methodNode == null) {
SymbolNode selectedSymbolNode = (SymbolNode) SelectionNodeProvider.getSelectedNodeOfType(rootNode, config.getCaretPosition(), SymbolNode.class);
@@ -88,17 +89,18 @@
}
}
}
- MethodDefinitionWrapper targetMethod = new MethodDefinitionWrapper(methodNode);
+
+ MethodNodeWrapper targetMethod = new MethodNodeWrapper(methodNode, config.getSelectedClass());
this.config.setTargetMethod(targetMethod);
if(methodNode != null && config.getNewName() == null) {
this.config.setNewName(targetMethod.getName());
}
}
- private Collection<MethodCallNodeWrapper> getAllCallCandidates() {
+ private Collection<INodeWrapper> getAllCallCandidates() {
Collection<Node> allNodes = config.getDocumentProvider().getAllNodes();
- ArrayList<MethodCallNodeWrapper> possibleCalls = new ArrayList<MethodCallNodeWrapper>();
+ ArrayList<INodeWrapper> possibleCalls = new ArrayList<INodeWrapper>();
for(Node currentNode : allNodes){
MethodCallNodeWrapper callNode = new MethodCallNodeWrapper(currentNode);
@@ -106,6 +108,22 @@
possibleCalls.add(callNode);
}
}
+
+ if(config.getTargetMethod().isAccessor() && config.renameFields()) {
+ String name;
+
+ if(config.getTargetMethod().isWriter()) {
+ name = config.getTargetMethod().getName().replace("=", "");
+
+ } else {
+ name = config.getTargetMethod().getName();
+ }
+
+ possibleCalls.addAll(InstVarAccessesFinder.find(config.getDocumentProvider(), name));
+ possibleCalls.addAll(new FieldProvider(config.getSelectedClass(), config.getDocumentProvider()).getFieldItems(name, false));
+ config.setSelectedCalls(new FieldProvider(config.getSelectedClass(), config.getDocumentProvider()).getFieldItems(name, false));
+ }
+
return possibleCalls;
}
@@ -183,15 +201,13 @@
public Collection<String> getAlreadyUsedNames() {
HashSet<String> usedNames = new HashSet<String>();
- try {
- Collection<MethodNodeWrapper> methods = config.getAllMethodsInClass();
-
- for (MethodNodeWrapper currentMethod : methods){
+ if(config.getSelectedClass() != null) {
+ for (MethodNodeWrapper currentMethod : config.getSelectedClass().getMethods()){
if(isSameTypeAsSelectedMethod(currentMethod)){
usedNames.add(currentMethod.getName());
}
}
- } catch (NoClassNodeException e) {
+ } else {
Node rootNode = config.getDocumentProvider().getActiveFileRootNode();
Collection<MethodDefNode> methods = NodeProvider.getMethodNodes(rootNode);
Modified: 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/RenameMethodConfig.java 2007-03-17 15:08:16 UTC (rev 2199)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/RenameMethodConfig.java 2007-03-19 13:07:45 UTC (rev 2200)
@@ -33,14 +33,10 @@
import java.util.ArrayList;
import java.util.Collection;
-import org.jruby.ast.Node;
import org.jruby.ast.SymbolNode;
-import org.rubypeople.rdt.refactoring.classnodeprovider.IncludedClassesProvider;
import org.rubypeople.rdt.refactoring.core.IRefactoringConfig;
-import org.rubypeople.rdt.refactoring.core.SelectionNodeProvider;
import org.rubypeople.rdt.refactoring.documentprovider.DocumentWithIncluding;
import org.rubypeople.rdt.refactoring.documentprovider.IDocumentProvider;
-import org.rubypeople.rdt.refactoring.exception.NoClassNodeException;
import org.rubypeople.rdt.refactoring.nodewrapper.ClassNodeWrapper;
import org.rubypeople.rdt.refactoring.nodewrapper.INodeWrapper;
import org.rubypeople.rdt.refactoring.nodewrapper.MethodNodeWrapper;
@@ -62,8 +58,10 @@
private ClassNodeWrapper classNode;
- private MethodDefinitionWrapper targetMethod;
+ private MethodNodeWrapper targetMethod;
+ private boolean renameFields = true;
+
public RenameMethodConfig(IDocumentProvider docProvider, int caretPosition) {
this.docProvider = docProvider;
this.caretPosition = caretPosition;
@@ -107,11 +105,11 @@
classNode = selectedClassNode;
}
- public void setTargetMethod(MethodDefinitionWrapper selectedMethod) {
+ public void setTargetMethod(MethodNodeWrapper selectedMethod) {
this.targetMethod = selectedMethod;
}
- public MethodDefinitionWrapper getTargetMethod() {
+ public MethodNodeWrapper getTargetMethod() {
return targetMethod;
}
@@ -126,16 +124,6 @@
public void setPossibleCalls(Collection<? extends INodeWrapper> possibleCalls){
this.possibleCalls = possibleCalls;
}
-
- public Collection<MethodNodeWrapper> getAllMethodsInClass() throws NoClassNodeException {
- Node rootNode = docProvider.getActiveFileRootNode();
- ClassNodeWrapper enclosingClass = SelectionNodeProvider.getSelectedClassNode(rootNode, targetMethod.getWrappedNode().getPosition().getStartOffset());
- IncludedClassesProvider classesProvider = new IncludedClassesProvider(docProvider);
- ClassNodeWrapper wholeClass = classesProvider.getClassNode(enclosingClass.getName());
-
- Collection<MethodNodeWrapper> methods = wholeClass.getMethods();
- return methods;
- }
public void setDocProvider(DocumentWithIncluding docProvider) {
this.docProvider = docProvider;
@@ -144,4 +132,12 @@
public void setDocumentProvider(IDocumentProvider doc) {
this.docProvider = doc;
}
+
+ public boolean renameFields() {
+ return renameFields;
+ }
+
+ public void setRenameFields(boolean renameFields) {
+ this.renameFields = renameFields;
+ }
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/StringDocumentProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/StringDocumentProvider.java 2007-03-17 15:08:16 UTC (rev 2199)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/StringDocumentProvider.java 2007-03-19 13:07:45 UTC (rev 2200)
@@ -41,11 +41,11 @@
protected Map<String, String> files;
- public StringDocumentProvider(String documentName, String document) {
+ public StringDocumentProvider(String name, String document) {
this.document = document;
- this.docName = documentName;
+ this.docName = name;
files = new LinkedHashMap<String, String>();
- files.put(documentName, document);
+ files.put(name, document);
}
public StringDocumentProvider(IDocumentProvider other) {
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/nodewrapper/ClassNodeWrapper.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/nodewrapper/ClassNodeWrapper.java 2007-03-17 15:08:16 UTC (rev 2199)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/nodewrapper/ClassNodeWrapper.java 2007-03-19 13:07:45 UTC (rev 2200)
@@ -93,7 +93,7 @@
public MethodNodeWrapper getConstructorNode() {
Collection<MethodNodeWrapper> constructors = getExistingConstructors();
if (constructors.isEmpty()) {
- return new MethodNodeWrapper(NodeFactory.createDefaultConstructor());
+ return new MethodNodeWrapper(NodeFactory.createDefaultConstructor(), this);
}
return constructors.toArray(new MethodNodeWrapper[constructors.size()])[constructors.size() - 1];
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/nodewrapper/MethodNodeWrapper.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/nodewrapper/MethodNodeWrapper.java 2007-03-17 15:08:16 UTC (rev 2199)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/nodewrapper/MethodNodeWrapper.java 2007-03-19 13:07:45 UTC (rev 2200)
@@ -28,12 +28,13 @@
package org.rubypeople.rdt.refactoring.nodewrapper;
+import java.util.ArrayList;
import java.util.Collection;
-import org.jruby.ast.DefnNode;
import org.jruby.ast.DefsNode;
import org.jruby.ast.MethodDefNode;
import org.jruby.ast.Node;
+import org.jruby.ast.SymbolNode;
import org.jruby.lexer.yacc.ISourcePosition;
import org.rubypeople.rdt.refactoring.core.NodeProvider;
import org.rubypeople.rdt.refactoring.signatureprovider.MethodSignature;
@@ -42,14 +43,11 @@
public class MethodNodeWrapper implements INodeWrapper {
protected MethodDefNode methodNode;
- private boolean isClassMethod;
- public MethodNodeWrapper(MethodDefNode methodDef) {
+ private final ClassNodeWrapper containingClass;
+
+ public MethodNodeWrapper(MethodDefNode methodDef, ClassNodeWrapper containingClass) {
this.methodNode = methodDef;
- if (methodNode instanceof DefnNode) {
- isClassMethod = false;
- } else if (methodNode instanceof DefsNode) {
- isClassMethod = true;
- }
+ this.containingClass = containingClass;
}
public String getName() {
@@ -57,8 +55,7 @@
}
public MethodSignature getSignature() {
- ArgsNodeWrapper argsNode = new ArgsNodeWrapper(methodNode.getArgsNode());
- return new MethodSignature(methodNode.getName(), argsNode);
+ return new MethodSignature(methodNode.getName(), getArgsNode());
}
public ArgsNodeWrapper getArgsNode() {
@@ -70,7 +67,7 @@
}
public boolean isClassMethod() {
- return isClassMethod;
+ return methodNode instanceof DefsNode;
}
public Collection<MethodCallNodeWrapper> getMethodCallNodes() {
@@ -81,7 +78,7 @@
public int hashCode() {
final int PRIME = 31;
int result = 1;
- result = PRIME * result + (isClassMethod ? 1231 : 1237);
+ result = PRIME * result + (isClassMethod() ? 1231 : 1237);
return result;
}
@@ -106,7 +103,49 @@
return methodNode.getScope().getVariables();
}
- public Node getScopeNode() {
+ public Node getBodyNode() {
return methodNode.getBodyNode();
}
+
+ public Collection<MethodCallNodeWrapper> getCallCandidatesInClass(ClassNodeWrapper classNode) {
+ if(classNode == null){
+ return new ArrayList<MethodCallNodeWrapper>();
+ }
+ return classNode.getMethodCalls(methodNode);
+ }
+
+ public Collection<SymbolNode> getSymbolCandidatesInClass(ClassNodeWrapper classNode) {
+ if(classNode == null){
+ return new ArrayList<SymbolNode>();
+ }
+ return classNode.getMethodSymbols(methodNode);
+ }
+
+ public boolean isAccessor() {
+ return isWriter() || isReader();
+ }
+
+ public boolean isWriter() {
+ if(containingClass == null) {
+ return false;
+ }
+ for (FieldNodeWrapper field : containingClass.getFields()) {
+ if ((field.getNameWithoutAts() + "=").equals(getName()) && getSignature().getArguments().size() == 1) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public boolean isReader() {
+ if(containingClass == null) {
+ return false;
+ }
+ for (FieldNodeWrapper field : containingClass.getFields()) {
+ if(field.getNameWithoutAts().equals(getName()) && getSignature().getArguments().isEmpty()) {
+ return true;
+ }
+ }
+ return false;
+ }
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/nodewrapper/PartialClassNodeWrapper.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/nodewrapper/PartialClassNodeWrapper.java 2007-03-17 15:08:16 UTC (rev 2199)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/nodewrapper/PartialClassNodeWrapper.java 2007-03-19 13:07:45 UTC (rev 2200)
@@ -114,7 +114,7 @@
methods = new ArrayList<MethodNodeWrapper>();
Collection<Node> methodNodes = NodeProvider.getSubNodes(wrappedNode, MethodDefNode.class);
for (Node methodNode : methodNodes) {
- methods.add(new MethodNodeWrapper((MethodDefNode) methodNode));
+ methods.add(new MethodNodeWrapper((MethodDefNode) methodNode, new ClassNodeWrapper(this)));
}
}
return methods;
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/signatureprovider/MethodSignature.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/signatureprovider/MethodSignature.java 2007-03-17 15:08:16 UTC (rev 2199)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/signatureprovider/MethodSignature.java 2007-03-19 13:07:45 UTC (rev 2200)
@@ -106,7 +106,4 @@
}
return false;
}
-
-
-
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/OccurenceReplaceSelectionPage.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/OccurenceReplaceSelectionPage.java 2007-03-17 15:08:16 UTC (rev 2199)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/OccurenceReplaceSelectionPage.java 2007-03-19 13:07:45 UTC (rev 2200)
@@ -117,7 +117,7 @@
private void initPossibilityTable(Composite control) {
possibilityTable = new Table(control, SWT.BORDER | SWT.CHECK);
- TreeSet<INodeWrapper> possibleCalls = new TreeSet<INodeWrapper>(new Comparator<INodeWrapper>(){
+ TreeSet<INodeWrapper> possibleCalls = new TreeSet<INodeWrapper>(new Comparator<INodeWrapper>() {
public int compare(INodeWrapper left, INodeWrapper right) {
return left.getWrappedNode().getPosition().getStartOffset() - right.getWrappedNode().getPosition().getStartOffset();
@@ -125,10 +125,10 @@
possibleCalls.addAll(selector.getPossibleCalls());
- for(INodeWrapper currentCall : possibleCalls){
+ for(INodeWrapper currentCall : possibleCalls) {
TableItem currentItem = new TableItem(possibilityTable, SWT.NONE);
currentItem.setText(getTableCaption(currentCall));
- if(probableCall(currentCall)){
+ if(probableCall(currentCall)) {
currentItem.setChecked(true);
}
currentItem.setData(currentCall);
@@ -153,6 +153,4 @@
private boolean hasSamePosition(INodeWrapper currentCall, INodeWrapper targetCall) {
return JRubyRefactoringUtils.hasSamePosition(currentCall.getWrappedNode(), targetCall.getWrappedNode());
}
-
-
}
Modified: 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.result 2007-03-17 15:08:16 UTC (rev 2199)
+++ trunk/org.rubypeople.rdt.refactoring.tests/resources/core/inlineclass/inline_class_test_10.activeFile.rb.result 2007-03-19 13:07:45 UTC (rev 2200)
@@ -33,7 +33,7 @@
@plant
end
def tree1
- @tree
+ @tree1
end
def goo
p 5
Added: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_16.activeFile.rb.result
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_16.activeFile.rb.result (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_16.activeFile.rb.result 2007-03-19 13:07:45 UTC (rev 2200)
@@ -0,0 +1,5 @@
+class Test
+ def foo
+ @foo
+ end
+end
\ No newline at end of file
Added: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_16.activeFile.rb.source
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_16.activeFile.rb.source (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_16.activeFile.rb.source 2007-03-19 13:07:45 UTC (rev 2200)
@@ -0,0 +1,5 @@
+class Test
+ def wunder
+ @wunder
+ end
+end
\ No newline at end of file
Added: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_16.test_properties
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_16.test_properties (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_16.test_properties 2007-03-19 13:07:45 UTC (rev 2200)
@@ -0,0 +1,4 @@
+activeFile=activeFile.rb
+destinationFiles=
+caretPosition=18
+newName=foo
\ No newline at end of file
Added: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_17.activeFile.rb.result
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_17.activeFile.rb.result (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_17.activeFile.rb.result 2007-03-19 13:07:45 UTC (rev 2200)
@@ -0,0 +1,8 @@
+class Test
+ def foo
+ @foo
+ end
+ def foo= value
+ @foo = value
+ end
+end
\ No newline at end of file
Added: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_17.activeFile.rb.source
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_17.activeFile.rb.source (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_17.activeFile.rb.source 2007-03-19 13:07:45 UTC (rev 2200)
@@ -0,0 +1,8 @@
+class Test
+ def wunder
+ @wunder
+ end
+ def wunder= value
+ @wunder = value
+ end
+end
\ No newline at end of file
Added: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_17.test_properties
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_17.test_properties (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_17.test_properties 2007-03-19 13:07:45 UTC (rev 2200)
@@ -0,0 +1,4 @@
+activeFile=activeFile.rb
+destinationFiles=
+caretPosition=18
+newName=foo
\ No newline at end of file
Added: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_18.activeFile.rb.result
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_18.activeFile.rb.result (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_18.activeFile.rb.result 2007-03-19 13:07:45 UTC (rev 2200)
@@ -0,0 +1,10 @@
+class Test
+ def foo
+ @foo
+ end
+ public :foo
+
+ def foo= value
+ @foo = value
+ end
+end
\ No newline at end of file
Added: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_18.activeFile.rb.source
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_18.activeFile.rb.source (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_18.activeFile.rb.source 2007-03-19 13:07:45 UTC (rev 2200)
@@ -0,0 +1,10 @@
+class Test
+ def wunder
+ @wunder
+ end
+ public :wunder
+
+ def wunder= value
+ @wunder = value
+ end
+end
\ No newline at end of file
Added: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_18.test_properties
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_18.test_properties (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/resources/core/renamemethod/rename_method_test_18.test_properties 2007-03-19 13:07:45 UTC (rev 2200)
@@ -0,0 +1,4 @@
+activeFile=activeFile.rb
+destinationFiles=
+caretPosition=18
+newName=foo
\ No newline at end of file
Modified: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/TS_All.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/TS_All.java 2007-03-17 15:08:16 UTC (rev 2199)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/TS_All.java 2007-03-19 13:07:45 UTC (rev 2200)
@@ -46,6 +46,7 @@
import org.rubypeople.rdt.refactoring.tests.core.mergewithexternalclassparts.TS_MergeWithExternalClassParts;
import org.rubypeople.rdt.refactoring.tests.core.movefield.TS_MoveField;
import org.rubypeople.rdt.refactoring.tests.core.movemethod.TS_MoveMethod;
+import org.rubypeople.rdt.refactoring.tests.core.nodewrapper.TS_NodeWrapper;
import org.rubypeople.rdt.refactoring.tests.core.overridemethod.TS_OverrideMethod;
import org.rubypeople.rdt.refactoring.tests.core.pushdown.TS_PushDown;
import org.rubypeople.rdt.refactoring.tests.core.rename.TS_Rename;
@@ -86,6 +87,7 @@
suite.addTest(TS_MoveMethod.suite());
suite.addTest(TS_MoveField.suite());
suite.addTest(TS_Rename.suite());
+ suite.addTest(TS_NodeWrapper.suite());
return suite;
}
Modified: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/nodewrapper/TS_NodeWrapper.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/nodewrapper/TS_NodeWrapper.java 2007-03-17 15:08:16 UTC (rev 2199)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/nodewrapper/TS_NodeWrapper.java 2007-03-19 13:07:45 UTC (rev 2200)
@@ -34,6 +34,7 @@
public static TestSuite suite() {
TestSuite suite = new TestSuite("Node Wrapper");
suite.addTestSuite(TC_FieldNodeWrapper.class);
+ suite.addTestSuite(TC_MethodNodeWrapper.class);
return suite;
}
}
Modified: 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/RenameMethodSelectionTester.java 2007-03-17 15:08:16 UTC (rev 2199)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamemethod/selection/RenameMethodSelectionTester.java 2007-03-19 13:07:45 UTC (rev 2200)
@@ -39,41 +39,41 @@
import org.rubypeople.rdt.refactoring.core.renamemethod.MethodRenamer;
import org.rubypeople.rdt.refactoring.core.renamemethod.RenameMethodConditionChecker;
import org.rubypeople.rdt.refactoring.core.renamemethod.RenameMethodConfig;
-import org.rubypeople.rdt.refactoring.nodewrapper.MethodCallNodeWrapper;
+import org.rubypeople.rdt.refactoring.nodewrapper.INodeWrapper;
import org.rubypeople.rdt.refactoring.tests.MultiFileTestData;
import org.rubypeople.rdt.refactoring.tests.RefactoringTestCase;
-public class RenameMethodSelectionTester extends RefactoringTestCase{
+public class RenameMethodSelectionTester extends RefactoringTestCase {
private String fileName;
+
private MultiFileTestData testData;
-
- public RenameMethodSelectionTester(String fileName)
- {
+
+ public RenameMethodSelectionTester(String fileName) {
this.fileName = fileName;
}
-
+
@Override
public void runTest() throws FileNotFoundException, IOException, BadLocationException {
- testData = new MultiFileTestData(fileName);
- int caretPosition = testData.getIntProperty("caretPosition");
-
- RenameMethodConfig config = new RenameMethodConfig(testData, caretPosition);
- new RenameMethodConditionChecker(config);
-
- MethodRenamer renamer = new MethodRenamer(config);
- config.setNewName(testData.getProperty("newName"));
-
- Collection<MethodCallNodeWrapper> calls = renamer.getCallCandidatesInClass();
- calls.addAll(renamer.getSubsequentCalls());
- config.setSelectedCalls(calls);
-
- Collection<SymbolNode> symbols = renamer.getSymbolCandidatesInClass();
- config.setRenamedSymbols(symbols);
-
- checkMultiFileEdits(renamer, testData);
+ testData = new MultiFileTestData(fileName);
+ int caretPosition = testData.getIntProperty("caretPosition");
+
+ RenameMethodConfig config = new RenameMethodConfig(testData, caretPosition);
+ new RenameMethodConditionChecker(config);
+
+ MethodRenamer renamer = new MethodRenamer(config);
+ config.setNewName(testData.getProperty("newName"));
+
+ Collection<INodeWrapper> calls = renamer.getCallCandidatesInClass();
+ calls.addAll(renamer.getSubsequentCalls());
+ config.setSelectedCalls(calls);
+
+ Collection<SymbolNode> symbols = renamer.getSymbolCandidatesInClass();
+ config.setRenamedSymbols(symbols);
+
+ checkMultiFileEdits(renamer, testData);
}
-
+
@Override
public String getName() {
return fileName;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-03-18 13:43:06
|
Revision: 2199
http://svn.sourceforge.net/rubyeclipse/?rev=2199&view=rev
Author: cawilliams
Date: 2007-03-17 08:08:16 -0700 (Sat, 17 Mar 2007)
Log Message:
-----------
call new hooks in RubyLintVisitors when appropriate
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/DelegatingVisitor.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/DelegatingVisitor.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/DelegatingVisitor.java 2007-03-17 15:02:31 UTC (rev 2198)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/DelegatingVisitor.java 2007-03-17 15:08:16 UTC (rev 2199)
@@ -138,7 +138,7 @@
}
return super.visitAliasNode(iVisited);
}
-
+
@Override
public Instruction visitAndNode(AndNode iVisited) {
for (RubyLintVisitor visitor : visitors) {
@@ -224,7 +224,11 @@
for (RubyLintVisitor visitor : visitors) {
visitor.visitBlockNode(iVisited);
}
- return super.visitBlockNode(iVisited);
+ Instruction ins = super.visitBlockNode(iVisited);
+ for (RubyLintVisitor visitor : visitors) {
+ visitor.exitBlockNode(iVisited);
+ }
+ return ins;
}
@Override
@@ -264,7 +268,11 @@
for (RubyLintVisitor visitor : visitors) {
visitor.visitClassNode(iVisited);
}
- return super.visitClassNode(iVisited);
+ Instruction ins = super.visitClassNode(iVisited);
+ for (RubyLintVisitor visitor : visitors) {
+ visitor.exitClassNode(iVisited);
+ }
+ return ins;
}
@Override
@@ -344,7 +352,11 @@
for (RubyLintVisitor visitor : visitors) {
visitor.visitDefnNode(iVisited);
}
- return super.visitDefnNode(iVisited);
+ Instruction ins = super.visitDefnNode(iVisited);
+ for (RubyLintVisitor visitor : visitors) {
+ visitor.exitDefnNode(iVisited);
+ }
+ return ins;
}
@Override
@@ -352,9 +364,14 @@
for (RubyLintVisitor visitor : visitors) {
visitor.visitDefsNode(iVisited);
}
- return super.visitDefsNode(iVisited);
+ Instruction ins = super.visitDefsNode(iVisited);
+ for (RubyLintVisitor visitor : visitors) {
+ visitor.exitDefsNode(iVisited);
+ }
+ return ins;
}
+
@Override
public Instruction visitDotNode(DotNode iVisited) {
for (RubyLintVisitor visitor : visitors) {
@@ -496,7 +513,11 @@
for (RubyLintVisitor visitor : visitors) {
visitor.visitIfNode(iVisited);
}
- return super.visitIfNode(iVisited);
+ Instruction ins = super.visitIfNode(iVisited);
+ for (RubyLintVisitor visitor : visitors) {
+ visitor.exitIfNode(iVisited);
+ }
+ return ins;
}
@Override
@@ -568,7 +589,11 @@
for (RubyLintVisitor visitor : visitors) {
visitor.visitModuleNode(iVisited);
}
- return super.visitModuleNode(iVisited);
+ Instruction ins = super.visitModuleNode(iVisited);
+ for (RubyLintVisitor visitor : visitors) {
+ visitor.exitModuleNode(iVisited);
+ }
+ return ins;
}
@Override
@@ -736,7 +761,11 @@
for (RubyLintVisitor visitor : visitors) {
visitor.visitSClassNode(iVisited);
}
- return super.visitSClassNode(iVisited);
+ Instruction ins = super.visitSClassNode(iVisited);
+ for (RubyLintVisitor visitor : visitors) {
+ visitor.exitSClassNode(iVisited);
+ }
+ return ins;
}
@Override
@@ -840,7 +869,11 @@
for (RubyLintVisitor visitor : visitors) {
visitor.visitWhenNode(iVisited);
}
- return super.visitWhenNode(iVisited);
+ Instruction ins = super.visitWhenNode(iVisited);
+ for (RubyLintVisitor visitor : visitors) {
+ visitor.exitWhenNode(iVisited);
+ }
+ return ins;
}
@Override
@@ -883,4 +916,4 @@
return super.visitZSuperNode(iVisited);
}
-}
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-03-18 13:42:35
|
Revision: 2198
http://svn.sourceforge.net/rubyeclipse/?rev=2198&view=rev
Author: cawilliams
Date: 2007-03-17 08:02:31 -0700 (Sat, 17 Mar 2007)
Log Message:
-----------
add more hooks to perform analysis
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/RubyLintVisitor.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/RubyLintVisitor.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/RubyLintVisitor.java 2007-03-16 19:44:25 UTC (rev 2197)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/warnings/RubyLintVisitor.java 2007-03-17 15:02:31 UTC (rev 2198)
@@ -1,6 +1,14 @@
package org.rubypeople.rdt.internal.core.parser.warnings;
+import org.jruby.ast.BlockNode;
+import org.jruby.ast.ClassNode;
+import org.jruby.ast.DefnNode;
+import org.jruby.ast.DefsNode;
+import org.jruby.ast.IfNode;
+import org.jruby.ast.ModuleNode;
import org.jruby.ast.Node;
+import org.jruby.ast.SClassNode;
+import org.jruby.ast.WhenNode;
import org.jruby.ast.visitor.AbstractVisitor;
import org.jruby.evaluator.Instruction;
import org.jruby.lexer.yacc.ISourcePosition;
@@ -47,7 +55,55 @@
* @return a String key
*/
abstract protected String getOptionKey();
+
+ /**
+ * Meant to be overriden by classes needing to perform some action when a class definition was exited.
+ * @param iVisited
+ */
+ public void exitClassNode(ClassNode iVisited) {}
+
+ /**
+ * To be overriden by subclasses who need to run particular behavior/code when exiting a method definition.
+ * @param iVisited
+ */
+ public void exitDefnNode(DefnNode iVisited) {}
+
+ /**
+ * To be overriden by subclasses who need to run particular behavior/code when exiting a singleton method definition.
+ * @param iVisited
+ */
+ public void exitIfNode(IfNode iVisited) {}
+
+ /**
+ * To be overriden by subclasses who need to run particular behavior/code when exiting a singleton method definition.
+ * @param iVisited
+ */
+ public void exitBlockNode(BlockNode iVisited) {}
+
+ /**
+ * To be overriden by subclasses who need to run particular behavior/code when exiting a singleton method definition.
+ * @param iVisited
+ */
+ public void exitDefsNode(DefsNode iVisited) {}
+
+ /**
+ * To be overriden by subclasses who need to run particular behavior/code when exiting a singleton method definition.
+ * @param iVisited
+ */
+ public void exitModuleNode(ModuleNode iVisited) {}
+ /**
+ * To be overriden by subclasses who need to run particular behavior/code when exiting a singleton method definition.
+ * @param iVisited
+ */
+ public void exitWhenNode(WhenNode iVisited) {}
+
+ /**
+ * To be overriden by subclasses who need to run particular behavior/code when exiting a singleton method definition.
+ * @param iVisited
+ */
+ public void exitSClassNode(SClassNode iVisited) {}
+
protected int getProblemID() {
return IProblem.Uncategorized;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|