|
From: <caw...@us...> - 2007-07-09 18:37:09
|
Revision: 2731
http://svn.sourceforge.net/rubyeclipse/?rev=2731&view=rev
Author: cawilliams
Date: 2007-07-09 11:36:47 -0700 (Mon, 09 Jul 2007)
Log Message:
-----------
fix #4933 - Hitting Ctrl-H brings up bad search text
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/PatternStrings.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/RubySearchPage.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/PatternStrings.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/PatternStrings.java 2007-07-09 14:17:15 UTC (rev 2730)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/PatternStrings.java 2007-07-09 18:36:47 UTC (rev 2731)
@@ -35,27 +35,30 @@
}
public static String getMethodSignature(IMethod method) {
+
StringBuffer buffer= new StringBuffer();
- buffer.append(RubyElementLabels.getElementLabel(
- method.getDeclaringType(),
- RubyElementLabels.T_FULLY_QUALIFIED | RubyElementLabels.USE_RESOLVED));
- boolean isConstructor= method.getElementName().equals(method.getDeclaringType().getElementName());
- if (!isConstructor) {
+ if (method.isSingleton() || method.isConstructor()) {
+ buffer.append(RubyElementLabels.getElementLabel(method.getDeclaringType(), RubyElementLabels.USE_RESOLVED));
buffer.append('.');
}
- buffer.append(getUnqualifiedMethodSignature(method, !isConstructor));
-
+ boolean isConstructor= method.isConstructor();
+ if (!isConstructor) {
+ buffer.append(getUnqualifiedMethodSignature(method, !isConstructor));
+ } else {
+ buffer.append("new");
+ }
+
return buffer.toString();
}
- private static String getUnqualifiedMethodSignature(IMethod method, boolean includeName) {
+ private static String getUnqualifiedMethodSignature(IMethod method, boolean isNotConstructor) {
StringBuffer buffer= new StringBuffer();
- if (includeName) {
+ if (isNotConstructor) {
buffer.append(method.getElementName());
}
- buffer.append('(');
+// buffer.append('(');
// TODO Add parameter names, or arity?
- buffer.append(')');
+// buffer.append(')');
return buffer.toString();
}
@@ -65,11 +68,10 @@
}
public static String getTypeSignature(IType field) {
- return RubyElementLabels.getElementLabel(field,
- RubyElementLabels.T_FULLY_QUALIFIED | RubyElementLabels.USE_RESOLVED);
+ return RubyElementLabels.getElementLabel(field, RubyElementLabels.USE_RESOLVED);
}
public static String getFieldSignature(IField field) {
- return RubyElementLabels.getElementLabel(field, RubyElementLabels.F_FULLY_QUALIFIED);
+ return RubyElementLabels.getElementLabel(field, 0);
}
}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/RubySearchPage.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/RubySearchPage.java 2007-07-09 14:17:15 UTC (rev 2730)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/RubySearchPage.java 2007-07-09 18:36:47 UTC (rev 2731)
@@ -486,7 +486,7 @@
selectParticipants.setLayoutData(gd);
selectParticipants.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
- PreferencePageSupport.showPreferencePage(getShell(), "org.eclipse.jdt.ui.preferences.SearchParticipantsExtensionPoint", new SearchParticipantsExtensionPoint()); //$NON-NLS-1$
+ PreferencePageSupport.showPreferencePage(getShell(), "org.rubypeople.rdt.ui.preferences.SearchParticipantsExtensionPoint", new SearchParticipantsExtensionPoint()); //$NON-NLS-1$
}
});
@@ -775,6 +775,11 @@
break;
}
case IRubyElement.FIELD:
+ case IRubyElement.INSTANCE_VAR:
+ case IRubyElement.LOCAL_VARIABLE:
+ case IRubyElement.CLASS_VAR:
+ case IRubyElement.GLOBAL:
+ case IRubyElement.CONSTANT:
return new SearchPatternData(FIELD, REFERENCES, true, PatternStrings.getFieldSignature((IField) element), element, isInsideJRE);
case IRubyElement.METHOD:
IMethod method= (IMethod) element;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|