|
From: <caw...@us...> - 2007-07-16 17:16:45
|
Revision: 2767
http://svn.sourceforge.net/rubyeclipse/?rev=2767&view=rev
Author: cawilliams
Date: 2007-07-16 10:16:44 -0700 (Mon, 16 Jul 2007)
Log Message:
-----------
close #5149 - No RubyScript element for classes in same file
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-07-16 15:59:10 UTC (rev 2766)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-07-16 17:16:44 UTC (rev 2767)
@@ -186,7 +186,7 @@
Node scoping = findNearestScope(typeNode, methodNode.getPosition().getStartOffset() - 1);
if (!scoping.equals(typeNode)) continue;
MethodDefNode methodDef = (MethodDefNode) methodNode;
- NodeMethod method = new NodeMethod(methodDef);
+ NodeMethod method = new NodeMethod(methodDef, fContext.getScript());
CompletionProposal proposal = suggestMethod(method, name, 100);
if (proposal == null) continue;
list.add(proposal);
@@ -652,7 +652,7 @@
}
if (!fContext.prefixStartsWith(name))
continue;
- NodeMethod method = new NodeMethod((MethodDefNode)methodDefinition);
+ NodeMethod method = new NodeMethod((MethodDefNode)methodDefinition, fContext.getScript());
suggestMethod(method, typeName, 100);
}
addTypesVariables(typeNode);
@@ -787,9 +787,11 @@
private class NodeMethod implements IMethod {
private MethodDefNode node;
+ private IRubyScript fScript;
- public NodeMethod(MethodDefNode methodDefinition) {
+ public NodeMethod(MethodDefNode methodDefinition, IRubyScript script) {
this.node = methodDefinition;
+ this.fScript = script;
}
public String[] getParameterNames() throws RubyModelException {
@@ -833,7 +835,7 @@
}
public IOpenable getOpenable() {
- return null;
+ return fScript;
}
public IRubyElement getParent() {
@@ -889,7 +891,7 @@
}
public IRubyScript getRubyScript() {
- return null;
+ return fScript;
}
public IType getType(String name, int occurrenceCount) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|