|
From: David C. <dc...@us...> - 2005-10-13 01:00:45
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/symbols In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3497/src/org/rubypeople/rdt/internal/core/symbols Modified Files: SymbolIndex.java Location.java Log Message: Partial support for opening classes from Test::Unit failure. Index: Location.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/symbols/Location.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Location.java 1 Oct 2005 23:01:01 -0000 1.1 --- Location.java 13 Oct 2005 01:00:35 -0000 1.2 *************** *** 1,20 **** package org.rubypeople.rdt.internal.core.symbols; import org.eclipse.core.runtime.Path; public class Location { ! private final Path sourcePath; ! private final int line; ! private final int column; ! public Location(Path sourcePath, int line, int column) { this.sourcePath = sourcePath; ! this.line = line; ! this.column = column; } public String toString() { ! return sourcePath+": " + line + "("+column+")"; } --- 1,20 ---- package org.rubypeople.rdt.internal.core.symbols; + import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; + import org.jruby.lexer.yacc.ISourcePosition; public class Location { ! private final IPath sourcePath; ! private final ISourcePosition position; ! public Location(IPath sourcePath, ISourcePosition position) { this.sourcePath = sourcePath; ! this.position = position; } public String toString() { ! return sourcePath+": " + position; } *************** *** 22,24 **** --- 22,45 ---- return sourcePath.equals(path); } + + public boolean equals(Object obj) { + if (!(obj instanceof Location)) + return false; + Location that = (Location) obj; + + return this.sourcePath.equals(that.sourcePath) + && this.position.equals(that.position); + } + + public int hashCode() { + return sourcePath.hashCode() * position.hashCode(); + } + + public String getFilename() { + return sourcePath.toOSString(); + } + + public ISourcePosition getPosition() { + return position; + } } Index: SymbolIndex.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/symbols/SymbolIndex.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SymbolIndex.java 1 Oct 2005 23:01:01 -0000 1.1 --- SymbolIndex.java 13 Oct 2005 01:00:35 -0000 1.2 *************** *** 24,27 **** --- 24,31 ---- } + public void add(ClassSymbol symbol, IFile file, ISourcePosition position) { + add(symbol, new Location(file.getFullPath(), position)); + } + public Set find(ClassSymbol symbol) { Set locations = (Set) index.get(symbol); *************** *** 47,55 **** } - // DSC DO - public void add(ClassSymbol symbol, IFile file, ISourcePosition position) { - // TODO Auto-generated method stub - - } } --- 51,54 ---- |