|
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.
|