[Pydev-cvs] org.python.pydev.refactoring/src/org/python/pydev/refactoring/ast/visitors/position La
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2008-09-27 20:01:02
|
Update of /cvsroot/pydev/org.python.pydev.refactoring/src/org/python/pydev/refactoring/ast/visitors/position In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21605/src/org/python/pydev/refactoring/ast/visitors/position Modified Files: LastLineVisitor.java IndentVisitor.java Log Message: Synching to latest changes: Pydev <ul> <li><strong>Editor</strong>: Cursor settings no longer overridden</li> <li><strong>Code-completion</strong>: If __all__ is defined with runtime elements (and not only in a single assign statement), it's ignored for code-completion purposes</li> <li><strong>Debugger</strong>: Pythonpath the same in debug and regular modes (sys.path[0] is the same directory as the file run)</li> <li><strong>Debugger</strong>: Persist choices done in the debugger when files from the debugger are not found</li> <li><strong>Interpreter config</strong>: "email" automatically added to the "forced builtins"</li> <li><strong>Parser</strong>: Correctly recognizing absolute import with 3 or more levels</li> <li><strong>Syntax check</strong>: Option to do only on active editor</li> </ul> Also: tabs changed for spaces Index: IndentVisitor.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.refactoring/src/org/python/pydev/refactoring/ast/visitors/position/IndentVisitor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IndentVisitor.java 20 Oct 2007 19:31:03 -0000 1.2 --- IndentVisitor.java 27 Sep 2008 20:00:51 -0000 1.3 *************** *** 30,155 **** public class IndentVisitor extends VisitorBase { ! private static final int DEFAULT_INDENT = 4; ! private int indent; ! public IndentVisitor() { ! this.indent = DEFAULT_INDENT; ! } ! public int getIndent() { ! return indent; ! } ! private void handleDefault(SimpleNode node) { ! this.indent = node.beginColumn; ! } ! @Override ! public void traverse(SimpleNode node) throws Exception { ! // ignore ! } ! @Override ! protected Object unhandled_node(SimpleNode node) throws Exception { ! handleDefault(node); ! return null; ! } ! public void visit(SimpleNode node) throws Exception { ! if (node != null) ! node.accept(this); ! } ! public Object visitAssert(Assert node) throws Exception { ! handleDefault(node); ! this.indent -= 7; ! return null; ! } ! public Object visitAssign(Assign node) throws Exception { ! visit(node.targets[0]); ! return null; ! } ! public Object visitAttribute(Attribute node) throws Exception { ! visit(node.value); ! return null; ! } ! public Object visitAugAssign(AugAssign node) throws Exception { ! visit(node.target); ! return null; ! } ! public Object visitBinOp(BinOp node) throws Exception { ! visit(node.left); ! return null; ! } ! public Object visitBoolOp(BoolOp node) throws Exception { ! visit(node.values[0]); ! return null; ! } ! public Object visitCall(Call node) throws Exception { ! visit(node.func); ! return null; ! } ! public Object visitCompare(Compare node) throws Exception { ! visit(node.left); ! return null; ! } ! public Object visitDelete(Delete node) throws Exception { ! handleDefault(node); ! this.indent -= 4; ! return null; ! } ! public Object visitExec(Exec node) throws Exception { ! visit(node); ! this.indent -= 5; ! return null; ! } ! public Object visitExpr(Expr node) throws Exception { ! visit(node.value); ! return null; ! } ! public Object visitGeneratorExp(GeneratorExp node) throws Exception { ! visit(node.elt); ! return null; ! } ! @Override ! public Object visitImport(Import node) throws Exception { ! this.indent = 1; ! return null; ! } ! @Override ! public Object visitImportFrom(ImportFrom node) throws Exception { ! this.indent = 1; ! return null; ! } ! public Object visitPrint(Print node) throws Exception { ! handleDefault(node); ! this.indent -= 6; ! return null; ! } ! public Object visitSuite(Suite node) throws Exception { ! visit(node.body[0]); ! return null; ! } ! public Object visitTryFinally(TryFinally node) throws Exception { ! handleDefault(node); ! return null; ! } } --- 30,155 ---- public class IndentVisitor extends VisitorBase { ! private static final int DEFAULT_INDENT = 4; ! private int indent; ! public IndentVisitor() { ! this.indent = DEFAULT_INDENT; ! } ! public int getIndent() { ! return indent; ! } ! private void handleDefault(SimpleNode node) { ! this.indent = node.beginColumn; ! } ! @Override ! public void traverse(SimpleNode node) throws Exception { ! // ignore ! } ! @Override ! protected Object unhandled_node(SimpleNode node) throws Exception { ! handleDefault(node); ! return null; ! } ! public void visit(SimpleNode node) throws Exception { ! if (node != null) ! node.accept(this); ! } ! public Object visitAssert(Assert node) throws Exception { ! handleDefault(node); ! this.indent -= 7; ! return null; ! } ! public Object visitAssign(Assign node) throws Exception { ! visit(node.targets[0]); ! return null; ! } ! public Object visitAttribute(Attribute node) throws Exception { ! visit(node.value); ! return null; ! } ! public Object visitAugAssign(AugAssign node) throws Exception { ! visit(node.target); ! return null; ! } ! public Object visitBinOp(BinOp node) throws Exception { ! visit(node.left); ! return null; ! } ! public Object visitBoolOp(BoolOp node) throws Exception { ! visit(node.values[0]); ! return null; ! } ! public Object visitCall(Call node) throws Exception { ! visit(node.func); ! return null; ! } ! public Object visitCompare(Compare node) throws Exception { ! visit(node.left); ! return null; ! } ! public Object visitDelete(Delete node) throws Exception { ! handleDefault(node); ! this.indent -= 4; ! return null; ! } ! public Object visitExec(Exec node) throws Exception { ! visit(node); ! this.indent -= 5; ! return null; ! } ! public Object visitExpr(Expr node) throws Exception { ! visit(node.value); ! return null; ! } ! public Object visitGeneratorExp(GeneratorExp node) throws Exception { ! visit(node.elt); ! return null; ! } ! @Override ! public Object visitImport(Import node) throws Exception { ! this.indent = 1; ! return null; ! } ! @Override ! public Object visitImportFrom(ImportFrom node) throws Exception { ! this.indent = 1; ! return null; ! } ! public Object visitPrint(Print node) throws Exception { ! handleDefault(node); ! this.indent -= 6; ! return null; ! } ! public Object visitSuite(Suite node) throws Exception { ! visit(node.body[0]); ! return null; ! } ! public Object visitTryFinally(TryFinally node) throws Exception { ! handleDefault(node); ! return null; ! } } Index: LastLineVisitor.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.refactoring/src/org/python/pydev/refactoring/ast/visitors/position/LastLineVisitor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** LastLineVisitor.java 20 Oct 2007 19:31:03 -0000 1.3 --- LastLineVisitor.java 27 Sep 2008 20:00:51 -0000 1.4 *************** *** 20,45 **** public class LastLineVisitor extends VisitorBase { ! private int lastLine; ! public LastLineVisitor() { ! lastLine = 0; ! } ! @Override ! public void traverse(SimpleNode node) throws Exception { ! if (node != null) ! node.traverse(this); ! } ! @Override ! protected Object unhandled_node(SimpleNode node) throws Exception { ! if (node.beginLine > lastLine) ! lastLine = node.beginLine; ! return null; ! } ! public int getLastLine() { ! return lastLine; ! } } --- 20,45 ---- public class LastLineVisitor extends VisitorBase { ! private int lastLine; ! public LastLineVisitor() { ! lastLine = 0; ! } ! @Override ! public void traverse(SimpleNode node) throws Exception { ! if (node != null) ! node.traverse(this); ! } ! @Override ! protected Object unhandled_node(SimpleNode node) throws Exception { ! if (node.beginLine > lastLine) ! lastLine = node.beginLine; ! return null; ! } ! public int getLastLine() { ! return lastLine; ! } } |