[Pydev-cvs] org.python.pydev/src/org/python/pydev/editor/model ItemPointer.java, 1.7, 1.8
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2008-08-17 00:26:38
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6943/src/org/python/pydev/editor/model Modified Files: ItemPointer.java Log Message: <li><strong>Pydev debugger</strong>Workaround for python bug when filenames don't have absolute paths correctly generated</li> <li><strong>Pydev code-completion</strong>Wild import will only show tokens defined in __all__ (if it's available)</li> <li><strong>Interactive console</strong>: Fixed problem when more attempts to connect were needed</li> <li><strong>Interactive console</strong>Fixed console integration problem with other plugins because of interfaces not properly implemented</li> <li><strong>Code Formatter</strong>: Exponentials handled correctly</li> <li><strong>Launching</strong>: Unit-test and code-coverage may launch multiple folders/files at once</li> <li><strong>Code coverage</strong>: Number format exception no longer given when trying to show lines not executed in the editor and all lines are executed</li> Index: ItemPointer.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/model/ItemPointer.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ItemPointer.java 16 Sep 2007 17:15:53 -0000 1.7 --- ItemPointer.java 17 Aug 2008 00:26:46 -0000 1.8 *************** *** 6,11 **** package org.python.pydev.editor.model; - import java.io.File; - import org.python.pydev.editor.codecompletion.revisited.visitors.Definition; import org.python.pydev.parser.jython.SimpleNode; --- 6,9 ---- *************** *** 19,28 **** public class ItemPointer { ! public Object file; // IFile or File object ! public Location start; // (first character) ! public Location end; // (last character) ! public Definition definition; //the definition that originated this ItemPointer (it might be null). ! public String zipFilePath; //the path within the zip file for this pointer (null if we're not dealing with a zip file) public ItemPointer(Object file) { this(file, new Location(), new Location()); --- 17,46 ---- public class ItemPointer { ! /** ! * IFile or File object (may be null) ! */ ! public final Object file; + /** + * Position of the 1st character + */ + public final Location start; + + /** + * Position of the last character + */ + public final Location end; + + /** + * The definition that originated this ItemPointer (good chance of being null). + */ + public final Definition definition; + + /** + * The path within the zip file for this pointer (null if we're not dealing with a zip file) + */ + public final String zipFilePath; + + public ItemPointer(Object file) { this(file, new Location(), new Location()); *************** *** 36,49 **** this.start = new Location(line-1, col-1); this.end = new Location(line-1, col-1); } public ItemPointer(Object file, Location start, Location end) { ! this.file = file; ! this.start = start; ! this.end = end; } ! public ItemPointer(File file2, Location location, Location location2, Definition definition, String zipFilePath) { ! this(file2, location, location2); this.definition = definition; this.zipFilePath = zipFilePath; --- 54,69 ---- this.start = new Location(line-1, col-1); this.end = new Location(line-1, col-1); + this.definition = null; + this.zipFilePath = null; } public ItemPointer(Object file, Location start, Location end) { ! this(file, start, end, null, null); } ! public ItemPointer(Object file, Location start, Location end, Definition definition, String zipFilePath) { ! this.file = file; ! this.start = start; ! this.end = end; this.definition = definition; this.zipFilePath = zipFilePath; *************** *** 84,91 **** @Override public int hashCode() { if(this.file != null){ ! return this.file.hashCode() * 17; }else{ ! return (this.end.column+1) * (this.start.line+2) * 9; } } --- 104,112 ---- @Override public int hashCode() { + int colLineBasedHash = (this.end.column + this.start.line + 7) * 3; if(this.file != null){ ! return this.file.hashCode() + colLineBasedHash; }else{ ! return colLineBasedHash; } } |