|
From: <caw...@us...> - 2007-05-02 19:02:36
|
Revision: 2419
http://svn.sourceforge.net/rubyeclipse/?rev=2419&view=rev
Author: cawilliams
Date: 2007-05-02 12:02:35 -0700 (Wed, 02 May 2007)
Log Message:
-----------
handles types that are enclosed
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/indexing/SourceIndexerRequestor.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/matching/TypeDeclarationPattern.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/corext/util/TypeInfo.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/dialogs/TypeSelectionComponent.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/indexing/SourceIndexerRequestor.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/indexing/SourceIndexerRequestor.java 2007-05-02 17:40:58 UTC (rev 2418)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/indexing/SourceIndexerRequestor.java 2007-05-02 19:02:35 UTC (rev 2419)
@@ -1,5 +1,7 @@
package org.rubypeople.rdt.internal.core.search.indexing;
+import java.util.Stack;
+
import org.rubypeople.rdt.core.Flags;
import org.rubypeople.rdt.core.compiler.CategorizedProblem;
import org.rubypeople.rdt.internal.compiler.ISourceElementRequestor;
@@ -7,9 +9,11 @@
public class SourceIndexerRequestor implements ISourceElementRequestor {
private SourceIndexer indexer;
+ private Stack<String> typeStack;
public SourceIndexerRequestor(SourceIndexer sourceIndexer) {
this.indexer = sourceIndexer;
+ typeStack = new Stack<String>();
}
public void acceptConstructorReference(String name, int argCount, int offset) {
@@ -78,9 +82,19 @@
if (type.superclass != null) {
superclass = type.superclass.toCharArray();
}
- indexer.addClassDeclaration(type.isModule ? Flags.AccModule : 0, packName, type.name.toCharArray(), null, superclass, mod, type.secondary);
+ indexer.addClassDeclaration(type.isModule ? Flags.AccModule : 0, packName, type.name.toCharArray(), getEnclosingTypeNames(), superclass, mod, type.secondary);
+ typeStack.push(type.name);
}
+ private char[][] getEnclosingTypeNames() {
+ char[][] names = new char[typeStack.size()][];
+ int i = 0;
+ for (String name : typeStack) {
+ names[i++] = name.toCharArray();
+ }
+ return names;
+ }
+
public void exitConstructor(int endOffset) {
// TODO Auto-generated method stub
@@ -102,8 +116,7 @@
}
public void exitType(int endOffset) {
- // TODO Auto-generated method stub
-
+ typeStack.pop();
}
}
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/matching/TypeDeclarationPattern.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/matching/TypeDeclarationPattern.java 2007-05-02 17:40:58 UTC (rev 2418)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/matching/TypeDeclarationPattern.java 2007-05-02 19:02:35 UTC (rev 2419)
@@ -95,7 +95,7 @@
for (int i = 0, length = enclosingTypeNames.length; i < length;) {
enclosingNamesLength += enclosingTypeNames[i].length;
if (++i < length)
- enclosingNamesLength++; // for the '.' separator
+ enclosingNamesLength += 2; // for the "::" separator
}
}
@@ -119,8 +119,10 @@
int itsLength = enclosingName.length;
System.arraycopy(enclosingName, 0, result, pos, itsLength);
pos += itsLength;
- if (++i < length)
- result[pos++] = '.';
+ if (++i < length) {
+ result[pos++] = ':';
+ result[pos++] = ':';
+ }
}
}
result[pos++] = SEPARATOR;
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/corext/util/TypeInfo.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/corext/util/TypeInfo.java 2007-05-02 17:40:58 UTC (rev 2418)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/corext/util/TypeInfo.java 2007-05-02 19:02:35 UTC (rev 2419)
@@ -158,14 +158,14 @@
/**
* Gets the type qualified name: Includes enclosing type names, but
- * not package name. Identifiers are separated by dots.
+ * not package name. Identifiers are separated by "::".
*/
public String getTypeQualifiedName() {
if (fEnclosingNames != null && fEnclosingNames.length > 0) {
StringBuffer buf= new StringBuffer();
for (int i= 0; i < fEnclosingNames.length; i++) {
buf.append(fEnclosingNames[i]);
- buf.append('.');
+ buf.append("::");
}
buf.append(fName);
return buf.toString();
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/dialogs/TypeSelectionComponent.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/dialogs/TypeSelectionComponent.java 2007-05-02 17:40:58 UTC (rev 2418)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/dialogs/TypeSelectionComponent.java 2007-05-02 19:02:35 UTC (rev 2419)
@@ -11,7 +11,6 @@
package org.rubypeople.rdt.internal.ui.dialogs;
import java.io.IOException;
-import java.io.StringReader;
import java.io.StringWriter;
import org.eclipse.jface.action.Action;
@@ -20,8 +19,6 @@
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.dialogs.DialogSettings;
import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.SWT;
import org.eclipse.swt.accessibility.AccessibleAdapter;
import org.eclipse.swt.accessibility.AccessibleEvent;
@@ -51,9 +48,6 @@
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.WorkbenchException;
import org.eclipse.ui.XMLMemento;
import org.eclipse.ui.actions.WorkingSetFilterActionGroup;
import org.rubypeople.rdt.core.search.IRubySearchScope;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|