You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
(41) |
Apr
(9) |
May
|
Jun
|
Jul
(39) |
Aug
(38) |
Sep
(135) |
Oct
(220) |
Nov
(75) |
Dec
(74) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(44) |
Feb
(160) |
Mar
(49) |
Apr
(69) |
May
(40) |
Jun
(52) |
Jul
(47) |
Aug
(51) |
Sep
(19) |
Oct
(22) |
Nov
(36) |
Dec
(76) |
| 2007 |
Jan
(154) |
Feb
(165) |
Mar
(186) |
Apr
(143) |
May
(175) |
Jun
(133) |
Jul
(203) |
Aug
(177) |
Sep
(136) |
Oct
|
Nov
|
Dec
|
|
From: <caw...@us...> - 2007-02-11 19:56:17
|
Revision: 1947
http://svn.sourceforge.net/rubyeclipse/?rev=1947&view=rev
Author: cawilliams
Date: 2007-02-11 11:55:56 -0800 (Sun, 11 Feb 2007)
Log Message:
-----------
try to fix using classic debugger
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RDebugVMDebugger.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMDebugger.java
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RDebugVMDebugger.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RDebugVMDebugger.java 2007-02-10 20:25:06 UTC (rev 1946)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RDebugVMDebugger.java 2007-02-11 19:55:56 UTC (rev 1947)
@@ -1,7 +1,5 @@
package org.rubypeople.rdt.internal.launching;
-import java.io.File;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -12,7 +10,6 @@
import org.eclipse.debug.core.ILaunch;
import org.rubypeople.rdt.internal.debug.core.RubyDebuggerProxy;
import org.rubypeople.rdt.internal.debug.core.model.RubyDebugTarget;
-import org.rubypeople.rdt.internal.debug.core.model.RubyProcessingException;
import org.rubypeople.rdt.launching.IRubyLaunchConfigurationConstants;
import org.rubypeople.rdt.launching.IVMInstall;
import org.rubypeople.rdt.launching.VMRunnerConfiguration;
@@ -58,4 +55,8 @@
return arguments;
}
+ protected RubyDebuggerProxy getDebugProxy(RubyDebugTarget debugTarget) {
+ return new RubyDebuggerProxy(debugTarget, RDebugVMDebugger.getDirectoryOfRubyDebuggerFile(), true);
+ }
+
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMDebugger.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMDebugger.java 2007-02-10 20:25:06 UTC (rev 1946)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMDebugger.java 2007-02-11 19:55:56 UTC (rev 1947)
@@ -122,7 +122,7 @@
subMonitor.subTask(LaunchingMessages.StandardVMDebugger_Establishing_debug_connection____5);
debugTarget.setProcess(process);
- RubyDebuggerProxy proxy = new RubyDebuggerProxy(debugTarget, RDebugVMDebugger.getDirectoryOfRubyDebuggerFile(), true);
+ RubyDebuggerProxy proxy = getDebugProxy(debugTarget);
try {
proxy.start();
launch.addDebugTarget(debugTarget);
@@ -138,6 +138,10 @@
// }
}
+ protected RubyDebuggerProxy getDebugProxy(RubyDebugTarget debugTarget) {
+ return new RubyDebuggerProxy(debugTarget, RDebugVMDebugger.getDirectoryOfRubyDebuggerFile(), false);
+ }
+
protected List<String> debugSpecificVMArgs(RubyDebugTarget debugTarget) {
List<String> arguments = new ArrayList<String>();
if (!debugTarget.isUsingDefaultPort()) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-10 20:25:07
|
Revision: 1946
http://svn.sourceforge.net/rubyeclipse/?rev=1946&view=rev
Author: cawilliams
Date: 2007-02-10 12:25:06 -0800 (Sat, 10 Feb 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.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-02-10 20:21:33 UTC (rev 1945)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-02-10 20:25:06 UTC (rev 1946)
@@ -327,7 +327,7 @@
}
if (!context.prefixStartsWith(name))
continue;
- NodeMethod method = new NodeMethod(methodDefinition);
+ NodeMethod method = new NodeMethod((MethodDefNode)methodDefinition);
suggestMethod(method, typeName, 100);
}
addTypesVariables(typeNode);
@@ -463,15 +463,14 @@
private class NodeMethod implements IMethod {
- private Node node;
+ private MethodDefNode node;
- public NodeMethod(Node methodDefinition) {
+ public NodeMethod(MethodDefNode methodDefinition) {
this.node = methodDefinition;
}
public String[] getParameterNames() throws RubyModelException {
- // TODO Auto-generated method stub
- return null;
+ return ASTUtil.getArgs(node.getArgsNode(), node.getScope());
}
public int getVisibility() throws RubyModelException {
@@ -480,14 +479,11 @@
}
public boolean isConstructor() {
- if (node instanceof DefnNode) {
- return ((DefnNode)node).getName().equals("initialize");
- }
- return false;
+ return node.getName().equals("initialize");
}
public boolean isSingleton() {
- return node instanceof DefsNode;
+ return isConstructor() || node instanceof DefsNode;
}
public boolean exists() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-10 20:21:35
|
Revision: 1945
http://svn.sourceforge.net/rubyeclipse/?rev=1945&view=rev
Author: cawilliams
Date: 2007-02-10 12:21:33 -0800 (Sat, 10 Feb 2007)
Log Message:
-----------
an instance method is actually "static"/class-level if it is a constructor. Don't show instance level methods when it looks like we're invoking completion on the type
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyMethod.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java 2007-02-10 20:00:17 UTC (rev 1944)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java 2007-02-10 20:21:33 UTC (rev 1945)
@@ -124,4 +124,8 @@
return !emptyPrefix() && !isMethodInvokation() && getPartialPrefix().startsWith("$");
}
+ public boolean fullPrefixIsConstant() {
+ return Character.isUpperCase(getFullPrefix().charAt(0));
+ }
+
}
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-02-10 20:00:17 UTC (rev 1944)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-02-10 20:21:33 UTC (rev 1945)
@@ -150,9 +150,14 @@
int flags = Flags.AccDefault;
if (method.isSingleton()) {
flags |= Flags.AccStatic;
- name = name.substring(typeName.length() + 1);
+ if (method.isConstructor())
+ name = "new";
+ else
+ name = name.substring(typeName.length() + 1);
} else {
-// FIXME Don't show instance methods if the thing we're working on is a constant (class name)!
+ // Don't show instance methods if the thing we're working on is a class' name!
+ // FIXME We do want to show if it is a constant, but not a class name
+ if (context.fullPrefixIsConstant()) return;
}
if (!context.prefixStartsWith(name))
return;
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyMethod.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyMethod.java 2007-02-10 20:00:17 UTC (rev 1944)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyMethod.java 2007-02-10 20:21:33 UTC (rev 1945)
@@ -101,6 +101,7 @@
* @see org.rubypeople.rdt.core.IRubyMethod#getVisibility()
*/
public int getVisibility() throws RubyModelException {
+ if (isConstructor()) return IMethod.PUBLIC;
RubyMethodElementInfo info = (RubyMethodElementInfo) getElementInfo();
return info.getVisibility();
}
@@ -110,7 +111,7 @@
}
public boolean isSingleton() {
- return false;
+ return isConstructor();
}
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-10 20:00:20
|
Revision: 1944
http://svn.sourceforge.net/rubyeclipse/?rev=1944&view=rev
Author: cawilliams
Date: 2007-02-10 12:00:17 -0800 (Sat, 10 Feb 2007)
Log Message:
-----------
fix xome more cases for completion (don't read back until a sapce for full prefix, read back until space, comma, or opening bracket/brace/paren
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java 2007-02-09 15:08:44 UTC (rev 1943)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java 2007-02-10 20:00:17 UTC (rev 1944)
@@ -45,7 +45,8 @@
offset = i - 1;
if (partialPrefix == null) this.partialPrefix = tmpPrefix.toString();
}
- if (Character.isWhitespace(curChar)) {
+ // FIXME This logic is very much like RubyWordDetector in the UI!
+ if (Character.isWhitespace(curChar) || curChar == ',' || curChar == '(' || curChar == '[' || curChar == '{') {
offset = i + 1;
break;
}
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-02-09 15:08:44 UTC (rev 1943)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-02-10 20:00:17 UTC (rev 1944)
@@ -1,6 +1,5 @@
package org.rubypeople.rdt.internal.codeassist;
-import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
@@ -75,11 +74,11 @@
}
if (context.isMethodInvokation()) {
ITypeInferrer inferrer = new DefaultTypeInferrer();
- List<ITypeGuess> guesses = inferrer.infer(context.getSource(), context.getOffset());
+ List<ITypeGuess> guesses = inferrer.infer(context.getCorrectedSource(), context.getOffset());
RubyElementRequestor requestor = new RubyElementRequestor(script);
for (ITypeGuess guess : guesses) {
String name = guess.getType();
- IType[] types = requestor.findType(name);
+ IType[] types = requestor.findType(name); // FIXME When syntax is broken, grabbing type that is defined in same script like this just doesn't work!
for (int i = 0; i < types.length; i++) {
suggestMethods(guess.getConfidence(), types[i]);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-09 15:08:46
|
Revision: 1943
http://svn.sourceforge.net/rubyeclipse/?rev=1943&view=rev
Author: cawilliams
Date: 2007-02-09 07:08:44 -0800 (Fri, 09 Feb 2007)
Log Message:
-----------
remove some duplicated code
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/util/ASTUtil.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/DefaultOccurrencesFinder.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-02-09 14:39:35 UTC (rev 1942)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-02-09 15:08:44 UTC (rev 1943)
@@ -43,6 +43,7 @@
import org.rubypeople.rdt.internal.core.RubyType;
import org.rubypeople.rdt.internal.core.parser.RubyParser;
import org.rubypeople.rdt.internal.core.search.ExperimentalIndex;
+import org.rubypeople.rdt.internal.core.util.ASTUtil;
import org.rubypeople.rdt.internal.ti.DefaultTypeInferrer;
import org.rubypeople.rdt.internal.ti.ITypeGuess;
import org.rubypeople.rdt.internal.ti.ITypeInferrer;
@@ -351,7 +352,7 @@
if (instanceAndClassVars != null) {
// Get the unique names of instance and class variables
for (Node varNode : instanceAndClassVars) {
- String name = getNameReflectively(varNode);
+ String name = ASTUtil.getNameReflectively(varNode);
if (!context.prefixStartsWith(name))
continue;
fields.add(name);
@@ -455,26 +456,6 @@
return new ArrayList<String>(0);
}
}
-
- /**
- * Gets the name of a node by reflectively invoking "getName()" on it;
- * helper method just to cut many "instanceof/cast" pairs.
- *
- * @param node
- * @return name or null
- */
- // TODO Copy/pasted from DefaultOccurrencesFinder, refactor these two
- // methods to a common location.
- private String getNameReflectively(Node node) {
- try {
- Method getNameMethod = node.getClass().getMethod("getName", new Class[] {});
- Object name = getNameMethod.invoke(node, new Object[0]);
- return (String) name;
- } catch (Exception e) {
- return null;
- }
- }
-
private class NodeMethod implements IMethod {
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/ASTUtil.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/ASTUtil.java 2007-02-09 14:39:35 UTC (rev 1942)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/ASTUtil.java 2007-02-09 15:08:44 UTC (rev 1943)
@@ -1,5 +1,6 @@
package org.rubypeople.rdt.internal.core.util;
+import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -133,4 +134,24 @@
return buffer.toString();
}
+ /**
+ * Gets the name of a node by reflectively invoking "getName()" on it;
+ * helper method just to cut many "instanceof/cast" pairs.
+ *
+ * @param node
+ * @return name or null
+ */
+ public static String getNameReflectively(Node node) {
+ if (node instanceof INameNode) {
+ return ((INameNode)node).getName();
+ }
+ try {
+ Method getNameMethod = node.getClass().getMethod("getName", new Class[] {});
+ Object name = getNameMethod.invoke(node, new Object[0]);
+ return (String) name;
+ } catch (Exception e) {
+ return null;
+ }
+ }
+
}
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/DefaultOccurrencesFinder.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/DefaultOccurrencesFinder.java 2007-02-09 14:39:35 UTC (rev 1942)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/DefaultOccurrencesFinder.java 2007-02-09 15:08:44 UTC (rev 1943)
@@ -1,6 +1,5 @@
package org.rubypeople.rdt.internal.ti;
-import java.lang.reflect.Method;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
@@ -27,11 +26,11 @@
import org.jruby.ast.ModuleNode;
import org.jruby.ast.Node;
import org.jruby.ast.SymbolNode;
-import org.jruby.ast.types.INameNode;
import org.jruby.lexer.yacc.ISourcePosition;
import org.jruby.lexer.yacc.SourcePosition;
import org.jruby.lexer.yacc.SyntaxException;
import org.rubypeople.rdt.internal.core.parser.RubyParser;
+import org.rubypeople.rdt.internal.core.util.ASTUtil;
import org.rubypeople.rdt.internal.ti.util.FirstPrecursorNodeLocator;
import org.rubypeople.rdt.internal.ti.util.INodeAcceptor;
import org.rubypeople.rdt.internal.ti.util.OffsetNodeLocator;
@@ -39,186 +38,199 @@
/**
* Implements "Mark Occurences" feature
+ *
* @author Jason Morrison
- *
+ *
*/
-public class DefaultOccurrencesFinder extends AbstractOccurencesFinder {
+public class DefaultOccurrencesFinder extends AbstractOccurencesFinder {
// Root of the document to search
private Node root;
-
+
// Originating node; corresponds to cursor selection
private Node orig;
-
+
// Original source
private String source;
-
+
public String initialize(String source, int offset, int length) {
- if ( source == null ) { return null; }
-
+ if (source == null) {
+ return null;
+ }
+
this.source = source;
try {
RubyParser rubyParser = new RubyParser();
this.root = rubyParser.parse(source);
- if ( this.root == null ) { return null; }
+ if (this.root == null) {
+ return null;
+ }
}
- //TODO: Is there anything else the parsing could choke on that should be silently ignored with no markings?
- catch (SyntaxException se)
- {
+ // TODO: Is there anything else the parsing could choke on that should
+ // be silently ignored with no markings?
+ catch (SyntaxException se) {
this.root = null;
return null;
}
this.orig = OffsetNodeLocator.Instance().getNodeAtOffset(root, offset);
- if ( orig == null ) { return null; }
- if ( orig.getPosition().getEndOffset() > offset + length )
- {
+ if (orig == null) {
+ return null;
+ }
+ if (orig.getPosition().getEndOffset() > offset + length) {
// Selection spans nodes; not handling that for now.
return "Selection spans nodes; can only search for a single node.";
}
-
+
return null;
}
/**
- * Determines the kind of originating node, and collects occurrences accordingly
+ * Determines the kind of originating node, and collects occurrences
+ * accordingly
*/
public List<Position> perform() {
- // Mark no occurrences if root is null (AST couldn't be parsed correctly.)
- if ( root == null ) return new LinkedList<Position>();
- if ( orig == null ) return new LinkedList<Position>();
-
+ // Mark no occurrences if root is null (AST couldn't be parsed
+ // correctly.)
+ if (root == null)
+ return new LinkedList<Position>();
+ if (orig == null)
+ return new LinkedList<Position>();
+
// occurrences to return
List<ISourcePosition> occurrences = new LinkedList<ISourcePosition>();
- if ( fMarkLocalVariableOccurrences && isLocalVarRef(orig) ) {
- pushLocalVarRefs( root, orig, occurrences );
- }
-
- if ( fMarkLocalVariableOccurrences && isDVarRef(orig) ) {
- pushDVarRefs( root, orig, occurrences );
- }
-
- //XXX: Add pref for instvars
- if ( fMarkLocalVariableOccurrences && isInstanceVarRef(orig) ) {
- pushInstVarRefs( root, orig, occurrences );
- }
-
- //XXX: Add pref for classvars
- if ( fMarkLocalVariableOccurrences && isClassVarRef(orig) ) {
- pushClassVarRefs( root, orig, occurrences );
- }
-
- //XXX: Add pref for global vars
- if ( fMarkLocalVariableOccurrences && isGlobalVarRef(orig) ) {
- pushGlobalVarRefs( root, orig, occurrences );
- }
-
- //XXX: Add pref for symbols
- if ( fMarkConstantOccurrences && orig instanceof SymbolNode ) {
- pushSymbolRefs( root, orig, occurrences );
- }
-
+ if (fMarkLocalVariableOccurrences && isLocalVarRef(orig)) {
+ pushLocalVarRefs(root, orig, occurrences);
+ }
+
+ if (fMarkLocalVariableOccurrences && isDVarRef(orig)) {
+ pushDVarRefs(root, orig, occurrences);
+ }
+
+ // XXX: Add pref for instvars
+ if (fMarkLocalVariableOccurrences && isInstanceVarRef(orig)) {
+ pushInstVarRefs(root, orig, occurrences);
+ }
+
+ // XXX: Add pref for classvars
+ if (fMarkLocalVariableOccurrences && isClassVarRef(orig)) {
+ pushClassVarRefs(root, orig, occurrences);
+ }
+
+ // XXX: Add pref for global vars
+ if (fMarkLocalVariableOccurrences && isGlobalVarRef(orig)) {
+ pushGlobalVarRefs(root, orig, occurrences);
+ }
+
+ // XXX: Add pref for symbols
+ if (fMarkConstantOccurrences && orig instanceof SymbolNode) {
+ pushSymbolRefs(root, orig, occurrences);
+ }
+
// if ( isMethodRefNode(orig)) {
// pushMethodRefs( root, orig, occurrences );
// }
-
- if ( fMarkConstantOccurrences && isConstRef(orig) )
- {
- pushConstRefs( root, orig, occurrences );
- }
-
- if ( fMarkTypeOccurrences && isTypeRef(orig) )
- {
- pushTypeRefs( root, orig, occurrences );
- }
-
- // Convert ISourcePosition to IPosition
- List<Position> positions = new LinkedList<Position>();
- for (ISourcePosition occurrence : occurrences) {
- Position position = new Position(occurrence.getStartOffset(),occurrence.getEndOffset() - occurrence.getStartOffset());
- positions.add(position);
+
+ if (fMarkConstantOccurrences && isConstRef(orig)) {
+ pushConstRefs(root, orig, occurrences);
}
-
- // Uniqueify positions
- positions = new LinkedList<Position>( new HashSet<Position>(positions) );
-
- return positions;
+
+ if (fMarkTypeOccurrences && isTypeRef(orig)) {
+ pushTypeRefs(root, orig, occurrences);
+ }
+
+ // Convert ISourcePosition to IPosition
+ List<Position> positions = new LinkedList<Position>();
+ for (ISourcePosition occurrence : occurrences) {
+ Position position = new Position(occurrence.getStartOffset(), occurrence.getEndOffset() - occurrence.getStartOffset());
+ positions.add(position);
+ }
+
+ // Uniqueify positions
+ positions = new LinkedList<Position>(new HashSet<Position>(positions));
+
+ return positions;
}
-
+
// ****************************************************************************
// *
// * Reference kind definitions
// *
// ****************************************************************************
-
/**
* Determines whether a given node is a local variable reference
+ *
* @param node
* @return
*/
- private boolean isLocalVarRef( Node node ) {
- return ( ( node instanceof LocalAsgnNode ) || ( node instanceof ArgumentNode ) || ( node instanceof LocalVarNode ) );
+ private boolean isLocalVarRef(Node node) {
+ return ((node instanceof LocalAsgnNode) || (node instanceof ArgumentNode) || (node instanceof LocalVarNode));
}
/**
* Determines whether a given node is a dynamic variable reference
+ *
* @param node
* @return
*/
- private boolean isDVarRef( Node node ) {
- return ( ( node instanceof DVarNode ) || ( node instanceof DAsgnNode ) );
+ private boolean isDVarRef(Node node) {
+ return ((node instanceof DVarNode) || (node instanceof DAsgnNode));
}
/**
* Determines whether a given node is an instance variable reference
+ *
* @param node
* @return
*/
- private boolean isInstanceVarRef( Node node ) {
- return ( ( node instanceof InstAsgnNode ) || ( node instanceof InstVarNode ) ) ;
+ private boolean isInstanceVarRef(Node node) {
+ return ((node instanceof InstAsgnNode) || (node instanceof InstVarNode));
}
/**
* Determines whether a given node is a class variable reference
+ *
* @param node
* @return
*/
- private boolean isClassVarRef( Node node ) {
- return ( ( node instanceof ClassVarNode ) || ( node instanceof ClassVarAsgnNode ) || ( node instanceof ClassVarDeclNode ) );
+ private boolean isClassVarRef(Node node) {
+ return ((node instanceof ClassVarNode) || (node instanceof ClassVarAsgnNode) || (node instanceof ClassVarDeclNode));
}
/**
* Determines whether a given node is a global variable reference
+ *
* @param node
* @return
*/
- private boolean isGlobalVarRef( Node node ) {
- return ( ( node instanceof GlobalAsgnNode ) || ( node instanceof GlobalVarNode ) );
+ private boolean isGlobalVarRef(Node node) {
+ return ((node instanceof GlobalAsgnNode) || (node instanceof GlobalVarNode));
}
-
+
/**
* Determines whether a given node is a constant reference (constant)
+ *
* @param node
* @return
*/
- private boolean isConstRef( Node node ) {
- return ( node instanceof ConstNode );
+ private boolean isConstRef(Node node) {
+ return (node instanceof ConstNode);
}
-
-
+
/**
* Determines whether a given node is a type reference (class, module)
+ *
* @param node
* @return
*/
- private boolean isTypeRef( Node node ) {
- //TODO: Classes can be referred to as a ConstNode; i.e. "class Klass;end; k = Klass.new" the last reference is a ConstNode, not a ClassNode. Special way to handle this?
- return ( ( node instanceof ClassNode ) || ( node instanceof ModuleNode ) || ( node instanceof ConstNode ));
+ private boolean isTypeRef(Node node) {
+ // TODO: Classes can be referred to as a ConstNode; i.e. "class
+ // Klass;end; k = Klass.new" the last reference is a ConstNode, not a
+ // ClassNode. Special way to handle this?
+ return ((node instanceof ClassNode) || (node instanceof ModuleNode) || (node instanceof ConstNode));
}
-
-
-
+
// ****************************************************************************
// *
// * Worker methods - handles delegation of occurrence searches
@@ -227,456 +239,380 @@
/**
* Collects all corresponding local variable occurrences
- * @param root Root node to search
- * @param orig Originating node
- * @param occurrences
+ *
+ * @param root
+ * Root node to search
+ * @param orig
+ * Originating node
+ * @param occurrences
*/
- private void pushLocalVarRefs( Node root, Node orig, List<ISourcePosition> occurrences ) {
-// System.out.println("Finding occurrences for a local variable " + orig.toString());
-
+ private void pushLocalVarRefs(Node root, Node orig, List<ISourcePosition> occurrences) {
+ // System.out.println("Finding occurrences for a local variable " +
+ // orig.toString());
+
// Find the search space
Node searchSpace = FirstPrecursorNodeLocator.Instance().findFirstPrecursor(root, orig.getPosition().getStartOffset(), new INodeAcceptor() {
public boolean doesAccept(Node node) {
- return ( ( node instanceof DefnNode ) || ( node instanceof DefsNode ) /*TODO: Block Body? */ );
+ return ((node instanceof DefnNode) || (node instanceof DefsNode) /*
+ * TODO:
+ * Block
+ * Body?
+ */);
}
});
-
+
// If no enclosing node found, search the entire space
- if ( searchSpace == null ) {
+ if (searchSpace == null) {
searchSpace = root;
}
-
+
// Finalize searchSpace because Java's scoping rules are the awesome
- final Node finalSearchSpace = searchSpace;
+ final Node finalSearchSpace = searchSpace;
// Get name of local variable reference
- final String origName = getLocalVarRefName(orig);
+ final String origName = ASTUtil.getNameReflectively(orig);
// Find all pertinent nodes
List<Node> searchResults = ScopedNodeLocator.Instance().findNodesInScope(searchSpace, new INodeAcceptor() {
public boolean doesAccept(Node node) {
- String name = getLocalVarRefName(node);
- return ( name != null && name.equals(origName));
+ String name = ASTUtil.getNameReflectively(node);
+ return (name != null && name.equals(origName));
}
});
-
+
// Scrape position from pertinent nodes
- for ( Node searchResult : searchResults ) {
+ for (Node searchResult : searchResults) {
occurrences.add(getPositionOfName(searchResult, searchSpace));
}
}
-
+
/**
* Collects all corresponding dynamic variable occurrences
- * @param root Root node to search
- * @param orig Originating node
- * @param occurrences
+ *
+ * @param root
+ * Root node to search
+ * @param orig
+ * Originating node
+ * @param occurrences
*/
- private void pushDVarRefs( Node root, Node orig, List<ISourcePosition> occurrences ) {
-// System.out.println("Finding occurrences for a local variable " + orig.toString());
-
+ private void pushDVarRefs(Node root, Node orig, List<ISourcePosition> occurrences) {
+ // System.out.println("Finding occurrences for a local variable " +
+ // orig.toString());
+
// Find the search space
Node searchSpace = FirstPrecursorNodeLocator.Instance().findFirstPrecursor(root, orig.getPosition().getStartOffset(), new INodeAcceptor() {
public boolean doesAccept(Node node) {
- return ( ( node instanceof DefnNode ) || ( node instanceof DefsNode ) /*TODO: Block Body? */ );
+ return ((node instanceof DefnNode) || (node instanceof DefsNode) /*
+ * TODO:
+ * Block
+ * Body?
+ */);
}
});
-
+
// If no enclosing node found, search the entire space
- if ( searchSpace == null ) {
+ if (searchSpace == null) {
searchSpace = root;
}
// Get name of local variable reference
- final String origName = getDVarRefName(orig);
+ final String origName = ASTUtil.getNameReflectively(orig);
// Find all pertinent nodes
List<Node> searchResults = ScopedNodeLocator.Instance().findNodesInScope(searchSpace, new INodeAcceptor() {
public boolean doesAccept(Node node) {
- if ( isDVarRef(node))
- {
- String name = getDVarRefName(node);
- return ( name != null && name.equals(origName));
+ if (isDVarRef(node)) {
+ String name = ASTUtil.getNameReflectively(node);
+ return (name != null && name.equals(origName));
}
return false;
}
});
-
+
// Scrape position from pertinent nodes
- for ( Node searchResult : searchResults ) {
+ for (Node searchResult : searchResults) {
occurrences.add(getPositionOfName(searchResult, searchSpace));
}
}
-
+
/**
* Collects all instance variable occurrences
- * @param root
+ *
+ * @param root
* @param orig
* @param occurrences
*/
- private void pushInstVarRefs( Node root, Node orig, List<ISourcePosition> occurrences ) {
-// System.out.println("Finding occurrences for an instance variable " + orig.toString() );
-
+ private void pushInstVarRefs(Node root, Node orig, List<ISourcePosition> occurrences) {
+ // System.out.println("Finding occurrences for an instance variable " +
+ // orig.toString() );
+
Node searchSpace = determineSearchSpace(root, orig);
-
+
// Finalize searchSpace because Java's scoping rules are the awesome
- //todo: not needed?
- //final Node finalSearchSpace = searchSpace;
-
+ // todo: not needed?
+ // final Node finalSearchSpace = searchSpace;
+
// Get name of local variable reference
- final String origName = getInstVarRefName(orig);
-
+ final String origName = ASTUtil.getNameReflectively(orig);
+
// Find all pertinent nodes
List<Node> searchResults = ScopedNodeLocator.Instance().findNodesInScope(searchSpace, new INodeAcceptor() {
public boolean doesAccept(Node node) {
- if ( isInstanceVarRef(node) )
- {
- String name = getInstVarRefName(node);
- return ( name != null && name.equals(origName));
+ if (isInstanceVarRef(node)) {
+ String name = ASTUtil.getNameReflectively(node);
+ return (name != null && name.equals(origName));
}
return false;
}
});
-
+
// Scrape position from pertinent nodes
- for ( Node searchResult : searchResults ) {
+ for (Node searchResult : searchResults) {
occurrences.add(getPositionOfName(searchResult, searchSpace));
}
-
+
}
private Node determineSearchSpace(Node root, Node orig) {
// Find the name of the enclosing class
- ClassNode enclosingClass = (ClassNode)FirstPrecursorNodeLocator.Instance().findFirstPrecursor(root, orig.getPosition().getStartOffset(), new INodeAcceptor() {
+ ClassNode enclosingClass = (ClassNode) FirstPrecursorNodeLocator.Instance().findFirstPrecursor(root, orig.getPosition().getStartOffset(), new INodeAcceptor() {
public boolean doesAccept(Node node) {
- return ( node instanceof ClassNode );
+ return (node instanceof ClassNode);
}
});
-
- // If no enclosing class is identified, search root.
- if ( enclosingClass == null ) {
+
+ // If no enclosing class is identified, search root.
+ if (enclosingClass == null) {
return root;
}
- // Find the search space - all ClassNodes for that name within root scope
+ // Find the search space - all ClassNodes for that name within root
+ // scope
else {
final String className = getClassNodeName(enclosingClass);
List<Node> classNodes = ScopedNodeLocator.Instance().findNodesInScope(root, new INodeAcceptor() {
public boolean doesAccept(Node node) {
- if ( node instanceof ClassNode )
- {
- return getClassNodeName((ClassNode)node).equals(className);
+ if (node instanceof ClassNode) {
+ return getClassNodeName((ClassNode) node).equals(className);
}
return false;
}
});
- BlockNode blockNode = new BlockNode(new SourcePosition("",0));
- for ( Node classNode : classNodes )
- {
- blockNode.add( classNode );
+ BlockNode blockNode = new BlockNode(new SourcePosition("", 0));
+ for (Node classNode : classNodes) {
+ blockNode.add(classNode);
}
return blockNode;
}
}
-
+
/**
* Collects all class variable occurrences
- * @param root
+ *
+ * @param root
* @param orig
* @param occurrences
*/
- private void pushClassVarRefs( Node root, Node orig, List<ISourcePosition> occurrences ) {
-// System.out.println("Finding occurrences for an instance variable " + orig.toString() );
+ private void pushClassVarRefs(Node root, Node orig, List<ISourcePosition> occurrences) {
+ // System.out.println("Finding occurrences for an instance variable " +
+ // orig.toString() );
Node searchSpace = determineSearchSpace(root, orig);
-
+
// Finalize searchSpace because Java's scoping rules are the awesome
- //todo: not needed?
- //final Node finalSearchSpace = searchSpace;
-
+ // todo: not needed?
+ // final Node finalSearchSpace = searchSpace;
+
// Get name of local variable reference
- final String origName = getClassVarRefName(orig);
-
+ final String origName = ASTUtil.getNameReflectively(orig);
+
// Find all pertinent nodes
List<Node> searchResults = ScopedNodeLocator.Instance().findNodesInScope(searchSpace, new INodeAcceptor() {
public boolean doesAccept(Node node) {
- if ( isClassVarRef(node) )
- {
- String name = getClassVarRefName(node);
- return ( name != null && name.equals(origName));
+ if (isClassVarRef(node)) {
+ String name = ASTUtil.getNameReflectively(node);
+ return (name != null && name.equals(origName));
}
return false;
}
});
-
+
// Scrape position from pertinent nodes
- for ( Node searchResult : searchResults ) {
+ for (Node searchResult : searchResults) {
occurrences.add(getPositionOfName(searchResult, searchSpace));
}
-
+
}
-
+
/**
* Collects all global variable occurrences
+ *
* @param root
* @param orig
* @param occurrences
*/
- private void pushGlobalVarRefs( Node root, Node orig, List<ISourcePosition> occurrences ) {
+ private void pushGlobalVarRefs(Node root, Node orig, List<ISourcePosition> occurrences) {
final Node searchSpace = root;
- final String origName = getGlobalVarRefName(orig);
-
+ final String origName = ASTUtil.getNameReflectively(orig);
+
// Find all pertinent nodes
List<Node> searchResults = ScopedNodeLocator.Instance().findNodesInScope(searchSpace, new INodeAcceptor() {
public boolean doesAccept(Node node) {
- return isGlobalVarRef(node) && getGlobalVarRefName(node).equals(origName);
+ return isGlobalVarRef(node) && ASTUtil.getNameReflectively(node).equals(origName);
}
});
-
+
// Scrape position from pertinent nodes
- for ( Node searchResult : searchResults ) {
+ for (Node searchResult : searchResults) {
occurrences.add(getPositionOfName(searchResult, searchSpace));
- }
+ }
}
-
-
+
/**
* Collects all symbol occurrences
+ *
* @param root
* @param orig
* @param occurrences
*/
- private void pushSymbolRefs( Node root, Node orig, List<ISourcePosition> occurrences ) {
+ private void pushSymbolRefs(Node root, Node orig, List<ISourcePosition> occurrences) {
final Node searchSpace = root;
- final String origName = ((SymbolNode)orig).getName();
-
+ final String origName = ((SymbolNode) orig).getName();
+
// Find all pertinent nodes
List<Node> searchResults = ScopedNodeLocator.Instance().findNodesInScope(searchSpace, new INodeAcceptor() {
public boolean doesAccept(Node node) {
- return ( node instanceof SymbolNode ) && ((SymbolNode)node).getName().equals(origName);
+ return (node instanceof SymbolNode) && ((SymbolNode) node).getName().equals(origName);
}
});
-
+
// Scrape position from pertinent nodes
- for ( Node searchResult : searchResults ) {
+ for (Node searchResult : searchResults) {
occurrences.add(getPositionOfName(searchResult, searchSpace));
- }
+ }
}
-
-
-
- //todo: complete
-// private void pushMethodRefs( Node root, Node orig, List<ISourcePosition> occurrences) {
-//
-// // DefnNode DefsNode CallNode VCallNode
-//
-// System.out.println("Finding occurrences for method reference node " + orig.toString() );
-//
-// final Node searchSpace = root;
-// String origName = getMethodRefName(orig);
-//
-// // If orig is a method definition, find all occurrences to that selector for the orig's enclosing type
-// if ( orig instanceof DefnNode || orig instanceof DefsNode )
-// {
-// ((DefnNode)orig).g
-// }
-//
-// Node receiver = getMethodReceiver(orig);
-// }
-
+
+ // todo: complete
+ // private void pushMethodRefs( Node root, Node orig, List<ISourcePosition>
+ // occurrences) {
+ //
+ // // DefnNode DefsNode CallNode VCallNode
+ //
+ // System.out.println("Finding occurrences for method reference node " +
+ // orig.toString() );
+ //
+ // final Node searchSpace = root;
+ // String origName = getMethodRefName(orig);
+ //
+ // // If orig is a method definition, find all occurrences to that selector
+ // for the orig's enclosing type
+ // if ( orig instanceof DefnNode || orig instanceof DefsNode )
+ // {
+ // ((DefnNode)orig).g
+ // }
+ //
+ // Node receiver = getMethodReceiver(orig);
+ // }
+
/**
* Collects all pertinent const occurrences
*/
- private void pushConstRefs( Node root, Node orig, List<ISourcePosition> occurrences) {
- if ( !isConstRef(orig) )
- {
+ private void pushConstRefs(Node root, Node orig, List<ISourcePosition> occurrences) {
+ if (!isConstRef(orig)) {
return;
}
-
- final String matchName = getConstRefName(orig);
- List <Node> searchResults = ScopedNodeLocator.Instance().findNodesInScope(root, new INodeAcceptor() {
+
+ final String matchName = ASTUtil.getNameReflectively(orig);
+ List<Node> searchResults = ScopedNodeLocator.Instance().findNodesInScope(root, new INodeAcceptor() {
public boolean doesAccept(Node node) {
- if ( isConstRef(node) )
- {
- return getConstRefName(node).equals(matchName);
+ if (isConstRef(node)) {
+ return ASTUtil.getNameReflectively(node).equals(matchName);
}
return false;
}
});
-
- for ( Node searchResult : searchResults ) {
- occurrences.add(getPositionOfName(searchResult, root ) );
+
+ for (Node searchResult : searchResults) {
+ occurrences.add(getPositionOfName(searchResult, root));
}
}
-
+
/**
* Collects all pertinent type ref occurrences
*/
- private void pushTypeRefs( Node root, Node orig, List<ISourcePosition> occurrences) {
- if ( !isTypeRef(orig) )
- {
+ private void pushTypeRefs(Node root, Node orig, List<ISourcePosition> occurrences) {
+ if (!isTypeRef(orig)) {
return;
}
-
- final String matchName = getConstRefName(orig);
- List <Node> searchResults = ScopedNodeLocator.Instance().findNodesInScope(root, new INodeAcceptor() {
+
+ final String matchName = ASTUtil.getNameReflectively(orig);
+ List<Node> searchResults = ScopedNodeLocator.Instance().findNodesInScope(root, new INodeAcceptor() {
public boolean doesAccept(Node node) {
- if ( isTypeRef(node) )
- {
+ if (isTypeRef(node)) {
return getTypeRefName(node).equals(matchName);
}
return false;
}
});
-
- for ( Node searchResult : searchResults ) {
- occurrences.add(getPositionOfName(searchResult, root ) );
+
+ for (Node searchResult : searchResults) {
+ occurrences.add(getPositionOfName(searchResult, root));
}
}
-
-
+
// ****************************************************************************
// *
// * Utility methods
// *
// ****************************************************************************
-
+
/**
* Gets the position of the name for the specified node.
- * @param node Node that responds to getName() or some variant
- * @param scope Scope that holds the node (pertinent for locals and args)
+ *
+ * @param node
+ * Node that responds to getName() or some variant
+ * @param scope
+ * Scope that holds the node (pertinent for locals and args)
* @return ISourcePosition that holds the name of the node
*/
- private ISourcePosition getPositionOfName(Node node, Node scope)
- {
+ private ISourcePosition getPositionOfName(Node node, Node scope) {
ISourcePosition pos = node.getPosition();
-
- //todo: refactor the getting-of-name
+
+ // TODO refactor the getting-of-name
String name = null;
- if ( isLocalVarRef(node) ) { name = getLocalVarRefName(node); }
- if ( isDVarRef(node) ) { name = getDVarRefName(node); }
- if ( isInstanceVarRef(node) ) { name = getInstVarRefName(node ); }
- if ( isGlobalVarRef(node) ) { name = getGlobalVarRefName(node); }
- if ( isClassVarRef(node) ) { name = getClassVarRefName(node); }
- if ( isConstRef(node) ) { name = getConstRefName(node); }
- if ( node instanceof ClassNode ) {
- name = getClassNodeName( (ClassNode)node );
+ if (isLocalVarRef(node) || isDVarRef(node) || isInstanceVarRef(node) || isGlobalVarRef(node) || isClassVarRef(node) || isConstRef(node)) {
+ name = ASTUtil.getNameReflectively(node);
+ } else if (node instanceof ClassNode) {
+ name = getClassNodeName((ClassNode) node);
String classDeclString = source.substring(pos.getStartOffset(), pos.getEndOffset());
int begin = pos.getStartOffset() + classDeclString.indexOf(name);
- return new SourcePosition( pos.getFile(), pos.getStartLine(), pos.getEndLine(), begin, begin + name.length() );
- }
- if ( node instanceof ModuleNode ) {
- name = getModuleNodeName( (ModuleNode)node );
+ return new SourcePosition(pos.getFile(), pos.getStartLine(), pos.getEndLine(), begin, begin + name.length());
+ } else if (node instanceof ModuleNode) {
+ name = getModuleNodeName((ModuleNode) node);
String moduleDeclString = source.substring(pos.getStartOffset(), pos.getEndOffset());
int begin = moduleDeclString.indexOf(name);
- return new SourcePosition( pos.getFile(), pos.getStartLine(), pos.getEndLine(), begin, begin + name.length() );
+ return new SourcePosition(pos.getFile(), pos.getStartLine(), pos.getEndLine(), begin, begin + name.length());
+ } else if (node instanceof SymbolNode) {
+ // XXX: This is a hack to get around improper offsets in my JRuby
+ // copy; ":foo" returns offset for ":fo", so compensate by adding
+ // one
+ name = ((SymbolNode) node).getName();
+ return new SourcePosition(pos.getFile(), pos.getStartLine(), pos.getEndLine(), pos.getStartOffset(), pos.getStartOffset() + name.length() + 1);
}
-
- if ( node instanceof SymbolNode ) {
- //XXX: This is a hack to get around improper offsets in my JRuby copy; ":foo" returns offset for ":fo", so compensate by adding one
- name = ((SymbolNode)node).getName();
- return new SourcePosition(pos.getFile(), pos.getStartLine(), pos.getEndLine(), pos.getStartOffset(), pos.getStartOffset() + name.length() + 1 );
- }
-
- if ( name == null )
- {
+
+ if (name == null) {
throw new RuntimeException("Couldn't get the name for: " + node.toString() + " in " + scope.toString());
}
- return new SourcePosition(pos.getFile(), pos.getStartLine(), pos.getEndLine(), pos.getStartOffset(), pos.getStartOffset() + name.length() );
+ return new SourcePosition(pos.getFile(), pos.getStartLine(), pos.getEndLine(), pos.getStartOffset(), pos.getStartOffset() + name.length());
}
-
- /**
- * Returns the name of a local var ref (LocalAsgnNode, ArgumentNode, LocalVarNode)
- * @param node Node to get the name of
- * @return
- */
- private String getLocalVarRefName( Node node ) {
- if (node instanceof INameNode) {
- return ((INameNode)node).getName();
- }
-
- return null;
- }
-
- /**
- * Gets the name of a dynamic variable reference
- * @param node Dynamic variable reference
- * @return
- */
- private String getDVarRefName( Node node ) {
-// if ( node instanceof DVarNode ) {
-// return ((DVarNode)node).getName();
-// }
-// if ( node instanceof DAsgnNode ) {
-// return ((DAsgnNode)node).getName();
-// }
-// return null;
- return getNameReflectively( node );
- }
/**
- * Gets the name of an instance variable reference
- * @param node Instance variable reference
- * @return
- */
- private String getInstVarRefName( Node node ) {
-// if ( node instanceof InstAsgnNode ) {
-// return ((InstAsgnNode)node).getName();
-// }
-//
-// if ( node instanceof InstVarNode ) {
-// return ((InstVarNode)node).getName();
-// }
-//
-// if ( node instanceof DVarNode ) {
-// return ((DVarNode)node).getName();
-// }
-// return null;
- return getNameReflectively( node );
- }
-
- /**
- * Gets the name of a class variable reference
- * @param node Class variable reference
- * @return
- */
- private String getClassVarRefName( Node node ) {
-// if ( node instanceof ClassVarNode ) {
-// return ((ClassVarNode)node).getName();
-// }
-// if ( node instanceof ClassVarDeclNode ) {
-// return ((ClassVarDeclNode)node).getName();
-// }
-// if ( node instanceof ClassVarAsgnNode ) {
-// return ((ClassVarAsgnNode)node).getName();
-// }
-// return null;
- return getNameReflectively( node );
- }
-
- /**
- * Gets the name of a global variable reference
- * @param node
- * @return
- */
- private String getGlobalVarRefName( Node node ) {
-// if ( node instanceof GlobalVarNode )
-// {
-// return ((GlobalVarNode)node).getName();
-// }
-// if ( node instanceof GlobalAsgnNode ) {
-// return ((GlobalAsgnNode)node).getName();
-// }
-// return null;
- return getNameReflectively( node );
- }
-
- /**
* Helper method to get the class name froma ClassNode
+ *
* @param classNode
* @return
*/
- private String getClassNodeName( ClassNode classNode ) {
+ private String getClassNodeName(ClassNode classNode) {
if (classNode.getCPath() instanceof Colon2Node) {
Colon2Node c2node = (Colon2Node) classNode.getCPath();
return c2node.getName();
@@ -686,11 +622,12 @@
/**
* Helper method to get the class name from a ModuleNode
+ *
* @param classNode
* @return
*/
- private String getModuleNodeName( ModuleNode moduleNode ) {
- if ( moduleNode.getCPath() instanceof Colon2Node ) {
+ private String getModuleNodeName(ModuleNode moduleNode) {
+ if (moduleNode.getCPath() instanceof Colon2Node) {
Colon2Node c2node = (Colon2Node) moduleNode.getCPath();
return c2node.getName();
}
@@ -698,66 +635,19 @@
}
/**
- * Helper method to get the class name from a const ref node
- * @param node
- * @return
- */
- private String getConstRefName( Node node ) {
-// if ( constRefNode instanceof ConstNode )
-// {
-// return ((ConstNode)node).getName();
-// }
-// return null;
- return getNameReflectively( node );
- }
-
- /**
* Helper method to get the class name from a const ref node (Class/Module)
+ *
* @param node
* @return
*/
- private String getTypeRefName( Node node ) {
- if ( node instanceof ClassNode )
- {
- return getClassNodeName((ClassNode)node);
+ private String getTypeRefName(Node node) {
+ if (node instanceof ClassNode) {
+ return getClassNodeName((ClassNode) node);
}
- if ( node instanceof ModuleNode )
- {
- return getModuleNodeName((ModuleNode)node);
+ if (node instanceof ModuleNode) {
+ return getModuleNodeName((ModuleNode) node);
}
- return getNameReflectively( node );
+ return ASTUtil.getNameReflectively(node);
}
-
- /**
- * Gets the name of a node by reflectively invoking "getName()" on it;
- * helper method just to cut many "instanceof/cast" pairs.
- * @param node
- * @return name or null
- */
- private String getNameReflectively( Node node ) {
- try {
- Method getNameMethod = node.getClass().getMethod("getName", new Class[]{});
- Object name = getNameMethod.invoke( node, new Object[0] );
- return (String)name;
- } catch (Exception e) {
- return null;
- }
-// } catch (SecurityException e) {
-// // TODO Auto-generated catch block
-// e.printStackTrace();
-// } catch (NoSuchMethodException e) {
-// return null;
-// } catch (IllegalArgumentException e) {
-// // TODO Auto-generated catch block
-// e.printStackTrace();
-// } catch (IllegalAccessException e) {
-// // TODO Auto-generated catch block
-// e.printStackTrace();
-// } catch (InvocationTargetException e) {
-// // TODO Auto-generated catch block
-// e.printStackTrace();
-// }
- }
-
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-09 14:39:43
|
Revision: 1942
http://svn.sourceforge.net/rubyeclipse/?rev=1942&view=rev
Author: cawilliams
Date: 2007-02-09 06:39:35 -0800 (Fri, 09 Feb 2007)
Log Message:
-----------
fix suggesting method inside the current type
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.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-02-08 15:37:16 UTC (rev 1941)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-02-09 14:39:35 UTC (rev 1942)
@@ -8,6 +8,8 @@
import java.util.List;
import java.util.Set;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
import org.jruby.ast.ClassNode;
import org.jruby.ast.ClassVarAsgnNode;
import org.jruby.ast.ClassVarDeclNode;
@@ -21,15 +23,19 @@
import org.jruby.ast.MethodDefNode;
import org.jruby.ast.ModuleNode;
import org.jruby.ast.Node;
+import org.jruby.ast.types.INameNode;
import org.jruby.lexer.yacc.SyntaxException;
import org.jruby.parser.StaticScope;
import org.rubypeople.rdt.core.CompletionProposal;
import org.rubypeople.rdt.core.CompletionRequestor;
import org.rubypeople.rdt.core.Flags;
import org.rubypeople.rdt.core.IMethod;
-import org.rubypeople.rdt.core.IParent;
+import org.rubypeople.rdt.core.IOpenable;
import org.rubypeople.rdt.core.IRubyElement;
+import org.rubypeople.rdt.core.IRubyModel;
+import org.rubypeople.rdt.core.IRubyProject;
import org.rubypeople.rdt.core.IRubyScript;
+import org.rubypeople.rdt.core.ISourceRange;
import org.rubypeople.rdt.core.IType;
import org.rubypeople.rdt.core.RubyCore;
import org.rubypeople.rdt.core.RubyModelException;
@@ -74,7 +80,7 @@
String name = guess.getType();
IType[] types = requestor.findType(name);
for (int i = 0; i < types.length; i++) {
- suggestMethods(context, guess.getConfidence(), types[i]);
+ suggestMethods(guess.getConfidence(), types[i]);
}
}
} else {
@@ -129,24 +135,29 @@
}
}
- private void suggestMethods(CompletionContext context, int confidence, IType type) throws RubyModelException {
+ private void suggestMethods(int confidence, IType type) throws RubyModelException {
if (type == null)
return;
IMethod[] methods = type.getMethods();
for (int k = 0; k < methods.length; k++) {
- IMethod method = methods[k];
- int start = context.getReplaceStart();
- String name = method.getElementName();
- int flags = Flags.AccDefault;
- if (method.isSingleton()) {
- flags |= Flags.AccStatic;
- name = name.substring(type.getElementName().length() + 1);
- } else {
-// FIXME Don't show instance methods if the thing we're working on is a constant (class name)!
- }
- if (!context.prefixStartsWith(name))
- continue;
-
+ suggestMethod(methods[k], type.getElementName(), confidence);
+ }
+ }
+
+ private void suggestMethod(IMethod method, String typeName, int confidence) {
+ int start = context.getReplaceStart();
+ String name = method.getElementName();
+ int flags = Flags.AccDefault;
+ if (method.isSingleton()) {
+ flags |= Flags.AccStatic;
+ name = name.substring(typeName.length() + 1);
+ } else {
+// FIXME Don't show instance methods if the thing we're working on is a constant (class name)!
+ }
+ if (!context.prefixStartsWith(name))
+ return;
+
+ try {
switch (method.getVisibility()) {
case IMethod.PRIVATE:
flags |= Flags.AccPrivate;
@@ -160,13 +171,17 @@
default:
break;
}
- CompletionProposal proposal = new CompletionProposal(CompletionProposal.METHOD_REF, name, confidence);
- proposal.setReplaceRange(start, start + name.length());
- proposal.setFlags(flags);
- proposal.setName(name);
- proposal.setDeclaringType(type.getElementName());
- requestor.accept(proposal);
+ } catch (RubyModelException e) {
+ RubyCore.log(e);
+ flags |= Flags.AccPublic;
}
+ CompletionProposal proposal = new CompletionProposal(CompletionProposal.METHOD_REF, name, confidence);
+ proposal.setReplaceRange(start, start + name.length());
+ proposal.setFlags(flags);
+ proposal.setName(name);
+ proposal.setDeclaringType(typeName);
+ requestor.accept(proposal);
+
}
/**
@@ -239,48 +254,6 @@
}
}
- private void getElementsOfType(IParent element, int[] types) {
- try {
- IRubyElement[] elements = element.getChildren();
- if (elements == null)
- return;
- for (int x = 0; x < elements.length; x++) {
- IRubyElement child = elements[x];
- for (int i = 0; i < types.length; i++) {
- if (child.getElementType() != types[i])
- continue;
- String name = child.getElementName();
- if (!context.prefixStartsWith(name))
- continue;
- CompletionProposal proposal = new CompletionProposal(getCompletionProposalType(child), name, 100);
- proposal.setReplaceRange(context.getReplaceStart(), context.getReplaceStart() + name.length());
- requestor.accept(proposal);
- }
- if (child instanceof IParent)
- getElementsOfType((IParent) child, types);
- }
- } catch (RubyModelException e) {
- e.printStackTrace();
- }
- }
-
- private int getCompletionProposalType(IRubyElement child) {
- switch (child.getElementType()) {
- case IRubyElement.DYNAMIC_VAR:
- case IRubyElement.LOCAL_VARIABLE:
- return CompletionProposal.LOCAL_VARIABLE_REF;
- case IRubyElement.METHOD:
- return CompletionProposal.METHOD_REF;
- case IRubyElement.TYPE:
- return CompletionProposal.TYPE_REF;
- case IRubyElement.INSTANCE_VAR:
- case IRubyElement.CLASS_VAR:
- return CompletionProposal.FIELD_REF;
- default:
- return CompletionProposal.KEYWORD;
- }
- }
-
/**
* Gets the members available inside a type node (ModuleNode, ClassNode): -
* Instance variables - Class variables - Methods
@@ -349,11 +322,9 @@
}
if (!context.prefixStartsWith(name))
continue;
- CompletionProposal proposal = new CompletionProposal(CompletionProposal.METHOD_REF, name, 100);
- proposal.setReplaceRange(context.getReplaceStart(), context.getReplaceStart() + name.length());
- requestor.accept(proposal);
+ NodeMethod method = new NodeMethod(methodDefinition);
+ suggestMethod(method, typeName, 100);
}
-
addTypesVariables(typeNode);
}
@@ -504,4 +475,161 @@
}
}
+
+ private class NodeMethod implements IMethod {
+
+ private Node node;
+
+ public NodeMethod(Node methodDefinition) {
+ this.node = methodDefinition;
+ }
+
+ public String[] getParameterNames() throws RubyModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public int getVisibility() throws RubyModelException {
+ // TODO Auto-generated method stub
+ return IMethod.PUBLIC;
+ }
+
+ public boolean isConstructor() {
+ if (node instanceof DefnNode) {
+ return ((DefnNode)node).getName().equals("initialize");
+ }
+ return false;
+ }
+
+ public boolean isSingleton() {
+ return node instanceof DefsNode;
+ }
+
+ public boolean exists() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public IRubyElement getAncestor(int ancestorType) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public IResource getCorrespondingResource() throws RubyModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getElementName() {
+ // TODO Auto-generated method stub
+ if (node instanceof INameNode) {
+ return ((INameNode)node).getName();
+ }
+ return null;
+ }
+
+ public int getElementType() {
+ return IRubyElement.METHOD;
+ }
+
+ public IOpenable getOpenable() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public IRubyElement getParent() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public IPath getPath() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public IRubyElement getPrimaryElement() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public IResource getResource() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public IRubyModel getRubyModel() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public IRubyProject getRubyProject() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public IResource getUnderlyingResource() throws RubyModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public boolean isReadOnly() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean isStructureKnown() throws RubyModelException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean isType(int type) {
+ return type == IRubyElement.METHOD;
+ }
+
+ public Object getAdapter(Class adapter) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public IType getDeclaringType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public ISourceRange getNameRange() throws RubyModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public IRubyScript getRubyScript() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public IType getType(String name, int occurrenceCount) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getSource() throws RubyModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public ISourceRange getSourceRange() throws RubyModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public IRubyElement[] getChildren() throws RubyModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public boolean hasChildren() throws RubyModelException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-08 15:53:21
|
Revision: 1941
http://svn.sourceforge.net/rubyeclipse/?rev=1941&view=rev
Author: cawilliams
Date: 2007-02-08 07:37:16 -0800 (Thu, 08 Feb 2007)
Log Message:
-----------
handle spitting out representations of LocalVarNode (this shows up in outline when arg defaults a previous arg's value). This should actually handle any INameNode implementors.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/ASTUtil.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/ASTUtil.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/ASTUtil.java 2007-02-08 14:54:15 UTC (rev 1940)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/ASTUtil.java 2007-02-08 15:37:16 UTC (rev 1941)
@@ -13,12 +13,14 @@
import org.jruby.ast.HashNode;
import org.jruby.ast.ListNode;
import org.jruby.ast.LocalAsgnNode;
+import org.jruby.ast.LocalVarNode;
import org.jruby.ast.NilNode;
import org.jruby.ast.Node;
import org.jruby.ast.SelfNode;
import org.jruby.ast.StrNode;
import org.jruby.ast.TrueNode;
import org.jruby.ast.ZArrayNode;
+import org.jruby.ast.types.INameNode;
import org.jruby.parser.StaticScope;
public abstract class ASTUtil {
@@ -100,8 +102,8 @@
return "true";
if (node instanceof FalseNode)
return "false";
- if (node instanceof ConstNode)
- return ((ConstNode)node).getName();
+ if (node instanceof INameNode)
+ return ((INameNode)node).getName();
if (node instanceof ZArrayNode)
return "[]";
if (node instanceof FixnumNode)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-08 14:54:29
|
Revision: 1940
http://svn.sourceforge.net/rubyeclipse/?rev=1940&view=rev
Author: cawilliams
Date: 2007-02-08 06:54:15 -0800 (Thu, 08 Feb 2007)
Log Message:
-----------
just use the fully qualified type name (don't try to parse out the :: inside)
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/CompletionProposalLabelProvider.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/CompletionProposalLabelProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/CompletionProposalLabelProvider.java 2007-02-08 09:41:02 UTC (rev 1939)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/CompletionProposalLabelProvider.java 2007-02-08 14:54:15 UTC (rev 1940)
@@ -134,8 +134,7 @@
* @return the display label for the given type proposal
*/
String createTypeProposalLabel(CompletionProposal typeProposal) {
- String typeName= typeProposal.getType();
- return createTypeProposalLabel(typeName);
+ return typeProposal.getType();
}
/**
@@ -208,25 +207,5 @@
}
return buf.toString();
}
-
- String createTypeProposalLabel(String fullName) {
- // only display innermost type name as type name, using any
- // enclosing types as qualification
- int qIndex= findSimpleNameStart(fullName);
- StringBuffer buf= new StringBuffer();
- buf.append(fullName, qIndex, fullName.length() - qIndex);
- if (qIndex > 0) {
- buf.append(RubyElementLabels.CONCAT_STRING);
- buf.append(fullName, 0, qIndex - 1);
- }
- return buf.toString();
- }
-
- private int findSimpleNameStart(String fullName) {
- int index = fullName.lastIndexOf("::");
- if (index == -1) return 0;
- return index;
- }
-
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mir...@us...> - 2007-02-08 09:41:06
|
Revision: 1939
http://svn.sourceforge.net/rubyeclipse/?rev=1939&view=rev
Author: mirkostocker
Date: 2007-02-08 01:41:02 -0800 (Thu, 08 Feb 2007)
Log Message:
-----------
fix for refactoring with syntax errors somewhere in the project
Modified Paths:
--------------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/NodeProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/RefactoringConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/encapsulatefield/EncapsulateFieldConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/mergewithexternalclassparts/MergeWithExternalClassPartsConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renameclass/RenameClassConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/DocumentProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/DocumentWithIncluding.java
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/TS_Core.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/converttemptofield/conditionchecks/temp_to_field_checker_test_2.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/converttemptofield/conditionchecks/temp_to_field_checker_test_7.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocalvariable/conditionchecks/rename_local_condition_test_2.test_properties
Added Paths:
-----------
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/TC_RefactoringConditionChecker.java
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/NodeProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/NodeProvider.java 2007-02-07 22:00:20 UTC (rev 1938)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/NodeProvider.java 2007-02-08 09:41:02 UTC (rev 1939)
@@ -62,9 +62,13 @@
import org.jruby.ast.types.INameNode;
import org.jruby.common.NullWarnings;
import org.jruby.lexer.yacc.LexerSource;
+import org.jruby.lexer.yacc.SourcePosition;
+import org.jruby.lexer.yacc.SyntaxException;
import org.jruby.parser.DefaultRubyParser;
+import org.jruby.parser.LocalStaticScope;
import org.jruby.parser.RubyParserConfiguration;
import org.jruby.parser.RubyParserPool;
+import org.jruby.runtime.DynamicScope;
import org.rubypeople.rdt.refactoring.nodewrapper.AttrAccessorNodeWrapper;
import org.rubypeople.rdt.refactoring.nodewrapper.FieldNodeWrapper;
import org.rubypeople.rdt.refactoring.nodewrapper.MethodCallNodeWrapper;
@@ -86,20 +90,38 @@
children.add((Node) it.next());
return children;
}
-
- public static RootNode getRootNode(String fileName, String fileContent) {
- if(fileContent == null) {
- return null;
+
+ public static boolean hasSyntaxErrors(String fileName, String fileContent) {
+ try {
+ parseFile(fileName, fileContent);
+ return false;
+ } catch(SyntaxException e) {
+ return true;
}
+ }
+
+ private static RootNode parseFile(String fileName, String fileContent) {
Reader reader = new InputStreamReader(new ByteArrayInputStream(fileContent.getBytes()));
DefaultRubyParser parser;
parser = RubyParserPool.getInstance().borrowParser();
parser.setWarnings(new NullWarnings());
LexerSource lexerSource = new LexerSource(fileName, reader);
- RootNode rootNode = (RootNode) parser.parse(new RubyParserConfiguration(), lexerSource).getAST();
- return rootNode;
+ return (RootNode) parser.parse(new RubyParserConfiguration(), lexerSource).getAST();
}
+ public static RootNode getRootNode(String fileName, String fileContent) {
+ if(fileContent == null) {
+ return null;
+ }
+
+ try {
+ return parseFile(fileName, fileContent);
+ } catch(SyntaxException e) {
+// treat files with syntax errors as empty
+ return new RootNode(new SourcePosition(), new DynamicScope(new LocalStaticScope(null), null), null);
+ }
+ }
+
public static Collection<Node> getAttributeNodes(Node parent) {
Collection<Node> attrNodes = getSubNodes(parent, InstAsgnNode.class, InstVarNode.class);
attrNodes.addAll(getAttrListNodes(parent));
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/RefactoringConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/RefactoringConditionChecker.java 2007-02-07 22:00:20 UTC (rev 1938)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/RefactoringConditionChecker.java 2007-02-08 09:41:02 UTC (rev 1939)
@@ -51,7 +51,6 @@
init(config);
}
}
-
public boolean shouldPerform(boolean onlyInternalErrors) {
if(!onlyInternalErrors && shouldPerform(true)) {
@@ -59,6 +58,7 @@
}
return messages.get(IRefactoringConditionChecker.ERRORS).isEmpty();
}
+
public boolean shouldPerform() {
return shouldPerform(false);
}
@@ -66,9 +66,22 @@
public Map<String, Collection<String>> getFinalMessages() {
initMessages();
checkFinalConditions();
+ checkForSyntaxErrors();
return messages;
}
+ private void checkForSyntaxErrors() {
+ boolean syntaxError = false;
+ for(String file : docProvider.getFileNames()) {
+ if(NodeProvider.hasSyntaxErrors(file, docProvider.getFileContent(file))) {
+ syntaxError = true;
+ }
+ }
+ if (syntaxError) {
+ addWarning("There is a syntax error somewhere in the project, the refactoring might not work on these files.");
+ }
+ }
+
private void initMessages() {
messages = new LinkedHashMap<String, Collection<String>>();
messages.put(IRefactoringConditionChecker.ERRORS, new ArrayList<String>());
@@ -92,7 +105,7 @@
String fileName = null;
try {
fileName = docProvider.getActiveFileName();
- if(docProvider.getRootNode().getBodyNode() == null) {
+ if(docProvider.getActiveFileContent().equals("")) {
addError("Nothing to do in empty document.");
}
for(String aktFileName : docProvider.getFileNames()) {
@@ -102,26 +115,26 @@
} catch(SyntaxException se) {
String activeFileName = docProvider.getActiveFileName();
if(fileName == null || fileName.equals(activeFileName)) {
- addError("There is a syntax error in your document, refactoring is not possible.");
- } else {
- addError("There is a syntax error in the document " + fileName + ", refactoring is not possible.");
+ addError("There is a syntax error in the current file, refactoring is not possible.");
}
}
+
+ if(NodeProvider.hasSyntaxErrors(docProvider.getActiveFileName(), docProvider.getActiveFileContent())) {
+ addError("There is a syntax error in the current file, refactoring is not possible.");
+ }
}
-
+
protected void addError(String message) {
- Collection<String> errors = messages.get(IRefactoringConditionChecker.ERRORS);
- errors.add(message);
+ messages.get(IRefactoringConditionChecker.ERRORS).add(message);
}
protected void addWarning(String message) {
- Collection<String> warnings = messages.get(IRefactoringConditionChecker.WARNING);
- warnings.add(message);
+ messages.get(IRefactoringConditionChecker.WARNING).add(message);
}
protected abstract void checkInitialConditions();
- protected void checkFinalConditions() {
+ protected void checkFinalConditions() {
}
protected abstract void init(Object configObj);
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/encapsulatefield/EncapsulateFieldConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/encapsulatefield/EncapsulateFieldConditionChecker.java 2007-02-07 22:00:20 UTC (rev 1938)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/encapsulatefield/EncapsulateFieldConditionChecker.java 2007-02-08 09:41:02 UTC (rev 1939)
@@ -71,8 +71,7 @@
}
private INameNode findSelectedInstNode(int caretPosition) {
- Node instNode = SelectionNodeProvider.getSelectedNodeOfType(rootNode, caretPosition, InstVarNode.class, InstAsgnNode.class, SymbolNode.class);
- return (INameNode) instNode;
+ return (INameNode) SelectionNodeProvider.getSelectedNodeOfType(rootNode, caretPosition, InstVarNode.class, InstAsgnNode.class, SymbolNode.class);
}
public void checkFinalConditions() {
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/mergewithexternalclassparts/MergeWithExternalClassPartsConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/mergewithexternalclassparts/MergeWithExternalClassPartsConditionChecker.java 2007-02-07 22:00:20 UTC (rev 1938)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/mergewithexternalclassparts/MergeWithExternalClassPartsConditionChecker.java 2007-02-08 09:41:02 UTC (rev 1939)
@@ -60,5 +60,4 @@
addError("There is no class in the current file that has external parts to merge.");
}
}
-
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renameclass/RenameClassConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renameclass/RenameClassConditionChecker.java 2007-02-07 22:00:20 UTC (rev 1938)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renameclass/RenameClassConditionChecker.java 2007-02-08 09:41:02 UTC (rev 1939)
@@ -56,10 +56,6 @@
}
@Override
- protected void checkFinalConditions() {
- }
-
- @Override
protected void checkInitialConditions() {
if (config.getSelectedNode() == null) {
addError("Please select the name of a class declaration.");
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/DocumentProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/DocumentProvider.java 2007-02-07 22:00:20 UTC (rev 1938)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/DocumentProvider.java 2007-02-08 09:41:02 UTC (rev 1939)
@@ -57,11 +57,7 @@
public RootNode getRootNode() {
return NodeProvider.getRootNode(getActiveFileName(), getActiveFileContent());
}
-//
-// public ScopeNode getRootNodeWithEnclosingScopeNode() {
-// return NodeProvider.getRootNodeWithEnclosingScopeNode(getActiveFileName(), getActiveFileContent());
-// }
-
+
public Collection<Node> getAllNodes() {
return NodeProvider.getAllNodes(getRootNode());
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/DocumentWithIncluding.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/DocumentWithIncluding.java 2007-02-07 22:00:20 UTC (rev 1938)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/DocumentWithIncluding.java 2007-02-08 09:41:02 UTC (rev 1939)
@@ -35,6 +35,7 @@
import org.jruby.ast.FCallNode;
import org.jruby.ast.Node;
import org.jruby.ast.StrNode;
+import org.jruby.lexer.yacc.SyntaxException;
import org.rubypeople.rdt.refactoring.classnodeprovider.ClassNodeProvider;
import org.rubypeople.rdt.refactoring.core.NodeProvider;
import org.rubypeople.rdt.refactoring.nodewrapper.ClassNodeWrapper;
@@ -128,7 +129,11 @@
}
private Collection<FCallNode> getRequires(DocumentProvider doc) {
- return NodeProvider.getLoadAndRequireNodes(doc.getRootNode());
+ try {
+ return NodeProvider.getLoadAndRequireNodes(doc.getRootNode());
+ } catch(SyntaxException e) {
+ return new ArrayList<FCallNode>();
+ }
}
private boolean fileIsInResultSet(String fileName) {
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-02-07 22:00:20 UTC (rev 1938)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/TS_All.java 2007-02-08 09:41:02 UTC (rev 1939)
@@ -48,6 +48,7 @@
import org.rubypeople.rdt.refactoring.tests.core.movemethod.TS_MoveMethod;
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;
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.renamelocalvariable.TS_RenameLocalVariable;
@@ -84,6 +85,7 @@
suite.addTest(TS_InlineClass.suite());
suite.addTest(TS_MoveMethod.suite());
suite.addTest(TS_MoveField.suite());
+ suite.addTest(TS_Rename.suite());
return suite;
}
Added: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/TC_RefactoringConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/TC_RefactoringConditionChecker.java (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/TC_RefactoringConditionChecker.java 2007-02-08 09:41:02 UTC (rev 1939)
@@ -0,0 +1,44 @@
+package org.rubypeople.rdt.refactoring.tests.core;
+
+import junit.framework.TestCase;
+
+import org.rubypeople.rdt.refactoring.core.IRefactoringConditionChecker;
+import org.rubypeople.rdt.refactoring.core.RefactoringConditionChecker;
+import org.rubypeople.rdt.refactoring.documentprovider.IDocumentProvider;
+import org.rubypeople.rdt.refactoring.documentprovider.StringDocumentProvider;
+
+public class TC_RefactoringConditionChecker extends TestCase {
+ private final class TestConditionChecker extends RefactoringConditionChecker {
+ private TestConditionChecker(IDocumentProvider provider, Object config) {
+ super(provider, config);
+ }
+
+ @Override
+ protected void init(Object configObj) {
+ }
+
+ @Override
+ protected void checkInitialConditions() {
+ }
+ }
+
+ public void testSyntaxErrors() {
+
+ RefactoringConditionChecker checker = new TestConditionChecker(new StringDocumentProvider("class Test; en"), null);
+ assertEquals(1, checker.getInitialMessages().get(IRefactoringConditionChecker.ERRORS).size());
+ assertEquals(0, checker.getInitialMessages().get(IRefactoringConditionChecker.WARNING).size());
+ }
+
+ public void testSyntaxErrorsInIncludes() {
+
+ StringDocumentProvider stringDocumentProvider = new StringDocumentProvider("class Test; end");
+ stringDocumentProvider.addFile("other", "class Test; en");
+
+ RefactoringConditionChecker checker = new TestConditionChecker(stringDocumentProvider, null);
+ assertEquals(0, checker.getInitialMessages().get(IRefactoringConditionChecker.ERRORS).size());
+ assertEquals(0, checker.getInitialMessages().get(IRefactoringConditionChecker.WARNING).size());
+
+ assertEquals(0, checker.getFinalMessages().get(IRefactoringConditionChecker.ERRORS).size());
+ assertEquals(1, checker.getFinalMessages().get(IRefactoringConditionChecker.WARNING).size());
+ }
+}
Modified: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/TS_Core.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/TS_Core.java 2007-02-07 22:00:20 UTC (rev 1938)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/TS_Core.java 2007-02-08 09:41:02 UTC (rev 1939)
@@ -32,12 +32,15 @@
import junit.framework.TestSuite;
import org.rubypeople.rdt.refactoring.tests.FileTestSuite;
+import org.rubypeople.rdt.refactoring.tests.core.nodewrapper.TS_NodeWrapper;
public class TS_Core extends FileTestSuite {
public static Test suite() {
TestSuite suite = createSuite("Core", "enclosing_nodes_test.*rb", TC_SelectionNodeProvider.class);
suite.addTestSuite(TC_NodeProvider.class);
+ suite.addTest(TS_NodeWrapper.suite());
+ suite.addTestSuite(TC_RefactoringConditionChecker.class);
return suite;
}
}
\ No newline at end of file
Modified: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/converttemptofield/conditionchecks/temp_to_field_checker_test_2.test_properties
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/converttemptofield/conditionchecks/temp_to_field_checker_test_2.test_properties 2007-02-07 22:00:20 UTC (rev 1938)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/converttemptofield/conditionchecks/temp_to_field_checker_test_2.test_properties 2007-02-08 09:41:02 UTC (rev 1939)
@@ -2,5 +2,5 @@
isClassField=false
newName=d
cursorPosition=7
-initialError0=There is a syntax error in your document, refactoring is not possible.
+initialError0=There is a syntax error in the current file, refactoring is not possible.
Modified: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/converttemptofield/conditionchecks/temp_to_field_checker_test_7.test_properties
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/converttemptofield/conditionchecks/temp_to_field_checker_test_7.test_properties 2007-02-07 22:00:20 UTC (rev 1938)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/converttemptofield/conditionchecks/temp_to_field_checker_test_7.test_properties 2007-02-08 09:41:02 UTC (rev 1939)
@@ -2,4 +2,4 @@
isClassField=false
newName=d
cursorPosition=4
-initialError0=There is a syntax error in your document, refactoring is not possible.
\ No newline at end of file
+initialError0=There is a syntax error in the current file, refactoring is not possible.
\ No newline at end of file
Modified: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocalvariable/conditionchecks/rename_local_condition_test_2.test_properties
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocalvariable/conditionchecks/rename_local_condition_test_2.test_properties 2007-02-07 22:00:20 UTC (rev 1938)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocalvariable/conditionchecks/rename_local_condition_test_2.test_properties 2007-02-08 09:41:02 UTC (rev 1939)
@@ -1,2 +1,2 @@
cursorPosition=0
-initialError0=There is a syntax error in your document, refactoring is not possible.
\ No newline at end of file
+initialError0=There is a syntax error in the current file, refactoring is not possible.
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-07 22:00:24
|
Revision: 1938
http://svn.sourceforge.net/rubyeclipse/?rev=1938&view=rev
Author: cawilliams
Date: 2007-02-07 14:00:20 -0800 (Wed, 07 Feb 2007)
Log Message:
-----------
start making completion proposals show more information about the proposal (type names, method parameters, declaring types, etc)
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/CompletionProposal.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/AbstractRubyCompletionProposal.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/CompletionProposalLabelProvider.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyScriptCompletion.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/CompletionProposal.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/CompletionProposal.java 2007-02-07 18:18:08 UTC (rev 1937)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/CompletionProposal.java 2007-02-07 22:00:20 UTC (rev 1938)
@@ -85,6 +85,8 @@
*/
private String name = null;
private int flags;
+ private String type;
+ private String declaringType;
public CompletionProposal(int kind, String completion, int relevance) {
this.completionKind = kind;
@@ -194,4 +196,31 @@
this.replaceStart = startIndex;
this.replaceEnd = endIndex;
}
+
+ public String[] getParameterNames() {
+ // TODO Auto-generated method stub
+ return parameterNames;
+ }
+
+ public String getType() {
+ if (type != null) return type;
+ return "";
+ }
+
+ public String getDeclaringType() {
+ if (declaringType != null) return declaringType;
+ return "";
+ }
+
+ public void setType(String name) {
+ this.type = name;
+ }
+
+ public void setDeclaringType(String elementName) {
+ this.declaringType = elementName;
+ }
+
+ public void setName(String newName) {
+ this.name = newName;
+ }
}
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-02-07 18:18:08 UTC (rev 1937)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-02-07 22:00:20 UTC (rev 1938)
@@ -95,7 +95,8 @@
for (String name : globals) {
if (!context.prefixStartsWith(name))
continue;
- addProposal(context.getReplaceStart(), CompletionProposal.FIELD_REF, name);
+ CompletionProposal proposal = createProposal(context.getReplaceStart(), CompletionProposal.FIELD_REF, name);
+ requestor.accept(proposal);
}
}
@@ -105,14 +106,15 @@
for (String name : types) {
if (!context.prefixStartsWith(name))
continue;
- addProposal(context.getReplaceStart(), CompletionProposal.TYPE_REF, name);
+ CompletionProposal proposal = createProposal(context.getReplaceStart(), CompletionProposal.TYPE_REF, name);
+ proposal.setType(name);
+ requestor.accept(proposal);
}
}
- private CompletionProposal addProposal(int replaceStart, int type, String name) {
+ private CompletionProposal createProposal(int replaceStart, int type, String name) {
CompletionProposal proposal = new CompletionProposal(type, name, 100);
proposal.setReplaceRange(replaceStart, replaceStart + name.length());
- requestor.accept(proposal);
return proposal;
}
@@ -122,7 +124,8 @@
for (String name : types) {
if (!context.prefixStartsWith(name))
continue;
- addProposal(context.getReplaceStart(), CompletionProposal.FIELD_REF, name);
+ CompletionProposal proposal = createProposal(context.getReplaceStart(), CompletionProposal.FIELD_REF, name);
+ requestor.accept(proposal);
}
}
@@ -160,6 +163,8 @@
CompletionProposal proposal = new CompletionProposal(CompletionProposal.METHOD_REF, name, confidence);
proposal.setReplaceRange(start, start + name.length());
proposal.setFlags(flags);
+ proposal.setName(name);
+ proposal.setDeclaringType(type.getElementName());
requestor.accept(proposal);
}
}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/AbstractRubyCompletionProposal.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/AbstractRubyCompletionProposal.java 2007-02-07 18:18:08 UTC (rev 1937)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/AbstractRubyCompletionProposal.java 2007-02-07 22:00:20 UTC (rev 1938)
@@ -69,7 +69,7 @@
/**
*
- * @since 3.2
+ * @since 0.8.0
*/
public abstract class AbstractRubyCompletionProposal implements IRubyCompletionProposal, ICompletionProposalExtension, ICompletionProposalExtension2, ICompletionProposalExtension3, ICompletionProposalExtension5 {
/**
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/CompletionProposalLabelProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/CompletionProposalLabelProvider.java 2007-02-07 18:18:08 UTC (rev 1937)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/CompletionProposalLabelProvider.java 2007-02-07 22:00:20 UTC (rev 1938)
@@ -18,6 +18,7 @@
import org.rubypeople.rdt.internal.ui.RubyPluginImages;
import org.rubypeople.rdt.internal.ui.viewsupport.RubyElementImageProvider;
import org.rubypeople.rdt.ui.RubyElementImageDescriptor;
+import org.rubypeople.rdt.ui.RubyElementLabels;
/**
* Provides labels for ruby content assist proposals. The functionality is
@@ -25,7 +26,7 @@
* but based on signatures and {@link CompletionProposal}s.
*
* @see Signature
- * @since 3.1
+ * @since 0.8.0
*/
public class CompletionProposalLabelProvider {
/**
@@ -93,4 +94,139 @@
return new RubyElementImageDescriptor(descriptor, adornments, RubyElementImageProvider.SMALL_SIZE);
}
+ public String createLabel(CompletionProposal proposal) {
+ switch (proposal.getKind()) {
+ case CompletionProposal.METHOD_NAME_REFERENCE:
+ case CompletionProposal.METHOD_REF:
+ case CompletionProposal.POTENTIAL_METHOD_DECLARATION:
+ return createMethodProposalLabel(proposal);
+// case CompletionProposal.METHOD_DECLARATION:
+// return createOverrideMethodProposalLabel(proposal);
+ case CompletionProposal.TYPE_REF:
+ return createTypeProposalLabel(proposal);
+ case CompletionProposal.FIELD_REF:
+ case CompletionProposal.LOCAL_VARIABLE_REF:
+ case CompletionProposal.VARIABLE_DECLARATION:
+ case CompletionProposal.METHOD_DECLARATION:
+ return createSimpleLabelWithType(proposal);
+ case CompletionProposal.KEYWORD:
+ return createSimpleLabel(proposal);
+ default:
+ Assert.isTrue(false);
+ return null;
+ }
+ }
+
+ /**
+ * Creates a display label for a given type proposal. The display label
+ * consists of:
+ * <ul>
+ * <li>the simple type name (erased when the context is in javadoc)</li>
+ * <li>the package name</li>
+ * </ul>
+ * <p>
+ * Examples:
+ * A proposal for the generic type <code>java.util.List<E></code>, the display label
+ * is: <code>List<E> - java.util</code>.
+ * </p>
+ *
+ * @param typeProposal the method proposal to display
+ * @return the display label for the given type proposal
+ */
+ String createTypeProposalLabel(CompletionProposal typeProposal) {
+ String typeName= typeProposal.getType();
+ return createTypeProposalLabel(typeName);
+ }
+
+ /**
+ * Creates a display label for the given method proposal. The display label
+ * consists of:
+ * <ul>
+ * <li>the method name</li>
+ * <li>the parameter list (see {@link #createParameterList(CompletionProposal)})</li>
+ * <li>the upper bound of the return type (see {@link SignatureUtil#getUpperBound(String)})</li>
+ * <li>the raw simple name of the declaring type</li>
+ * </ul>
+ * <p>
+ * Examples:
+ * For the <code>get(int)</code> method of a variable of type <code>List<? extends Number></code>, the following
+ * display name is returned: <code>get(int index) Number - List</code>.<br>
+ * For the <code>add(E)</code> method of a variable of type <code>List<? super Number></code>, the following
+ * display name is returned: <code>add(Number o) void - List</code>.<br>
+ * </p>
+ *
+ * @param methodProposal the method proposal to display
+ * @return the display label for the given method proposal
+ */
+ String createMethodProposalLabel(CompletionProposal methodProposal) {
+ StringBuffer nameBuffer= new StringBuffer();
+
+ // method name
+ nameBuffer.append(methodProposal.getName());
+
+ // parameters
+ appendUnboundedParameterList(nameBuffer, methodProposal);
+
+ // declaring type
+ nameBuffer.append(RubyElementLabels.CONCAT_STRING);
+ String declaringType= methodProposal.getDeclaringType();
+ nameBuffer.append(declaringType);
+
+ return nameBuffer.toString();
+ }
+
+ private final StringBuffer appendUnboundedParameterList(StringBuffer buffer, CompletionProposal methodProposal) {
+ String[] names = methodProposal.getParameterNames();
+ if (names == null) return buffer;
+ if (names.length > 0) {
+ buffer.append('(');
+ }
+ for (int i = 0; i < names.length; i++) {
+ if (i > 0) {
+ buffer.append(',');
+ buffer.append(' ');
+ }
+ buffer.append(names[i]);
+ }
+ if (names.length > 0) {
+ buffer.append(')');
+ }
+ return buffer;
+ }
+
+ String createSimpleLabel(CompletionProposal proposal) {
+ return String.valueOf(proposal.getCompletion());
+ }
+
+ String createSimpleLabelWithType(CompletionProposal proposal) {
+ StringBuffer buf= new StringBuffer();
+ buf.append(proposal.getCompletion());
+ String typeName= proposal.getType();
+ if (typeName.length() > 0) {
+ buf.append(" "); //$NON-NLS-1$
+ buf.append(typeName);
+ }
+ return buf.toString();
+ }
+
+ String createTypeProposalLabel(String fullName) {
+ // only display innermost type name as type name, using any
+ // enclosing types as qualification
+ int qIndex= findSimpleNameStart(fullName);
+
+ StringBuffer buf= new StringBuffer();
+ buf.append(fullName, qIndex, fullName.length() - qIndex);
+ if (qIndex > 0) {
+ buf.append(RubyElementLabels.CONCAT_STRING);
+ buf.append(fullName, 0, qIndex - 1);
+ }
+ return buf.toString();
+ }
+
+ private int findSimpleNameStart(String fullName) {
+ int index = fullName.lastIndexOf("::");
+ if (index == -1) return 0;
+ return index;
+ }
+
}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyScriptCompletion.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyScriptCompletion.java 2007-02-07 18:18:08 UTC (rev 1937)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyScriptCompletion.java 2007-02-07 22:00:20 UTC (rev 1938)
@@ -237,7 +237,7 @@
String completion= proposal.getCompletion();
int start= proposal.getReplaceStart();
int length= getLength(proposal);
- String label= proposal.getName();
+ String label= fLabelProvider.createLabel(proposal);
int relevance= computeRelevance(proposal);
Image image = getImage(fLabelProvider.createImageDescriptor(proposal));
return new RubyCompletionProposal(completion, start, length, image, label, relevance);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-07 18:18:13
|
Revision: 1937
http://svn.sourceforge.net/rubyeclipse/?rev=1937&view=rev
Author: cawilliams
Date: 2007-02-07 10:18:08 -0800 (Wed, 07 Feb 2007)
Log Message:
-----------
apply same fix for Modules as I just did for Classes
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java 2007-02-07 18:15:08 UTC (rev 1936)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java 2007-02-07 18:18:08 UTC (rev 1937)
@@ -1311,6 +1311,12 @@
handleNode(iVisited);
String name = getFullyQualifiedName(iVisited.getCPath());
RubyModule module = new RubyModule(modelStack.peek(), name);
+ RubyElement parent = modelStack.peek();
+ RubyType existing = (RubyType) findChild(parent, IRubyElement.TYPE, name);
+ if (existing != null) {
+ // FIXME Should we just increment the occurence count like I do here, or should we conglomerate the types into one LogicalType?
+ module.occurrenceCount = existing.occurrenceCount + 1;
+ }
modelStack.push(module);
RubyElementInfo parentInfo = infoStack.peek();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-07 18:15:14
|
Revision: 1936
http://svn.sourceforge.net/rubyeclipse/?rev=1936&view=rev
Author: cawilliams
Date: 2007-02-07 10:15:08 -0800 (Wed, 07 Feb 2007)
Log Message:
-----------
when adding a new RubyClass, check for already existing versions of it in model. If one exists, then increment our occurence count so we're viewed as a different object. This has the by-product of fixing Bug # 215
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java 2007-02-07 18:12:48 UTC (rev 1935)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java 2007-02-07 18:15:08 UTC (rev 1936)
@@ -133,6 +133,8 @@
import org.rubypeople.rdt.core.IMethod;
import org.rubypeople.rdt.core.IRubyElement;
import org.rubypeople.rdt.core.IRubyScript;
+import org.rubypeople.rdt.core.RubyCore;
+import org.rubypeople.rdt.core.RubyModelException;
import org.rubypeople.rdt.internal.core.parser.RubyParser;
import org.rubypeople.rdt.internal.core.util.ASTUtil;
@@ -495,6 +497,12 @@
String name = getFullyQualifiedName(iVisited.getCPath());
RubyType handle = new RubyType(modelStack.peek(), name);
+ RubyElement parent = modelStack.peek();
+ RubyType existing = (RubyType) findChild(parent, IRubyElement.TYPE, name);
+ if (existing != null) {
+ // FIXME Should we just increment the occurence count like I do here, or should we conglomerate the types into one LogicalType?
+ handle.occurrenceCount = existing.occurrenceCount + 1;
+ }
modelStack.push(handle);
RubyElementInfo parentInfo = infoStack.peek();
@@ -508,9 +516,6 @@
String superClass = getSuperClassName(iVisited.getSuperNode());
info.setSuperclassName(superClass);
- // FIXME Types do not explicitly include Kernel; if this is solely for completions, then Kernel elements are gotten elsewhere.
- // FIXME If this must include Kernel, then completions will have to handle this differently than current. (Otherwise dupes of Kernel elements will show up when bringing together Class & its Superclass completions?)
-// info.setIncludedModuleNames(new String[] { "Kernel" });
info.setIncludedModuleNames(new String[] {});
infoStack.push(info);
@@ -525,6 +530,18 @@
return null;
}
+ private RubyType findChild(RubyElement parent, int type, String name) {
+ try {
+ ArrayList<IRubyElement> children = parent.getChildrenOfType(type);
+ for (IRubyElement element : children) {
+ if (element.getElementName().equals(name)) return (RubyType) element;
+ }
+ } catch (RubyModelException e) {
+ RubyCore.log(e);
+ }
+ return null;
+ }
+
/**
* Build up the fully qualified name of the super class for a class
* declaration
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-07 18:12:51
|
Revision: 1935
http://svn.sourceforge.net/rubyeclipse/?rev=1935&view=rev
Author: cawilliams
Date: 2007-02-07 10:12:48 -0800 (Wed, 07 Feb 2007)
Log Message:
-----------
fix nullpointerexception bug Ticket #241
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/IndexUpdater.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/IndexUpdater.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/IndexUpdater.java 2007-02-07 17:02:10 UTC (rev 1934)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/IndexUpdater.java 2007-02-07 18:12:48 UTC (rev 1935)
@@ -12,6 +12,7 @@
package org.rubypeople.rdt.internal.core.builder;
import java.util.Iterator;
+import java.util.List;
import java.util.Stack;
import org.eclipse.core.resources.IFile;
@@ -43,8 +44,7 @@
private void processNode(IFile file, Node node) {
// sgml-parser, line 35: InstAsgnNode contains DStrNode which returns null as child-node
- if (node == null)
- {
+ if (node == null) {
return ;
}
if (isScopingNode(node)) {
@@ -62,11 +62,12 @@
String qualifiedName = this.getContext() + defnNode .getName() ;
index.add(new MethodSymbol(qualifiedName), file, defnNode.getNameNode().getPosition()) ;
}
-
-
- for (Iterator iter = node.childNodes().iterator(); iter.hasNext();) {
- Node childNode = (Node) iter.next();
- processNode(file, childNode);
+ List childNodes = node.childNodes();
+ if (childNodes != null) {
+ for (Iterator iter = childNodes.iterator(); iter.hasNext();) {
+ Node childNode = (Node) iter.next();
+ processNode(file, childNode);
+ }
}
if (isScopingNode(node)) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-07 17:08:03
|
Revision: 1934
http://svn.sourceforge.net/rubyeclipse/?rev=1934&view=rev
Author: cawilliams
Date: 2007-02-07 09:02:10 -0800 (Wed, 07 Feb 2007)
Log Message:
-----------
Removed Paths:
-------------
trunk/org.rubypeople.rdt.build/map/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-07 16:45:30
|
Revision: 1933
http://svn.sourceforge.net/rubyeclipse/?rev=1933&view=rev
Author: cawilliams
Date: 2007-02-07 08:45:28 -0800 (Wed, 07 Feb 2007)
Log Message:
-----------
do some cleanup or translsation strings (remove a bunch we don't use)
Modified Paths:
--------------
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/internal/core/util/Messages.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/Messages.java 2007-02-07 16:13:32 UTC (rev 1932)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/Messages.java 2007-02-07 16:45:28 UTC (rev 1933)
@@ -22,11 +22,6 @@
// Do not instantiate
}
- public static String hierarchy_nullProject;
- public static String hierarchy_nullRegion;
- public static String hierarchy_nullFocusType;
- public static String hierarchy_creating;
- public static String hierarchy_creatingOnType;
public static String element_doesNotExist;
public static String element_notOnClasspath;
public static String element_invalidClassFileName;
@@ -36,7 +31,6 @@
public static String element_nullName;
public static String element_nullType;
public static String element_illegalParent;
- public static String sourcetype_invalidName;
public static String operation_needElements;
public static String operation_needName;
public static String operation_needPath;
@@ -66,41 +60,12 @@
public static String operation_pathOutsideProject;
public static String operation_sortelements;
public static String workingCopy_commit;
- public static String build_preparingBuild;
- public static String build_readStateProgress;
- public static String build_saveStateProgress;
- public static String build_saveStateComplete;
- public static String build_readingDelta;
- public static String build_analyzingDeltas;
- public static String build_analyzingSources;
- public static String build_cleaningOutput;
- public static String build_copyingResources;
- public static String build_compiling;
- public static String build_foundHeader;
- public static String build_fixedHeader;
- public static String build_oneError;
- public static String build_oneWarning;
- public static String build_multipleErrors;
- public static String build_multipleWarnings;
- public static String build_done;
- public static String build_wrongFileFormat;
public static String build_cannotSaveState;
public static String build_cannotSaveStates;
public static String build_initializationError;
public static String build_serializationError;
- public static String build_classFileCollision;
- public static String build_duplicateClassFile;
- public static String build_duplicateResource;
- public static String build_inconsistentClassFile;
- public static String build_inconsistentProject;
- public static String build_incompleteClassPath;
- public static String build_missingSourceFile;
- public static String build_prereqProjectHasClasspathProblems;
- public static String build_prereqProjectMustBeRebuilt;
- public static String build_abortDueToClasspathProblems;
public static String status_cannotUseDeviceOnPath;
public static String status_coreException;
- public static String status_defaultPackageReadOnly;
public static String status_evaluationError;
public static String status_JDOMError;
public static String status_IOException;
@@ -186,134 +151,8 @@
public static String convention_package_nameWithBlanks;
public static String convention_package_consecutiveDotsName;
public static String convention_package_uppercaseName;
- public static String dom_cannotDetail;
- public static String dom_nullTypeParameter;
- public static String dom_nullNameParameter;
- public static String dom_nullReturnType;
- public static String dom_nullExceptionType;
- public static String dom_mismatchArgNamesAndTypes;
- public static String dom_addNullChild;
- public static String dom_addIncompatibleChild;
- public static String dom_addChildWithParent;
- public static String dom_unableAddChild;
- public static String dom_addAncestorAsChild;
- public static String dom_addNullSibling;
- public static String dom_addSiblingBeforeRoot;
- public static String dom_addIncompatibleSibling;
- public static String dom_addSiblingWithParent;
- public static String dom_addAncestorAsSibling;
- public static String dom_addNullInterface;
- public static String dom_nullInterfaces;
- public static String correction_nullRequestor;
- public static String correction_nullUnit;
- public static String engine_searching;
- public static String engine_searching_indexing;
- public static String engine_searching_matching;
- public static String exception_wrongFormat;
- public static String process_name;
- public static String manager_filesToIndex;
- public static String manager_indexingInProgress;
- public static String disassembler_description;
- public static String disassembler_opentypedeclaration;
- public static String disassembler_closetypedeclaration;
- public static String disassembler_parametername;
- public static String disassembler_localvariablename;
- public static String disassembler_endofmethodheader;
- public static String disassembler_begincommentline;
- public static String disassembler_fieldhasconstant;
- public static String disassembler_endoffieldheader;
- public static String disassembler_sourceattributeheader;
- public static String disassembler_enclosingmethodheader;
- public static String disassembler_exceptiontableheader;
- public static String disassembler_linenumberattributeheader;
- public static String disassembler_localvariabletableattributeheader;
- public static String disassembler_localvariabletypetableattributeheader;
- public static String disassembler_arraydimensions;
- public static String disassembler_innerattributesheader;
- public static String disassembler_inner_class_info_name;
- public static String disassembler_outer_class_info_name;
- public static String disassembler_inner_name;
- public static String disassembler_inner_accessflags;
- public static String disassembler_genericattributeheader;
- public static String disassembler_signatureattributeheader;
- public static String disassembler_indentation;
- public static String disassembler_constantpoolindex;
- public static String disassembler_space;
- public static String disassembler_comma;
- public static String disassembler_openinnerclassentry;
- public static String disassembler_closeinnerclassentry;
- public static String disassembler_deprecated;
- public static String disassembler_constantpoolheader;
- public static String disassembler_constantpool_class;
- public static String disassembler_constantpool_double;
- public static String disassembler_constantpool_float;
- public static String disassembler_constantpool_integer;
- public static String disassembler_constantpool_long;
- public static String disassembler_constantpool_string;
- public static String disassembler_constantpool_fieldref;
- public static String disassembler_constantpool_interfacemethodref;
- public static String disassembler_constantpool_methodref;
- public static String disassembler_constantpool_name_and_type;
- public static String disassembler_constantpool_utf8;
- public static String disassembler_annotationdefaultheader;
- public static String disassembler_annotationdefaultvalue;
- public static String disassembler_annotationenumvalue;
- public static String disassembler_annotationclassvalue;
- public static String disassembler_annotationannotationvalue;
- public static String disassembler_annotationarrayvaluestart;
- public static String disassembler_annotationarrayvalueend;
- public static String disassembler_annotationentrystart;
- public static String disassembler_annotationentryend;
- public static String disassembler_annotationcomponent;
- public static String disassembler_runtimevisibleannotationsattributeheader;
- public static String disassembler_runtimeinvisibleannotationsattributeheader;
- public static String disassembler_runtimevisibleparameterannotationsattributeheader;
- public static String disassembler_runtimeinvisibleparameterannotationsattributeheader;
- public static String disassembler_parameterannotationentrystart;
- public static String disassembler_stackmaptableattributeheader;
- public static String classfileformat_versiondetails;
- public static String classfileformat_methoddescriptor;
- public static String classfileformat_fieldddescriptor;
- public static String classfileformat_stacksAndLocals;
- public static String classfileformat_superflagisnotset;
- public static String classfileformat_superflagisset;
- public static String classfileformat_clinitname;
- public static String classformat_classformatexception;
- public static String classformat_anewarray;
- public static String classformat_checkcast;
- public static String classformat_instanceof;
- public static String classformat_ldc_w_class;
- public static String classformat_ldc_w_float;
- public static String classformat_ldc_w_integer;
- public static String classformat_ldc_w_string;
- public static String classformat_ldc2_w_long;
- public static String classformat_ldc2_w_double;
- public static String classformat_multianewarray;
- public static String classformat_new;
- public static String classformat_iinc;
- public static String classformat_invokespecial;
- public static String classformat_invokeinterface;
- public static String classformat_invokestatic;
- public static String classformat_invokevirtual;
- public static String classformat_getfield;
- public static String classformat_getstatic;
- public static String classformat_putstatic;
- public static String classformat_putfield;
- public static String classformat_newarray_boolean;
- public static String classformat_newarray_char;
- public static String classformat_newarray_float;
- public static String classformat_newarray_double;
- public static String classformat_newarray_byte;
- public static String classformat_newarray_short;
- public static String classformat_newarray_int;
- public static String classformat_newarray_long;
- public static String classformat_store;
- public static String classformat_load;
- public static String classfileformat_anyexceptionhandler;
- public static String classfileformat_exceptiontableentry;
- public static String classfileformat_linenumbertableentry;
- public static String classfileformat_localvariabletableentry;
- public static String classfileformat_versionUnknown;
+ public static String build_saveStateProgress;
+ public static String build_saveStateComplete;
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-02-07 16:13:32 UTC (rev 1932)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/messages.properties 2007-02-07 16:45:28 UTC (rev 1933)
@@ -11,25 +11,16 @@
### JavaModel messages_
-### hierarchy
-hierarchy_nullProject = Project argument cannot be null
-hierarchy_nullRegion = Region cannot be null
-hierarchy_nullFocusType = Type focus cannot be null
-hierarchy_creating = Creating type hierarchy...
-hierarchy_creatingOnType = Creating type hierarchy on {0}...
-
### java element
element_doesNotExist = {0} does not exist
element_notOnClasspath = {0} is not on its project's build path
element_invalidClassFileName = Class file name must end with .class
element_reconciling = Reconciling...
element_attachingSource = Attaching source...
-element_invalidType = Type is not one of the defined constants
element_invalidResourceForProject = Illegal argument - must be one of IProject, IFolder, or IFile
element_nullName = Name cannot be null
element_nullType = Type cannot be null
element_illegalParent = Illegal parent argument
-sourcetype_invalidName = The source type has an invalid name: {0}
### java model operations
operation_needElements = Operation requires one or more elements
@@ -65,47 +56,18 @@
workingCopy_commit = Committing working copy...
### build status messages
-build_preparingBuild = Preparing for build
-build_readStateProgress = Reading saved built state for project {0}
build_saveStateProgress = Saving built state for project {0}
build_saveStateComplete = Saved in {0} ms
-build_readingDelta = Reading resource change information for {0}
-build_analyzingDeltas = Analyzing deltas
-build_analyzingSources = Analyzing sources
-build_cleaningOutput = Cleaning output folder
-build_copyingResources = Copying resources to the output folder
-build_compiling = Compiling {0}
-build_foundHeader = Found
-build_fixedHeader = Fixed
-build_oneError = 1 error
-build_oneWarning = 1 warning
-build_multipleErrors = {0} errors
-build_multipleWarnings = {0} warnings
-build_done = Build done
### build errors
-build_wrongFileFormat = Wrong file format
build_cannotSaveState = Error saving last build state for project {0}
build_cannotSaveStates = Error saving build states
build_initializationError = Builder initialization error
build_serializationError = Builder serialization error
-### build inconsistencies
-build_classFileCollision = Class file collision: {0}
-build_duplicateClassFile = The type {0} is already defined
-build_duplicateResource = The resource is a duplicate of {0} and was not copied to the output folder
-build_inconsistentClassFile = A class file was not written. The project may be inconsistent, if so try refreshing this project and building it
-build_inconsistentProject = The project was not built due to "{0}". Fix the problem, then try refreshing this project and building it since it may be inconsistent
-build_incompleteClassPath = The project was not built since its build path is incomplete. Cannot find the class file for {0}. Fix the build path then try building this project
-build_missingSourceFile = The project was not built since the source file {0} could not be read
-build_prereqProjectHasClasspathProblems = The project was not built since it depends on {0}, which has build path errors
-build_prereqProjectMustBeRebuilt = The project cannot be built until its prerequisite {0} is built. Cleaning and building all projects is recommended
-build_abortDueToClasspathProblems = The project cannot be built until build path errors are resolved
-
### status
status_cannotUseDeviceOnPath = Operation requires a path with no device. Path specified was: {0}
status_coreException = Core exception
-status_defaultPackageReadOnly = Default package is read-only
status_evaluationError = Evaluation error: {0}
status_JDOMError = JDOM error
status_IOException = I/O exception
@@ -197,150 +159,3 @@
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
-convention_compiler_invalidCompilerOption = ''{0}'' is not valid value for ''{1}'' compiler option.
-convention_compiler_incompatibleTargetForSource = Target level ''{0}'' is incompatible with source level ''{1}''. A target level ''{1}'' or better is required
-convention_compiler_incompatibleComplianceForSource = Compliance level ''{0}'' is incompatible with source level ''{1}''. A compliance level ''{1}'' or better is required
-convention_compiler_incompatibleComplianceForTarget = Compliance level ''{0}'' is incompatible with target level ''{1}''. A compliance level ''{1}'' or better is required
-
-### DOM
-dom_cannotDetail = Unable to generate detailed source indexes
-dom_nullTypeParameter = Cannot add parameter with null type
-dom_nullNameParameter = Cannot add parameter with null name
-dom_nullReturnType = Return type cannot be null
-dom_nullExceptionType = Cannot add null exception
-dom_mismatchArgNamesAndTypes = Types and names must have identical length
-dom_addNullChild = Attempt to add null child
-dom_addIncompatibleChild = Attempt to add child of incompatible type
-dom_addChildWithParent = Attempt to add child that is already parented
-dom_unableAddChild = Attempt to add child to node that cannot have children
-dom_addAncestorAsChild = Attempt to add ancestor as child
-dom_addNullSibling = Attempt to insert null sibling
-dom_addSiblingBeforeRoot = Attempt to insert sibling before root node
-dom_addIncompatibleSibling = Attempt to insert sibling of incompatible type
-dom_addSiblingWithParent = Attempt to insert sibling that is already parented
-dom_addAncestorAsSibling = Attempt to insert ancestor as sibling
-dom_addNullInterface = Cannot add null interface
-dom_nullInterfaces = Illegal to set super interfaces to null
-
-### correction
-correction_nullRequestor = Requestor cannot be null
-correction_nullUnit = Compilation unit cannot be null
-
-### Eclipse Java Core Search messages.
-
-engine_searching = Searching...
-engine_searching_indexing = {0}: lookup indexes...
-engine_searching_matching = {0}: locate matches...
-exception_wrongFormat = Wrong format
-process_name = Java indexing
-manager_filesToIndex = {0} files to index
-manager_indexingInProgress = Java indexing in progress
-
-### Disassembler messages
-
-### disassembler
-disassembler_description = Default classfile disassembler
-disassembler_opentypedeclaration =\ {
-disassembler_closetypedeclaration = }
-disassembler_parametername = arg
-disassembler_endofmethodheader = ;
-disassembler_begincommentline = //\
-disassembler_fieldhasconstant =\ =\
-disassembler_endoffieldheader = ;
-disassembler_sourceattributeheader = Compiled from
-disassembler_enclosingmethodheader = Enclosing Method:
-disassembler_exceptiontableheader = Exception Table:
-disassembler_linenumberattributeheader = Line numbers:
-disassembler_localvariabletableattributeheader = Local variable table:
-disassembler_localvariabletypetableattributeheader = Local variable type table:
-disassembler_arraydimensions = []
-disassembler_innerattributesheader = Inner classes:
-disassembler_inner_class_info_name = inner class info:
-disassembler_outer_class_info_name = outer class info:
-disassembler_inner_name = inner name:
-disassembler_inner_accessflags = accessflags:
-disassembler_genericattributeheader = Attribute:\
-disassembler_genericattributename = Name:
-disassembler_genericattributelength =\ Length:
-disassembler_signatureattributeheader = Signature:\
-disassembler_indentation = \
-disassembler_constantpoolindex =\ #
-disassembler_classmemberseparator = .
-disassembler_space = \
-disassembler_comma = ,
-disassembler_openinnerclassentry = [
-disassembler_closeinnerclassentry = ]
-disassembler_deprecated =\ (deprecated)
-disassembler_constantpoolheader = Constant pool:
-disassembler_constantpool_class = constant #{0} class: #{1} {2}
-disassembler_constantpool_double = constant #{0} double: {1}
-disassembler_constantpool_float = constant #{0} float: {1}
-disassembler_constantpool_integer = constant #{0} integer: {1}
-disassembler_constantpool_long = constant #{0} long: {1}
-disassembler_constantpool_string = constant #{0} string: #{1} {2}
-disassembler_constantpool_fieldref = constant #{0} field.ref: #{1}_#{2} {3}_{4}
-disassembler_constantpool_interfacemethodref = constant #{0} interface.method.ref: #{1}.#{2} {3}_{4}
-disassembler_constantpool_methodref = constant #{0} method.ref: #{1}_#{2} {3}_{4}
-disassembler_constantpool_name_and_type = constant #{0} name.and.type: #{1}.#{2} {3} {4}
-disassembler_constantpool_utf8 = constant #{0} utf8: {1}
-disassembler_annotationdefaultheader = Annotation Default:\
-disassembler_annotationdefaultvalue= {0} (constant type)
-disassembler_annotationenumvalue = {2}_{3}(enum type #{0}.#{1})
-disassembler_annotationclassvalue = {1} (#{0} class type)
-disassembler_annotationannotationvalue = annotation value =
-disassembler_annotationarrayvaluestart = [
-disassembler_annotationarrayvalueend = ]
-disassembler_annotationentrystart = #{0} @{1}(
-disassembler_annotationentryend = )
-disassembler_annotationcomponent = #{0} {1}=
-disassembler_runtimevisibleannotationsattributeheader= RuntimeVisibleAnnotations:\
-disassembler_runtimeinvisibleannotationsattributeheader= RuntimeInvisibleAnnotations:\
-disassembler_runtimevisibleparameterannotationsattributeheader= RuntimeVisibleParameterAnnotations:\
-disassembler_runtimeinvisibleparameterannotationsattributeheader= RuntimeInvisibleParameterAnnotations:\
-disassembler_parameterannotationentrystart=Number of annotations for parameter {0}: {1}
-
-### classfileformat decoding
-classfileformat_versiondetails =\ (version {0} : {1}.{2}, {3})
-classfileformat_methoddescriptor =Method descriptor
-classfileformat_fieldddescriptor =Field descriptor
-classfileformat_maxStack = Stack:
-classfileformat_maxLocals = Locals:
-classfileformat_superflagisnotset = no super bit
-classfileformat_superflagisset = super bit
-classfileformat_clinitname = {}
-
-### string displayed for each opcode
-classformat_invokeinterfacemethod =\ <Interface method
-classformat_invokeinterfacemethodclose = >
-classformat_invokespecialconstructor =\ <Constructor
-classformat_invokespecialconstructorclose = >
-classformat_invokespecialmethod =\ <Method
-classformat_invokespecialmethodclose = >
-classformat_invokestaticmethod =\ <Method
-classformat_invokestaticmethodclose = >
-classformat_invokevirtualmethod =\ <Method
-classformat_invokevirtualmethodclose = >
-classformat_getfield = \ <Field
-classformat_getfieldclose = >
-classformat_getstatic = \ <Field
-classformat_getstaticclose = >
-classformat_putstatic =\ <Field
-classformat_putstaticclose = >
-classformat_putfield =\ <Field
-classformat_putfieldclose = >
-classformat_nargs =\ [nargs :
-classformat_interfacemethodrefindex = ] #
-classfileformat_anyexceptionhandler=any
-classfileformat_fielddescriptorindex=#
-classfileformat_exceptiontablefrom=[pc:
-classfileformat_exceptiontableto=, pc:
-classfileformat_exceptiontablegoto=] ->
-classfileformat_exceptiontablewhen =\ when :
-classfileformat_linenumbertablefrom=[pc:
-classfileformat_linenumbertableto=, line:
-classfileformat_linenumbertableclose=]
-classfileformat_localvariabletablefrom=[pc:
-classfileformat_localvariabletableto=, pc:
-classfileformat_localvariabletablelocalname=] local:
-classfileformat_localvariabletablelocalindex=\ index:
-classfileformat_localvariabletablelocaltype=\ type:
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-07 16:13:37
|
Revision: 1932
http://svn.sourceforge.net/rubyeclipse/?rev=1932&view=rev
Author: cawilliams
Date: 2007-02-07 08:13:32 -0800 (Wed, 07 Feb 2007)
Log Message:
-----------
start removing options that aren't hooked up under the hood for errors/warnings. Also do the plumbing so that it actually follows users' settings for the options available (only empty statements so far)
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyCore.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyCorePreferenceInitializer.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/RubyLintVisitor.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/OptionsConfigurationBlock.java
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/TodoTaskConfigurationBlock.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/compiler/CompilerOptions.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyCore.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyCore.java 2007-02-07 15:35:26 UTC (rev 1931)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyCore.java 2007-02-07 16:13:32 UTC (rev 1932)
@@ -232,7 +232,7 @@
/**
* Possible configurable option ID.
* @see #getDefaultOptions()
- * @since 0.90.
+ * @since 0.9.0
*/
public static final String COMPILER_PB_EMPTY_STATEMENT = PLUGIN_ID + ".compiler.problem.emptyStatement"; //$NON-NLS-1$
/**
Added: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/compiler/CompilerOptions.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/compiler/CompilerOptions.java (rev 0)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/compiler/CompilerOptions.java 2007-02-07 16:13:32 UTC (rev 1932)
@@ -0,0 +1,52 @@
+package org.rubypeople.rdt.internal.compiler;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class CompilerOptions {
+
+ public static final String OPTION_ReportEmptyStatement = "org.rubypeople.rdt.core.compiler.problem.emptyStatement"; //$NON-NLS-1$
+
+ public static final long EmptyStatement = 0x80000;
+
+ public static final String ERROR = "error"; //$NON-NLS-1$
+ public static final String WARNING = "warning"; //$NON-NLS-1$
+ public static final String IGNORE = "ignore"; //$NON-NLS-1$
+
+// Default severity level for handlers
+ public long errorThreshold = 0;
+ public long warningThreshold = 0;
+
+ public Map getMap() {
+ Map optionsMap = new HashMap(30);
+ optionsMap.put(OPTION_ReportEmptyStatement, getSeverityString(EmptyStatement));
+ return optionsMap;
+ }
+
+ public String getSeverityString(long irritant) {
+ if((this.warningThreshold & irritant) != 0)
+ return WARNING;
+ if((this.errorThreshold & irritant) != 0)
+ return ERROR;
+ return IGNORE;
+ }
+
+ public void set(Map optionsMap) {
+ Object optionValue;
+ if ((optionValue = optionsMap.get(OPTION_ReportEmptyStatement)) != null) updateSeverity(EmptyStatement, optionValue);
+ }
+
+ void updateSeverity(long irritant, Object severityString) {
+ if (ERROR.equals(severityString)) {
+ this.errorThreshold |= irritant;
+ this.warningThreshold &= ~irritant;
+ } else if (WARNING.equals(severityString)) {
+ this.errorThreshold &= ~irritant;
+ this.warningThreshold |= irritant;
+ } else if (IGNORE.equals(severityString)) {
+ this.errorThreshold &= ~irritant;
+ this.warningThreshold &= ~irritant;
+ }
+ }
+
+}
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyCorePreferenceInitializer.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyCorePreferenceInitializer.java 2007-02-07 15:35:26 UTC (rev 1931)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyCorePreferenceInitializer.java 2007-02-07 16:13:32 UTC (rev 1932)
@@ -1,6 +1,5 @@
package org.rubypeople.rdt.internal.core;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
@@ -10,15 +9,17 @@
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.rubypeople.rdt.core.RubyCore;
import org.rubypeople.rdt.core.formatter.DefaultCodeFormatterConstants;
+import org.rubypeople.rdt.internal.compiler.CompilerOptions;
public class RubyCorePreferenceInitializer extends AbstractPreferenceInitializer {
public void initializeDefaultPreferences() {
// Get options names set
HashSet optionNames = RubyModelManager.getRubyModelManager().optionNames;
-
+
+ // Compiler settings
+ Map defaultOptionsMap = new CompilerOptions().getMap(); // compiler defaults
- Map defaultOptionsMap = new HashMap();
// Override some compiler defaults
defaultOptionsMap.put(RubyCore.COMPILER_TASK_TAGS, RubyCore.DEFAULT_TASK_TAGS);
defaultOptionsMap.put(RubyCore.COMPILER_TASK_PRIORITIES, RubyCore.DEFAULT_TASK_PRIORITIES);
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/RubyLintVisitor.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/RubyLintVisitor.java 2007-02-07 15:35:26 UTC (rev 1931)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/RubyLintVisitor.java 2007-02-07 16:13:32 UTC (rev 1932)
@@ -56,9 +56,7 @@
String source = NodeUtil.getSource(contents, iVisited);
if (iVisited.getThenBody() == null && source.indexOf("unless") == -1) {
- IProblem problem = createProblem(
- RubyCore.COMPILER_PB_EMPTY_STATEMENT, iVisited.getPosition(), "Empty Conditional Body");
-
+ IProblem problem = createProblem(RubyCore.COMPILER_PB_EMPTY_STATEMENT, iVisited.getPosition(), "Empty Conditional Body");
if (problem != null)
problemRequestor.acceptProblem(problem);
}
@@ -81,7 +79,6 @@
public Instruction visitIterNode(IterNode iVisited) {
if (iVisited.getBodyNode() == null) {
IProblem problem = createProblem(RubyCore.COMPILER_PB_EMPTY_STATEMENT, iVisited.getPosition(), "Empty Block");
-
if (problem != null)
problemRequestor.acceptProblem(problem);
}
@@ -102,7 +99,6 @@
public Instruction visitDefsNode(DefsNode iVisited) {
if (iVisited.getBodyNode() == null) {
IProblem problem = createProblem(RubyCore.COMPILER_PB_EMPTY_STATEMENT, iVisited.getPosition(), "Empty Method Definition");
-
if (problem != null)
problemRequestor.acceptProblem(problem);
}
@@ -123,6 +119,8 @@
String value = RubyCore.getOption(compilerOption);
if (value != null && value.equals(RubyCore.ERROR))
return new Error(position, message);
+ if (value != null && value.equals(RubyCore.IGNORE))
+ return null;
return new Warning(position, message);
}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/OptionsConfigurationBlock.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/OptionsConfigurationBlock.java 2007-02-07 15:35:26 UTC (rev 1931)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/OptionsConfigurationBlock.java 2007-02-07 16:13:32 UTC (rev 1932)
@@ -60,7 +60,7 @@
* Abstract options configuration block providing a general implementation for setting up
* an options configuration page.
*
- * @since 2.1
+ * @since 0.8.0
*/
public abstract class OptionsConfigurationBlock {
@@ -238,11 +238,11 @@
return new Key(plugin, key);
}
- protected final static Key getJDTCoreKey(String key) {
+ protected final static Key getRDTCoreKey(String key) {
return getKey(RubyCore.PLUGIN_ID, key);
}
- protected final static Key getJDTUIKey(String key) {
+ protected final static Key getRDTUIKey(String key) {
return getKey(RubyUI.ID_PLUGIN, key);
}
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-02-07 15:35:26 UTC (rev 1931)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/ProblemSeveritiesConfigurationBlock.java 2007-02-07 16:13:32 UTC (rev 1932)
@@ -33,15 +33,16 @@
private static final String SETTINGS_SECTION_NAME= null; //"ProblemSeveritiesConfigurationBlock";
// Preference store keys, see RubyCore.getOptions
- private static final Key PREF_PB_ENSURE_BLOCK_NOT_COMPLETING = getJDTCoreKey(RubyCore.COMPILER_PB_ENSURE_BLOCK_NOT_COMPLETING);
- private static final Key PREF_PB_EMPTY_STATEMENT = getJDTCoreKey(RubyCore.COMPILER_PB_EMPTY_STATEMENT);
- private static final Key PREF_PB_HIDDEN_RESCUE_BLOCK = getJDTCoreKey(RubyCore.COMPILER_PB_HIDDEN_RESCUE_BLOCK);
- private static final Key PREF_PB_FALLTHROUGH_CASE = getJDTCoreKey(RubyCore.COMPILER_PB_FALLTHROUGH_CASE);
- private static final Key PREF_PB_NULL_REFERENCE = getJDTCoreKey(RubyCore.COMPILER_PB_NULL_REFERENCE);
- private static final Key PREF_PB_UNUSED_LOCAL = getJDTCoreKey(RubyCore.COMPILER_PB_UNUSED_LOCAL);
- private static final Key PREF_PB_UNUSED_PARAMETER = getJDTCoreKey(RubyCore.COMPILER_PB_UNUSED_PARAMETER);
- private static final Key PREF_PB_UNUSED_PRIVATE = getJDTCoreKey(RubyCore.COMPILER_PB_UNUSED_PRIVATE_MEMBER);
- private static final Key PREF_PB_UNNECESSARY_ELSE = getJDTCoreKey(RubyCore.COMPILER_PB_UNNECESSARY_ELSE);
+ // 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;
@@ -60,9 +61,11 @@
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
+// 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
};
}
@@ -134,42 +137,42 @@
inner.setLayout(new GridLayout(nColumns, false));
excomposite.setClient(inner);
- 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_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_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);
- 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_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);
+// 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);
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/TodoTaskConfigurationBlock.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/TodoTaskConfigurationBlock.java 2007-02-07 15:35:26 UTC (rev 1931)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/TodoTaskConfigurationBlock.java 2007-02-07 16:13:32 UTC (rev 1932)
@@ -45,10 +45,10 @@
*/
public class TodoTaskConfigurationBlock extends OptionsConfigurationBlock {
- private static final Key PREF_COMPILER_TASK_TAGS= getJDTCoreKey(RubyCore.COMPILER_TASK_TAGS);
- private static final Key PREF_COMPILER_TASK_PRIORITIES= getJDTCoreKey(RubyCore.COMPILER_TASK_PRIORITIES);
+ private static final Key PREF_COMPILER_TASK_TAGS= getRDTCoreKey(RubyCore.COMPILER_TASK_TAGS);
+ private static final Key PREF_COMPILER_TASK_PRIORITIES= getRDTCoreKey(RubyCore.COMPILER_TASK_PRIORITIES);
- private static final Key PREF_COMPILER_TASK_CASE_SENSITIVE= getJDTCoreKey(RubyCore.COMPILER_TASK_CASE_SENSITIVE);
+ private static final Key PREF_COMPILER_TASK_CASE_SENSITIVE= getRDTCoreKey(RubyCore.COMPILER_TASK_CASE_SENSITIVE);
private static final String PRIORITY_HIGH= RubyCore.COMPILER_TASK_PRIORITY_HIGH;
private static final String PRIORITY_NORMAL= RubyCore.COMPILER_TASK_PRIORITY_NORMAL;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-07 15:35:27
|
Revision: 1931
http://svn.sourceforge.net/rubyeclipse/?rev=1931&view=rev
Author: cawilliams
Date: 2007-02-07 07:35:26 -0800 (Wed, 07 Feb 2007)
Log Message:
-----------
add provider
Modified Paths:
--------------
trunk/org.jruby/META-INF/MANIFEST.MF
Modified: trunk/org.jruby/META-INF/MANIFEST.MF
===================================================================
--- trunk/org.jruby/META-INF/MANIFEST.MF 2007-02-07 15:35:14 UTC (rev 1930)
+++ trunk/org.jruby/META-INF/MANIFEST.MF 2007-02-07 15:35:26 UTC (rev 1931)
@@ -1,6 +1,6 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
-Bundle-Name: Jruby Plug-in
+Bundle-Name: JRuby Plug-in
Bundle-SymbolicName: org.jruby
Bundle-Version: 0.9.2.2944
Bundle-Localization: plugin
@@ -38,3 +38,4 @@
org.jruby.util,
org.jruby.util.collections,
org.jruby.yaml
+Bundle-Vendor: org.jruby
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-07 15:35:21
|
Revision: 1930
http://svn.sourceforge.net/rubyeclipse/?rev=1930&view=rev
Author: cawilliams
Date: 2007-02-07 07:35:14 -0800 (Wed, 07 Feb 2007)
Log Message:
-----------
add Mirko, Thomas and Lukas to list of contributors
Modified Paths:
--------------
trunk/org.rubypeople.rdt-feature/feature.xml
Modified: trunk/org.rubypeople.rdt-feature/feature.xml
===================================================================
--- trunk/org.rubypeople.rdt-feature/feature.xml 2007-02-07 15:24:15 UTC (rev 1929)
+++ trunk/org.rubypeople.rdt-feature/feature.xml 2007-02-07 15:35:14 UTC (rev 1930)
@@ -15,15 +15,16 @@
<copyright>
The Ruby Development Tools (RDT) plugin for eclipse is subject
to the Common Public License (CPL) v 1.0. All files of the RDT
-except
-for the external plug-ins and libraries named below are copyright
-of RubyPeople.
-RubyPeople is not a legal entity, but consists of the following
-people
-who have contributed to the RDT. Currently these are (in alphabetical
-order):
-Markus Barchfeld, David Corbin, Zach Dennis, Adam Williams and
-Chris Williams. See www.rubypeople.org for more information.
+except for the external plug-ins and libraries named below are
+copyright of RubyPeople. RubyPeople is not a legal entity, but
+consists of the following people who have contributed to the
+RDT. Currently these are (in alphabetical order):
+
+Markus Barchfeld, Thomas Corbat, David Corbin, Zach Dennis,
+Lukas Felber, Mirko Stocker, Adam Williams and Chris Williams.
+
+See www.rubypeople.org for more information.
+
The RDT feature contains the following plug-ins and libraries
from external providers:
RegExp plug-in, http://e-p-i-c.sourceforge.net
@@ -32,9 +33,9 @@
The file org.rubypeople.rdt.launching/ruby/eclipseDebug.rb
is based on the debug.rb file, which is part of the ruby 1.6.8
release. Because of the nature of developing this plugin, many
-features or concepts have been copied from the jdt. Therefore
+features or concepts have been copied from the JDT. Therefore
you will find code fragements which have been copied from the
-jdt. We did not add the IBM copyright with every code fragment
+JDT. We did not add the IBM copyright with every code fragment
of this kind. We think that this is in accordance with the CPL
and is not an intended removal of copyright.
</copyright>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-07 15:24:16
|
Revision: 1929
http://svn.sourceforge.net/rubyeclipse/?rev=1929&view=rev
Author: cawilliams
Date: 2007-02-07 07:24:15 -0800 (Wed, 07 Feb 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java 2007-02-07 15:23:15 UTC (rev 1928)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java 2007-02-07 15:24:15 UTC (rev 1929)
@@ -27,9 +27,6 @@
// Read from offset back until we hit a: space, period
// if we hit a period, use character before period as offset for
// inferrer
- // if we hit a space, use character after space?
- // TODO We need to handle other bad syntax like invoking completion
- // right after an @
StringBuffer tmpPrefix = new StringBuffer();
for (int i = offset; i >= 0; i--) {
char curChar = source.charAt(i);
@@ -38,6 +35,7 @@
case '.': // if it breaks syntax, lets fix it
case '$':
case '@':
+ // TODO What if there is a valid character after this, so syntax isn't broken?
source.deleteCharAt(i);
break;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-07 15:23:18
|
Revision: 1928
http://svn.sourceforge.net/rubyeclipse/?rev=1928&view=rev
Author: cawilliams
Date: 2007-02-07 07:23:15 -0800 (Wed, 07 Feb 2007)
Log Message:
-----------
do some major refactoring of completion code. Move out a class to handle source, prefixes, offsets, correcting source - CompletionContext.
Also move storing/grabbing globals into ExperimentalIndex.
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/search/ExperimentalIndex.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java
Added: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java (rev 0)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java 2007-02-07 15:23:15 UTC (rev 1928)
@@ -0,0 +1,128 @@
+package org.rubypeople.rdt.internal.codeassist;
+
+import org.rubypeople.rdt.core.IRubyScript;
+import org.rubypeople.rdt.core.RubyModelException;
+
+public class CompletionContext {
+
+ private IRubyScript script;
+ private int offset;
+ private boolean isMethodInvokation = false;
+ private String correctedSource;
+ private String partialPrefix;
+ private String fullPrefix;
+ private int replaceStart;
+
+ public CompletionContext(IRubyScript script, int offset) throws RubyModelException {
+ this.script = script;
+ if (offset < 0)
+ offset = 0;
+ this.offset = offset;
+ replaceStart = offset + 1;
+ run();
+ }
+
+ private void run() throws RubyModelException {
+ StringBuffer source = new StringBuffer(script.getSource());
+ // Read from offset back until we hit a: space, period
+ // if we hit a period, use character before period as offset for
+ // inferrer
+ // if we hit a space, use character after space?
+ // TODO We need to handle other bad syntax like invoking completion
+ // right after an @
+ StringBuffer tmpPrefix = new StringBuffer();
+ for (int i = offset; i >= 0; i--) {
+ char curChar = source.charAt(i);
+ if (offset == i) { // check the first character
+ switch (curChar) {
+ case '.': // if it breaks syntax, lets fix it
+ case '$':
+ case '@':
+ source.deleteCharAt(i);
+ break;
+ }
+ }
+ if (curChar == '.') {
+ isMethodInvokation = true;
+ offset = i - 1;
+ if (partialPrefix == null) this.partialPrefix = tmpPrefix.toString();
+ }
+ if (Character.isWhitespace(curChar)) {
+ offset = i + 1;
+ break;
+ }
+ tmpPrefix.insert(0, curChar);
+ }
+ this.fullPrefix = tmpPrefix.toString();
+ if (partialPrefix == null)
+ partialPrefix = fullPrefix;
+ if (partialPrefix != null)
+ replaceStart -= partialPrefix.length();
+ this.correctedSource = source.toString();
+ }
+
+ public boolean isMethodInvokation() {
+ return isMethodInvokation;
+ }
+
+ /**
+ * The last portion of prefix is not null, not empty and starts with an uppercase letter
+ * @return
+ */
+ public boolean isConstant() {
+ return getPartialPrefix() != null && getPartialPrefix().length() > 0 && Character.isUpperCase(getPartialPrefix().charAt(0));
+ }
+
+ public int getReplaceStart() {
+ return replaceStart;
+ }
+
+ /**
+ * Modified source which should not fail parsing.
+ * @return
+ */
+ public String getCorrectedSource() {
+ return correctedSource;
+ }
+
+ /**
+ * The original source
+ * @return
+ */
+ public String getSource() {
+ try {
+ return getScript().getSource();
+ } catch (RubyModelException e) {
+ return "";
+ }
+ }
+
+ public String getFullPrefix() {
+ return fullPrefix;
+ }
+
+ public String getPartialPrefix() {
+ return partialPrefix;
+ }
+
+ public int getOffset() {
+ return offset;
+ }
+
+ public IRubyScript getScript() {
+ return script;
+ }
+
+ public boolean emptyPrefix() {
+ return getFullPrefix() == null || getFullPrefix().length() == 0;
+ }
+
+ public boolean prefixStartsWith(String name) {
+ return name != null && getPartialPrefix() != null && name.startsWith(getPartialPrefix());
+ }
+
+ public boolean isGlobal() {
+ return !emptyPrefix() && !isMethodInvokation() && getPartialPrefix().startsWith("$");
+ }
+
+}
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-02-07 14:16:50 UTC (rev 1927)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-02-07 15:23:15 UTC (rev 1928)
@@ -3,6 +3,7 @@
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -28,7 +29,6 @@
import org.rubypeople.rdt.core.IMethod;
import org.rubypeople.rdt.core.IParent;
import org.rubypeople.rdt.core.IRubyElement;
-import org.rubypeople.rdt.core.IRubyProject;
import org.rubypeople.rdt.core.IRubyScript;
import org.rubypeople.rdt.core.IType;
import org.rubypeople.rdt.core.RubyCore;
@@ -47,83 +47,65 @@
public class CompletionEngine {
private CompletionRequestor requestor;
- private String prefix;
+ private CompletionContext context;
public CompletionEngine(CompletionRequestor requestor) {
this.requestor = requestor;
}
public void complete(IRubyScript script, int offset) throws RubyModelException {
- this.prefix = null;
- this.requestor.beginReporting();
- if (offset < 0)
- offset = 0;
- StringBuffer source = new StringBuffer(script.getSource());
- int replaceStart = offset + 1;
- // Read from offset back until we hit a: space, period
- // if we hit a period, use character before period as offset for
- // inferrer
- // if we hit a space, use character after space?
- // TODO We need to handle other bad syntax like invoking completion
- // right after an @
- StringBuffer tmpPrefix = new StringBuffer();
- boolean isMethod = false;
- for (int i = offset; i >= 0; i--) {
- char curChar = source.charAt(i);
- if (curChar == '.') {
- isMethod = true;
- if (offset == i) { // if it's the first character we looked at,
- // fix syntax
- source.deleteCharAt(i);
- offset--;
- break;
+ this.requestor.beginReporting();
+ context = new CompletionContext(script, offset);
+ if (context.emptyPrefix()) { // no prefix, so we could suggest anything
+ suggestTypeNames();
+ suggestConstantNames();
+ suggestGlobals();
+ getDocumentsRubyElementsInScope();
+ } else {
+ if (context.isConstant()) { // type or constant
+ suggestTypeNames();
+ suggestConstantNames();
+ }
+ if (context.isMethodInvokation()) {
+ ITypeInferrer inferrer = new DefaultTypeInferrer();
+ List<ITypeGuess> guesses = inferrer.infer(context.getSource(), context.getOffset());
+ RubyElementRequestor requestor = new RubyElementRequestor(script);
+ for (ITypeGuess guess : guesses) {
+ String name = guess.getType();
+ IType[] types = requestor.findType(name);
+ for (int i = 0; i < types.length; i++) {
+ suggestMethods(context, guess.getConfidence(), types[i]);
+ }
}
- offset = i - 1;
- break;
+ } else {
+ // FIXME Traverse the IRubyElement model, not nodes (and don't reparse)?
+ getDocumentsRubyElementsInScope();
}
- if (Character.isWhitespace(curChar)) {
- offset = i + 1;
- break;
+ if (context.isGlobal()) { // looks like a global
+ suggestGlobals();
}
- tmpPrefix.insert(0, curChar);
}
- this.prefix = tmpPrefix.toString();
- if (this.prefix != null)
- replaceStart -= this.prefix.length();
-
- if (isConstant() || (emptyPrefix() && !isMethod)) { // type, constant, or empty prefix (with no preceding period)
- suggestTypeNames(replaceStart);
- suggestConstantNames(replaceStart);
- }
- if (isMethod) { // method
- ITypeInferrer inferrer = new DefaultTypeInferrer();
- List<ITypeGuess> guesses = inferrer.infer(source.toString(), offset);
- RubyElementRequestor requestor = new RubyElementRequestor(script);
- for (ITypeGuess guess : guesses) {
- String name = guess.getType();
- IType[] types = requestor.findType(name);
- for (int i = 0; i < types.length; i++) {
- suggestMethods(replaceStart, guess.getConfidence(), types[i]);
- }
- }
- }
- // FIXME Traverse the IRubyElement model, not nodes (and don't reparse!)
- if (!isMethod)
- getDocumentsRubyElementsInScope(script, source.toString(), offset, replaceStart);
this.requestor.endReporting();
+ context = null;
}
-
- private boolean emptyPrefix() {
- return this.prefix != null && this.prefix.length() == 0;
+
+ private void suggestGlobals() {
+ Set<String> globals = ExperimentalIndex.getGlobalNames();
+ // TODO Sort?
+ for (String name : globals) {
+ if (!context.prefixStartsWith(name))
+ continue;
+ addProposal(context.getReplaceStart(), CompletionProposal.FIELD_REF, name);
+ }
}
- private void suggestTypeNames(int replaceStart) {
+ private void suggestTypeNames() {
Set<String> types = ExperimentalIndex.getTypeNames();
- // TODO Remove duplicates? Sort?
+ // TODO Sort?
for (String name : types) {
- if (this.prefix != null && !name.startsWith(this.prefix))
+ if (!context.prefixStartsWith(name))
continue;
- addProposal(replaceStart, CompletionProposal.TYPE_REF, name);
+ addProposal(context.getReplaceStart(), CompletionProposal.TYPE_REF, name);
}
}
@@ -134,29 +116,23 @@
return proposal;
}
- private void suggestConstantNames(int replaceStart) {
+ private void suggestConstantNames() {
Set<String> types = ExperimentalIndex.getConstantNames();
- // TODO Remove duplicates? Sort?
+ // TODO Sort?
for (String name : types) {
- if (this.prefix != null && !name.startsWith(this.prefix))
+ if (!context.prefixStartsWith(name))
continue;
- CompletionProposal proposal = new CompletionProposal(CompletionProposal.FIELD_REF, name, 100);
- proposal.setReplaceRange(replaceStart, replaceStart + name.length());
- requestor.accept(proposal);
+ addProposal(context.getReplaceStart(), CompletionProposal.FIELD_REF, name);
}
}
- private boolean isConstant() {
- return prefix != null && prefix.length() > 0 && Character.isUpperCase(prefix.charAt(0));
- }
-
- private void suggestMethods(int replaceStart, int confidence, IType type) throws RubyModelException {
+ private void suggestMethods(CompletionContext context, int confidence, IType type) throws RubyModelException {
if (type == null)
return;
IMethod[] methods = type.getMethods();
for (int k = 0; k < methods.length; k++) {
IMethod method = methods[k];
- int start = replaceStart;
+ int start = context.getReplaceStart();
String name = method.getElementName();
int flags = Flags.AccDefault;
if (method.isSingleton()) {
@@ -165,7 +141,7 @@
} else {
// FIXME Don't show instance methods if the thing we're working on is a constant (class name)!
}
- if (prefix != null && !name.startsWith(prefix))
+ if (!context.prefixStartsWith(name))
continue;
switch (method.getVisibility()) {
@@ -196,43 +172,28 @@
*
* @return a List of the names of all the elements in the current RubyScript
*/
- private void getDocumentsRubyElementsInScope(IRubyScript script, String source, int offset, int replaceStart) {
+ private void getDocumentsRubyElementsInScope() {
try {
// 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(source);
+ Node rootNode = (new RubyParser()).parse(context.getCorrectedSource());
if (rootNode == null) {
return;
}
// Find the enclosing method to get locals and args
- Node enclosingMethodNode = ClosestSpanningNodeLocator.Instance().findClosestSpanner(rootNode, offset, new INodeAcceptor() {
+ Node enclosingMethodNode = ClosestSpanningNodeLocator.Instance().findClosestSpanner(rootNode, context.getOffset(), new INodeAcceptor() {
public boolean doesAccept(Node node) {
return (node instanceof DefnNode || node instanceof DefsNode);
}
});
- // Add local vars and arguments
- // Add local vars and arguments
- if (enclosingMethodNode != null && enclosingMethodNode instanceof MethodDefNode) {
- StaticScope scope = ((MethodDefNode) enclosingMethodNode).getScope();
- if (scope != null && scope.getVariables().length > 0) {
- List locals = Arrays.asList(scope.getVariables());
- for (Iterator iter = locals.iterator(); iter.hasNext();) {
- String local = (String) iter.next();
- if (prefix != null && !local.startsWith(prefix))
- continue;
- CompletionProposal proposal = new CompletionProposal(CompletionProposal.LOCAL_VARIABLE_REF, local, 100);
- proposal.setReplaceRange(replaceStart, replaceStart + local.length());
- requestor.accept(proposal);
- }
- }
- }
+ addLocalVariablesAndArguments(enclosingMethodNode);
// Find the enclosing type (class or module) to get instance and
// classvars from
- Node enclosingTypeNode = ClosestSpanningNodeLocator.Instance().findClosestSpanner(rootNode, offset, new INodeAcceptor() {
+ Node enclosingTypeNode = ClosestSpanningNodeLocator.Instance().findClosestSpanner(rootNode, context.getOffset(), new INodeAcceptor() {
public boolean doesAccept(Node node) {
return (node instanceof ClassNode || node instanceof ModuleNode);
}
@@ -240,12 +201,8 @@
// Add members from enclosing type
if (enclosingTypeNode != null) {
- getMembersAvailableInsideType(enclosingTypeNode, script, replaceStart);
+ getMembersAvailableInsideType(enclosingTypeNode);
}
-
- // Add all globals, classes, and modules
- getElementsOfType(script.getRubyProject(), new int[] { IRubyElement.GLOBAL }, replaceStart);
- addClassesAndModulesInProject(script.getRubyProject(), replaceStart);
} catch (RubyModelException rme) {
RubyCore.log(rme);
RubyCore.log("RubyModelException in CompletionEngine::getElementsInScope()");
@@ -255,11 +212,29 @@
}
}
- private void addClassesAndModulesInProject(IRubyProject project, int replaceStart) {
- getElementsOfType(project, new int[] { IRubyElement.TYPE }, replaceStart);
+ private void addLocalVariablesAndArguments(Node enclosingMethodNode) {
+ // Add local vars and arguments
+ if (enclosingMethodNode != null && enclosingMethodNode instanceof MethodDefNode) {
+ Set<String> matches = new HashSet<String>();
+ StaticScope scope = ((MethodDefNode) enclosingMethodNode).getScope();
+ if (scope != null && scope.getVariables().length > 0) {
+ List locals = Arrays.asList(scope.getVariables());
+ for (Iterator iter = locals.iterator(); iter.hasNext();) {
+ String local = (String) iter.next();
+ if (!context.prefixStartsWith(local))
+ continue;
+ matches.add(local);
+ }
+ }
+ for (String local : matches) { // Avoid duplicates
+ CompletionProposal proposal = new CompletionProposal(CompletionProposal.LOCAL_VARIABLE_REF, local, 100);
+ proposal.setReplaceRange(context.getReplaceStart(), context.getReplaceStart() + local.length());
+ requestor.accept(proposal);
+ }
+ }
}
- private void getElementsOfType(IParent element, int[] types, int replaceStart) {
+ private void getElementsOfType(IParent element, int[] types) {
try {
IRubyElement[] elements = element.getChildren();
if (elements == null)
@@ -270,14 +245,14 @@
if (child.getElementType() != types[i])
continue;
String name = child.getElementName();
- if (prefix != null && !name.startsWith(prefix))
+ if (!context.prefixStartsWith(name))
continue;
CompletionProposal proposal = new CompletionProposal(getCompletionProposalType(child), name, 100);
- proposal.setReplaceRange(replaceStart, replaceStart + name.length());
+ proposal.setReplaceRange(context.getReplaceStart(), context.getReplaceStart() + name.length());
requestor.accept(proposal);
}
if (child instanceof IParent)
- getElementsOfType((IParent) child, types, replaceStart);
+ getElementsOfType((IParent) child, types);
}
} catch (RubyModelException e) {
e.printStackTrace();
@@ -308,19 +283,12 @@
* @param typeNode
* @return
*/
- private void getMembersAvailableInsideType(Node typeNode, IRubyScript script, int replaceStart) throws RubyModelException {
+ private void getMembersAvailableInsideType(Node typeNode) throws RubyModelException {
if (typeNode == null) {
return;
}
- // Get type name
- String typeName = null;
- if (typeNode instanceof ClassNode) {
- typeName = ((Colon2Node) ((ClassNode) typeNode).getCPath()).getName();
- }
- if (typeNode instanceof ModuleNode) {
- typeName = ((Colon2Node) ((ModuleNode) typeNode).getCPath()).getName();
- }
+ String typeName = getTypeName(typeNode);
if (typeName == null) {
return;
}
@@ -346,42 +314,20 @@
// }
// Get superclass and add its public members
- List<Node> superclassNodes = getSuperclassNodes(typeNode, script);
+ List<Node> superclassNodes = getSuperclassNodes(typeNode);
for (Node superclassNode : superclassNodes) {
- getMembersAvailableInsideType(superclassNode, script, replaceStart);
+ getMembersAvailableInsideType(superclassNode);
}
// Get public members of mixins
- List<String> mixinNames = getIncludedMixinNames(typeName, script);
+ List<String> mixinNames = getIncludedMixinNames(typeName);
for (String mixinName : mixinNames) {
- List<Node> mixinDeclarations = getTypeDeclarationNodes(mixinName, script);
+ List<Node> mixinDeclarations = getTypeDeclarationNodes(mixinName);
for (Node mixinDeclaration : mixinDeclarations) {
- getMembersAvailableInsideType(mixinDeclaration, script, replaceStart);
+ getMembersAvailableInsideType(mixinDeclaration);
}
}
- // Get instance and class variables available in the enclosing type
- List<Node> instanceAndClassVars = ScopedNodeLocator.Instance().findNodesInScope(typeNode, new INodeAcceptor() {
- public boolean doesAccept(Node node) {
- return (node instanceof InstVarNode || node instanceof InstAsgnNode || node instanceof ClassVarNode || node instanceof ClassVarDeclNode || node instanceof ClassVarAsgnNode);
- }
- });
-
- if (instanceAndClassVars != null) {
- // Get the unique names of instance and class variables
- for (Node varNode : instanceAndClassVars) {
- String name = getNameReflectively(varNode);
- if (name == null)
- continue;
- if (prefix != null && !name.startsWith(prefix))
- continue;
-
- CompletionProposal proposal = new CompletionProposal(CompletionProposal.FIELD_REF, name, 100);
- proposal.setReplaceRange(replaceStart, replaceStart + name.length());
- requestor.accept(proposal);
- }
- }
-
// Get method names defined by DefnNodes and DefsNodes
List<Node> methodDefinitions = ScopedNodeLocator.Instance().findNodesInScope(typeNode, new INodeAcceptor() {
public boolean doesAccept(Node node) {
@@ -396,26 +342,58 @@
if (methodDefinition instanceof DefsNode) {
name = ((DefsNode) methodDefinition).getName();
}
- if (name == null)
+ if (!context.prefixStartsWith(name))
continue;
- if (prefix != null && !name.startsWith(prefix))
- continue;
CompletionProposal proposal = new CompletionProposal(CompletionProposal.METHOD_REF, name, 100);
- proposal.setReplaceRange(replaceStart, replaceStart + name.length());
+ proposal.setReplaceRange(context.getReplaceStart(), context.getReplaceStart() + name.length());
requestor.accept(proposal);
}
+ addTypesVariables(typeNode);
+ }
+
+ private String getTypeName(Node typeNode) {
+ // Get type name
+ String typeName = null;
+ if (typeNode instanceof ClassNode) {
+ typeName = ((Colon2Node) ((ClassNode) typeNode).getCPath()).getName();
+ }
+ if (typeNode instanceof ModuleNode) {
+ typeName = ((Colon2Node) ((ModuleNode) typeNode).getCPath()).getName();
+ }
+ return typeName;
+ }
+
+ private void addTypesVariables(Node typeNode) {
+ // Get instance and class variables available in the enclosing type
+ List<Node> instanceAndClassVars = ScopedNodeLocator.Instance().findNodesInScope(typeNode, new INodeAcceptor() {
+ public boolean doesAccept(Node node) {
+ return (node instanceof InstVarNode || node instanceof InstAsgnNode || node instanceof ClassVarNode || node instanceof ClassVarDeclNode || node instanceof ClassVarAsgnNode);
+ }
+ });
+ Set<String> fields = new HashSet<String>();
+ if (instanceAndClassVars != null) {
+ // Get the unique names of instance and class variables
+ for (Node varNode : instanceAndClassVars) {
+ String name = getNameReflectively(varNode);
+ if (!context.prefixStartsWith(name))
+ continue;
+ fields.add(name);
+ }
+ }
// Get instance and class vars defined by [c]attr_* calls
List<String> attrs = AttributeLocator.Instance().findInstanceAttributesInScope(typeNode);
for (Iterator iter = attrs.iterator(); iter.hasNext();) {
String attr = (String) iter.next();
- if (prefix != null && !attr.startsWith(prefix))
+ if (!context.prefixStartsWith(attr))
continue;
- CompletionProposal proposal = new CompletionProposal(CompletionProposal.FIELD_REF, attr, 100);
- proposal.setReplaceRange(replaceStart, replaceStart + attr.length());
+ fields.add(attr);
+ }
+ for (String field : fields) {
+ CompletionProposal proposal = new CompletionProposal(CompletionProposal.FIELD_REF, field, 100);
+ proposal.setReplaceRange(context.getReplaceStart(), context.getReplaceStart() + field.length());
requestor.accept(proposal);
}
-
}
/**
@@ -433,23 +411,23 @@
* Node to find superclass nodes of
* @return List of ClassNode or ModuleNode
*/
- private List<Node> getSuperclassNodes(Node typeNode, IRubyScript script) {
+ private List<Node> getSuperclassNodes(Node typeNode) {
if (typeNode instanceof ClassNode) {
Node superNode = ((ClassNode) typeNode).getSuperNode();
if (superNode instanceof ConstNode) {
String superclassName = ((ConstNode) superNode).getName();
- return getTypeDeclarationNodes(superclassName, script);
+ return getTypeDeclarationNodes(superclassName);
}
}
return new ArrayList<Node>();
}
/** Lookup type declaration nodes */
- private List<Node> getTypeDeclarationNodes(String typeName, IRubyScript script) {
+ private List<Node> getTypeDeclarationNodes(String typeName) {
System.out.println("Being asked for the type decl node for " + typeName);
// Find the named type
- RubyElementRequestor requestor = new RubyElementRequestor(script);
+ RubyElementRequestor requestor = new RubyElementRequestor(context.getScript());
IType[] types = requestor.findType(typeName);
IType type = types[0];
@@ -470,7 +448,7 @@
// Bail if the parse fails
if (rootNode == null) {
- return new ArrayList();
+ return new ArrayList<Node>();
}
// Return any type declaration nodes in included source
@@ -488,8 +466,8 @@
return new ArrayList<Node>(0);
}
- private List<String> getIncludedMixinNames(String typeName, IRubyScript script) {
- IType rubyType = new RubyType((RubyElement) script, typeName);
+ private List<String> getIncludedMixinNames(String typeName) {
+ IType rubyType = new RubyType((RubyElement)context.getScript(), typeName);
try {
String[] includedModuleNames = rubyType.getIncludedModuleNames();
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/ExperimentalIndex.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/ExperimentalIndex.java 2007-02-07 14:16:50 UTC (rev 1927)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/ExperimentalIndex.java 2007-02-07 15:23:15 UTC (rev 1928)
@@ -2,7 +2,6 @@
import java.util.Collections;
import java.util.HashSet;
-import java.util.List;
import java.util.Set;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -17,6 +16,7 @@
import org.rubypeople.rdt.core.IRubyElementDelta;
import org.rubypeople.rdt.core.IRubyModel;
import org.rubypeople.rdt.core.IType;
+import org.rubypeople.rdt.core.RubyCore;
import org.rubypeople.rdt.core.RubyModelException;
import org.rubypeople.rdt.internal.core.RubyModelManager;
@@ -25,10 +25,12 @@
private static ExperimentalIndex fgInstance;
private static HashSet<IField> fgConstants;
private static HashSet<IType> fgTypes;
+ private static HashSet<IField> fgGlobals;
private ExperimentalIndex() {
fgTypes = new HashSet<IType>();
fgConstants = new HashSet<IField>();
+ fgGlobals = new HashSet<IField>();
}
public void elementChanged(ElementChangedEvent event) {
@@ -62,6 +64,15 @@
}
return matches;
}
+
+ public static Set<String> getGlobalNames() {
+ Set<IField> types = Collections.unmodifiableSet((HashSet<IField>)fgGlobals.clone()); // clone to avoid concurrent modification when iterating
+ Set<String> names = new HashSet<String>();
+ for (IField type : types) {
+ names.add(type.getElementName());
+ }
+ return names;
+ }
private void processDelta(IRubyElementDelta delta) {
IRubyElement element = delta.getElement();
@@ -90,6 +101,9 @@
case IRubyElement.CONSTANT:
fgConstants.remove(element);
break;
+ case IRubyElement.GLOBAL:
+ fgGlobals.remove(element);
+ break;
}
}
@@ -101,6 +115,9 @@
case IRubyElement.CONSTANT:
fgConstants.add((IField)element);
break;
+ case IRubyElement.GLOBAL:
+ fgGlobals.add((IField)element);
+ break;
}
}
@@ -142,8 +159,7 @@
}
}
} catch (RubyModelException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ RubyCore.log(e);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-07 14:16:54
|
Revision: 1927
http://svn.sourceforge.net/rubyeclipse/?rev=1927&view=rev
Author: cawilliams
Date: 2007-02-07 06:16:50 -0800 (Wed, 07 Feb 2007)
Log Message:
-----------
remove unneeded stuff
Removed Paths:
-------------
trunk/org.rubypeople.rdt.build/build.properties
trunk/org.rubypeople.rdt.build/build.xml
trunk/org.rubypeople.rdt.build/map/rdt.map
Deleted: trunk/org.rubypeople.rdt.build/build.properties
===================================================================
Deleted: trunk/org.rubypeople.rdt.build/build.xml
===================================================================
--- trunk/org.rubypeople.rdt.build/build.xml 2007-02-07 14:16:34 UTC (rev 1926)
+++ trunk/org.rubypeople.rdt.build/build.xml 2007-02-07 14:16:50 UTC (rev 1927)
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="org.rubypeople.rdt.build" default="build.all" basedir="..">
- <property name="package.temp.dir" value="org.rubypeople.rdt.build/temp.folder"/>
-
- <target name="build.all">
- <antcall target="clean.all"/>
- <antcall target="package.rdt"/>
- <antcall target="refresh.all"/>
- </target>
-
- <target name="clean.all">
- <ant dir="org.kxml2" target="clean"/>
- <ant dir="org.rubypeople.rdt.core" target="clean"/>
- <ant dir="org.rubypeople.rdt.debug.core" target="clean"/>
- <ant dir="org.rubypeople.rdt.debug.ui" target="clean"/>
- <ant dir="org.rubypeople.rdt.doc.user" target="clean"/>
- <ant dir="org.rubypeople.rdt.launching" target="clean"/>
- <ant dir="org.rubypeople.rdt.ui" target="clean"/>
- <antcall target="clean"/>
- </target>
-
- <target name="zip.plugin">
- <ant dir="org.kxml2" target="zip.plugin"/>
- <ant dir="org.rubypeople.rdt.core" target="zip.plugin"/>
- <ant dir="org.rubypeople.rdt.debug.core" target="zip.plugin"/>
- <ant dir="org.rubypeople.rdt.debug.ui" target="zip.plugin"/>
- <ant dir="org.rubypeople.rdt.doc.user" target="zip.plugin"/>
- <ant dir="org.rubypeople.rdt.launching" target="zip.plugin"/>
- <ant dir="org.rubypeople.rdt.ui" target="zip.plugin"/>
- </target>
-
- <target name="package.rdt" depends="zip.plugin">
- <mkdir dir="${package.temp.dir}"/>
- <unzip src="org.kxml2/org.kxml2_2.1.4.zip" dest="${package.temp.dir}"/>
- <unzip src="org.rubypeople.rdt.core/org.rubypeople.rdt.core_0.3.2.zip" dest="${package.temp.dir}"/>
- <unzip src="org.rubypeople.rdt.debug.core/org.rubypeople.rdt.debug.core_0.3.2.zip" dest="${package.temp.dir}"/>
- <unzip src="org.rubypeople.rdt.debug.ui/org.rubypeople.rdt.debug.ui_0.3.2.zip" dest="${package.temp.dir}"/>
- <unzip src="org.rubypeople.rdt.doc.user/org.rubypeople.rdt.doc.user_0.3.2.zip" dest="${package.temp.dir}"/>
- <unzip src="org.rubypeople.rdt.launching/org.rubypeople.rdt.launching_0.3.2.zip" dest="${package.temp.dir}"/>
- <unzip src="org.rubypeople.rdt.ui/org.rubypeople.rdt.ui_0.3.2.zip" dest="${package.temp.dir}"/>
- <zip zipfile="org.rubypeople.rdt.build/rubyeclipse_0.3.2.zip" basedir="${package.temp.dir}" filesonly="true"/>
- <delete dir="${package.temp.dir}"/>
- </target>
-
- <target name="refresh.all">
- <ant dir="org.kxml2" target="refresh"/>
- <ant dir="org.rubypeople.rdt.core" target="refresh"/>
- <ant dir="org.rubypeople.rdt.debug.core" target="refresh"/>
- <ant dir="org.rubypeople.rdt.debug.ui" target="refresh"/>
- <ant dir="org.rubypeople.rdt.doc.user" target="refresh"/>
- <ant dir="org.rubypeople.rdt.launching" target="refresh"/>
- <ant dir="org.rubypeople.rdt.ui" target="refresh"/>
- <antcall target="refresh"/>
- </target>
-
- <target name="clean">
- <delete file="org.rubypeople.rdt.build/rubyeclipse_0.3.2.zip"/>
- </target>
-
- <target name="refresh" if="eclipse.running">
- <eclipse.refreshLocal resource="org.rubypeople.rdt.build" depth="infinite"/>
- </target>
-</project>
\ No newline at end of file
Deleted: trunk/org.rubypeople.rdt.build/map/rdt.map
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-07 14:16:36
|
Revision: 1926
http://svn.sourceforge.net/rubyeclipse/?rev=1926&view=rev
Author: cawilliams
Date: 2007-02-07 06:16:34 -0800 (Wed, 07 Feb 2007)
Log Message:
-----------
remove duplicate entry of org.jruby in list of plugins
Modified Paths:
--------------
trunk/org.rubypeople.rdt.build/cruiseControl/svn_co_rdt
Modified: trunk/org.rubypeople.rdt.build/cruiseControl/svn_co_rdt
===================================================================
--- trunk/org.rubypeople.rdt.build/cruiseControl/svn_co_rdt 2007-02-07 06:38:21 UTC (rev 1925)
+++ trunk/org.rubypeople.rdt.build/cruiseControl/svn_co_rdt 2007-02-07 14:16:34 UTC (rev 1926)
@@ -25,7 +25,7 @@
# Fetch the plugins
#
pluginsDir=$1/plugins
-plugins="org.epic.regexp org.rubypeople.rdt org.rubypeople.rdt.debug.core.tests org.rubypeople.rdt.launching org.rubypeople.rdt.ui org.kxml2 org.rubypeople.rdt.core org.rubypeople.rdt.debug.ui org.rubypeople.rdt.launching.tests org.rubypeople.rdt.ui.tests org.rubypeople.eclipse.shams org.rubypeople.rdt.core.tests org.rubypeople.rdt.debug.ui.tests org.rubypeople.rdt.tests.all org.rubypeople.eclipse.testutils org.rubypeople.rdt.debug.core org.rubypeople.rdt.doc.user org.rubypeople.rdt.testunit org.jruby org.rubypeople.rdt.refactoring org.jruby org.rubypeople.rdt.refactoring.tests"
+plugins="org.epic.regexp org.rubypeople.rdt org.rubypeople.rdt.debug.core.tests org.rubypeople.rdt.launching org.rubypeople.rdt.ui org.kxml2 org.rubypeople.rdt.core org.rubypeople.rdt.debug.ui org.rubypeople.rdt.launching.tests org.rubypeople.rdt.ui.tests org.rubypeople.eclipse.shams org.rubypeople.rdt.core.tests org.rubypeople.rdt.debug.ui.tests org.rubypeople.rdt.tests.all org.rubypeople.eclipse.testutils org.rubypeople.rdt.debug.core org.rubypeople.rdt.doc.user org.rubypeople.rdt.testunit org.jruby org.rubypeople.rdt.refactoring org.rubypeople.rdt.refactoring.tests"
for plugin in $plugins; do
svn co ${url}/$plugin $pluginsDir/$plugin
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mba...@us...> - 2007-02-07 06:38:22
|
Revision: 1925
http://svn.sourceforge.net/rubyeclipse/?rev=1925&view=rev
Author: mbarchfe
Date: 2007-02-06 22:38:21 -0800 (Tue, 06 Feb 2007)
Log Message:
-----------
added build.properties
Modified Paths:
--------------
trunk/org.rubypeople.rdt.refactoring.tests/META-INF/MANIFEST.MF
Added Paths:
-----------
trunk/org.rubypeople.rdt.refactoring.tests/build.properties
Modified: trunk/org.rubypeople.rdt.refactoring.tests/META-INF/MANIFEST.MF
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/META-INF/MANIFEST.MF 2007-02-07 06:37:40 UTC (rev 1924)
+++ trunk/org.rubypeople.rdt.refactoring.tests/META-INF/MANIFEST.MF 2007-02-07 06:38:21 UTC (rev 1925)
@@ -14,3 +14,4 @@
org.eclipse.text,
org.rubypeople.rdt.core
Eclipse-LazyStart: true
+Bundle-ClassPath: refactoringtests.jar
Added: trunk/org.rubypeople.rdt.refactoring.tests/build.properties
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/build.properties (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring.tests/build.properties 2007-02-07 06:38:21 UTC (rev 1925)
@@ -0,0 +1,8 @@
+bin.includes = refactoringtests.jar,\
+ META-INF/
+jars.compile.order = refactoringtests.jar
+source.refactoringtests.jar = src/
+output.refactoringtests.jar = bin/
+src.includes = src/,\
+ build.properties,\
+ META-INF/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mba...@us...> - 2007-02-07 06:37:41
|
Revision: 1924
http://svn.sourceforge.net/rubyeclipse/?rev=1924&view=rev
Author: mbarchfe
Date: 2007-02-06 22:37:40 -0800 (Tue, 06 Feb 2007)
Log Message:
-----------
added build.properties
Modified Paths:
--------------
trunk/org.rubypeople.rdt.refactoring/META-INF/MANIFEST.MF
Added Paths:
-----------
trunk/org.rubypeople.rdt.refactoring/build.properties
Modified: trunk/org.rubypeople.rdt.refactoring/META-INF/MANIFEST.MF
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/META-INF/MANIFEST.MF 2007-02-06 21:17:03 UTC (rev 1923)
+++ trunk/org.rubypeople.rdt.refactoring/META-INF/MANIFEST.MF 2007-02-07 06:37:40 UTC (rev 1924)
@@ -62,3 +62,4 @@
org.jruby
Eclipse-LazyStart: true
Bundle-Vendor: %rubyRefactoring.providerName
+Bundle-ClassPath: refactoring.jar
Added: trunk/org.rubypeople.rdt.refactoring/build.properties
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/build.properties (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring/build.properties 2007-02-07 06:37:40 UTC (rev 1924)
@@ -0,0 +1,15 @@
+jars.compile.order = .
+source.. = src/
+output.. = bin/
+bin.includes = refactoring.jar,\
+ plugin.xml,\
+ META-INF/,\
+ plugin.properties
+jars.compile.order = refactoring.jar
+source.refactoring.jar = src/
+output.refactoring.jar = bin/
+src.includes = src/,\
+ plugin.xml,\
+ plugin.properties,\
+ build.properties,\
+ META-INF/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-06 21:17:13
|
Revision: 1923
http://svn.sourceforge.net/rubyeclipse/?rev=1923&view=rev
Author: cawilliams
Date: 2007-02-06 13:17:03 -0800 (Tue, 06 Feb 2007)
Log Message:
-----------
add more changes
Modified Paths:
--------------
trunk/org.rubypeople.rdt/Changelog.txt
Modified: trunk/org.rubypeople.rdt/Changelog.txt
===================================================================
--- trunk/org.rubypeople.rdt/Changelog.txt 2007-02-06 20:47:46 UTC (rev 1922)
+++ trunk/org.rubypeople.rdt/Changelog.txt 2007-02-06 21:17:03 UTC (rev 1923)
@@ -1,4 +1,11 @@
Since 0.8.0 Release:
+* Initial Refactoring support
+ * Adds an initial catalog of refactorings
+ * Also adds some basic source manipulation
+ * Generate accessors
+ * Generate constructor
+* Better integration with Ruby interpreters
+ * Now "links" the standard and core libraries of ruby interpreters into new ruby projects - so they are used in code completion
* Preliminary support for ruby-debug as the debugging backend
* Integration of type inferrencing work done by Jason morrison for Google Summer of Code
* Improved code completion
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|