|
From: <caw...@us...> - 2006-11-01 16:05:19
|
Revision: 1647
http://svn.sourceforge.net/rubyeclipse/?rev=1647&view=rev
Author: cawilliams
Date: 2006-11-01 08:05:12 -0800 (Wed, 01 Nov 2006)
Log Message:
-----------
handle instance method calls for go to declaration
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/SelectionEngine.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/SelectionEngine.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/SelectionEngine.java 2006-11-01 16:05:04 UTC (rev 1646)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/SelectionEngine.java 2006-11-01 16:05:12 UTC (rev 1647)
@@ -10,11 +10,13 @@
import org.jruby.ast.ClassVarDeclNode;
import org.jruby.ast.ClassVarNode;
import org.jruby.ast.ConstNode;
+import org.jruby.ast.FCallNode;
import org.jruby.ast.InstAsgnNode;
import org.jruby.ast.InstVarNode;
import org.jruby.ast.LocalAsgnNode;
import org.jruby.ast.LocalVarNode;
import org.jruby.ast.Node;
+import org.jruby.ast.VCallNode;
import org.jruby.ast.types.INameNode;
import org.rubypeople.rdt.core.IParent;
import org.rubypeople.rdt.core.IRubyElement;
@@ -64,9 +66,18 @@
.getChildren(), IRubyElement.CLASS_VAR, getName(selected));
return convertToArray(possible);
}
+ if (isMethodCall(selected)) {
+ List<IRubyElement> possible = getChildrenWithName(script
+ .getChildren(), IRubyElement.METHOD, getName(selected));
+ return convertToArray(possible);
+ }
return new IRubyElement[0];
}
+ private boolean isMethodCall(Node selected) {
+ return (selected instanceof VCallNode) || (selected instanceof FCallNode);
+ }
+
private IRubyElement[] convertToArray(List<IRubyElement> possible) {
IRubyElement[] elements = new IRubyElement[possible.size()];
int x = 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|