[Pydev-cvs] org.python.pydev.refactoring/src/org/python/pydev/refactoring/coderefactoring/extractlo
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2008-09-27 20:02:12
|
Update of /cvsroot/pydev/org.python.pydev.refactoring/src/org/python/pydev/refactoring/coderefactoring/extractlocal/edit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21605/src/org/python/pydev/refactoring/coderefactoring/extractlocal/edit Modified Files: ReplaceWithVariableEdit.java CreateLocalVariableEdit.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: CreateLocalVariableEdit.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.refactoring/src/org/python/pydev/refactoring/coderefactoring/extractlocal/edit/CreateLocalVariableEdit.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CreateLocalVariableEdit.java 20 Oct 2007 19:31:03 -0000 1.1 --- CreateLocalVariableEdit.java 27 Sep 2008 20:00:44 -0000 1.2 *************** *** 21,54 **** public class CreateLocalVariableEdit extends AbstractInsertEdit { ! private RefactoringInfo info; ! ! private String variableName; ! private exprType expression; ! public CreateLocalVariableEdit(ExtractLocalRequest req) { ! super(req); ! this.info = req.getRefactoringInfo(); ! this.variableName = req.getVariableName(); ! this.expression = req.getExpression(); ! } ! @Override ! protected SimpleNode getEditNode() { ! exprType variable = new Name(variableName, expr_contextType.Store); ! exprType[] target = {variable}; ! ! return new Assign(target, expression); ! } ! ! @Override ! public int getOffset() { ! PySelection selection = new PySelection(info.getDocument(), info.getExtendedSelection()); ! return selection.getStartLineOffset(); ! } ! @Override ! public int getOffsetStrategy() { ! return 0; ! } } --- 21,54 ---- public class CreateLocalVariableEdit extends AbstractInsertEdit { ! private RefactoringInfo info; ! ! private String variableName; ! private exprType expression; ! public CreateLocalVariableEdit(ExtractLocalRequest req) { ! super(req); ! this.info = req.getRefactoringInfo(); ! this.variableName = req.getVariableName(); ! this.expression = req.getExpression(); ! } ! @Override ! protected SimpleNode getEditNode() { ! exprType variable = new Name(variableName, expr_contextType.Store); ! exprType[] target = {variable}; ! ! return new Assign(target, expression); ! } ! ! @Override ! public int getOffset() { ! PySelection selection = new PySelection(info.getDocument(), info.getExtendedSelection()); ! return selection.getStartLineOffset(); ! } ! @Override ! public int getOffsetStrategy() { ! return 0; ! } } Index: ReplaceWithVariableEdit.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.refactoring/src/org/python/pydev/refactoring/coderefactoring/extractlocal/edit/ReplaceWithVariableEdit.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ReplaceWithVariableEdit.java 20 Oct 2007 19:31:03 -0000 1.1 --- ReplaceWithVariableEdit.java 27 Sep 2008 20:00:44 -0000 1.2 *************** *** 18,58 **** public class ReplaceWithVariableEdit extends AbstractReplaceEdit { ! private String variableName; ! private int offset; ! private int replaceLength; ! public ReplaceWithVariableEdit(ExtractLocalRequest req) { ! super(req); ! this.variableName = req.getVariableName(); ! ! ITextSelection selection = req.getRefactoringInfo().getExtendedSelection(); ! this.offset = selection.getOffset(); ! this.replaceLength = selection.getLength(); ! this.offsetAdapter = req.getOffsetNode(); ! } ! @Override ! protected SimpleNode getEditNode() { ! Name name = new Name(variableName, expr_contextType.Load); ! return name; ! } ! @Override ! public int getOffsetStrategy() { ! return 0; ! } ! @Override ! public int getOffset() { ! return offset; ! } ! @Override ! protected int getReplaceLength() { ! return replaceLength; ! } } --- 18,58 ---- public class ReplaceWithVariableEdit extends AbstractReplaceEdit { ! private String variableName; ! private int offset; ! private int replaceLength; ! public ReplaceWithVariableEdit(ExtractLocalRequest req) { ! super(req); ! this.variableName = req.getVariableName(); ! ! ITextSelection selection = req.getRefactoringInfo().getExtendedSelection(); ! this.offset = selection.getOffset(); ! this.replaceLength = selection.getLength(); ! this.offsetAdapter = req.getOffsetNode(); ! } ! @Override ! protected SimpleNode getEditNode() { ! Name name = new Name(variableName, expr_contextType.Load); ! return name; ! } ! @Override ! public int getOffsetStrategy() { ! return 0; ! } ! @Override ! public int getOffset() { ! return offset; ! } ! @Override ! protected int getReplaceLength() { ! return replaceLength; ! } } |