|
From: <caw...@us...> - 2007-02-06 18:36:29
|
Revision: 1918
http://svn.sourceforge.net/rubyeclipse/?rev=1918&view=rev
Author: cawilliams
Date: 2007-02-06 10:36:21 -0800 (Tue, 06 Feb 2007)
Log Message:
-----------
handle singleton methods even better. Now they should work much more like we'd expect
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-06 18:35:54 UTC (rev 1917)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-02-06 18:36:21 UTC (rev 1918)
@@ -152,19 +152,22 @@
private void suggestMethods(int replaceStart, int confidence, IType type) throws RubyModelException {
if (type == null)
- return;
+ return;
IMethod[] methods = type.getMethods();
for (int k = 0; k < methods.length; k++) {
IMethod method = methods[k];
int start = replaceStart;
String name = method.getElementName();
- if (prefix != null && !name.startsWith(prefix))
- continue;
int flags = Flags.AccDefault;
if (method.isSingleton()) {
flags |= Flags.AccStatic;
- start -= type.getElementName().length() + 1;
+ 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 (prefix != null && !name.startsWith(prefix))
+ continue;
+
switch (method.getVisibility()) {
case IMethod.PRIVATE:
flags |= Flags.AccPrivate;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|