def inline_local_variable(self): lisp.save_some_buffers() filename = lisp.buffer_file_name() line, col = _getCoords() brmctx.inlineLocalVariable(filename, line, col) lisp.set_marker(lisp.mark_marker(), None) _revertSavedFiles(brmctx.save())
def inline_local_variable(self): lisp.save_some_buffers() filename = lisp.buffer_file_name() line,col = _getCoords() brmctx.inlineLocalVariable(filename,line,col) lisp.set_marker(lisp.mark_marker(),None) _revertSavedFiles(brmctx.save())
def find_references(self): lisp.save_some_buffers() filename = lisp.buffer_file_name() line,col = _getCoords() refs = brmctx.findReferencesByCoordinates(filename,line,col) _switchToConsole() numRefs = 0 for ref in refs: _insertRefLineIntoConsole(ref) numRefs +=1 lisp.insert("Done - %d refs found\n"%numRefs)
def find_references(self): lisp.save_some_buffers() filename = lisp.buffer_file_name() line, col = _getCoords() refs = brmctx.findReferencesByCoordinates(filename, line, col) _switchToConsole() numRefs = 0 for ref in refs: _insertRefLineIntoConsole(ref) numRefs += 1 lisp.insert("Done - %d refs found\n" % numRefs)
def rename(self,newname): lisp.save_some_buffers() filename = lisp.buffer_file_name() line,col = _getCoords() brmctx.setRenameMethodPromptCallback(promptCallback) try: self.ctx.renameByCoordinates(filename,line,col,newname) savedFiles = brmctx.save() _revertSavedFiles(savedFiles) lisp.set_marker(lisp.mark_marker(),None) except bikefacade.CouldntLocateASTNodeFromCoordinatesException: print >>logger,"Couldn't find AST Node. Are you renaming the declaration?"
def extract_method(self,name): lisp.save_some_buffers() filename = lisp.buffer_file_name() bline,bcol = _getPointCoords() lisp.exchange_point_and_mark() eline,ecol = _getPointCoords() lisp.exchange_point_and_mark() brmctx.extract(filename,bline,bcol,eline,ecol,name) lisp.set_marker(lisp.mark_marker(),None) _revertSavedFiles(brmctx.save())
def rename(self, newname): lisp.save_some_buffers() filename = lisp.buffer_file_name() line, col = _getCoords() brmctx.setRenameMethodPromptCallback(promptCallback) try: self.ctx.renameByCoordinates(filename, line, col, newname) savedFiles = brmctx.save() _revertSavedFiles(savedFiles) lisp.set_marker(lisp.mark_marker(), None) except bikefacade.CouldntLocateASTNodeFromCoordinatesException: print >> logger, "Couldn't find AST Node. Are you renaming the declaration?"
def extract_method(self, name): lisp.save_some_buffers() filename = lisp.buffer_file_name() bline, bcol = _getPointCoords() lisp.exchange_point_and_mark() eline, ecol = _getPointCoords() lisp.exchange_point_and_mark() brmctx.extract(filename, bline, bcol, eline, ecol, name) lisp.set_marker(lisp.mark_marker(), None) _revertSavedFiles(brmctx.save())
def find_definition(self): lisp.save_some_buffers() filename = lisp.buffer_file_name() line,col = _getCoords() defns = brmctx.findDefinitionByCoordinates(filename,line,col) try: firstdefn = defns.next() lisp.find_file_other_window(firstdefn.filename) lisp.goto_line(firstdefn.lineno) lisp.forward_char(firstdefn.colno) except StopIteration: pass else: numRefs = 1 for defn in defns: if numRefs == 1: _switchToConsole() _insertRefLineIntoConsole(firstdefn) _insertRefLineIntoConsole(defn) numRefs += 1
def find_definition(self): lisp.save_some_buffers() filename = lisp.buffer_file_name() line, col = _getCoords() defns = brmctx.findDefinitionByCoordinates(filename, line, col) try: firstdefn = defns.next() lisp.find_file_other_window(firstdefn.filename) lisp.goto_line(firstdefn.lineno) lisp.forward_char(firstdefn.colno) except StopIteration: pass else: numRefs = 1 for defn in defns: if numRefs == 1: _switchToConsole() _insertRefLineIntoConsole(firstdefn) _insertRefLineIntoConsole(defn) numRefs += 1
def move_class(self,newfilename): lisp.save_some_buffers() filename = lisp.buffer_file_name() line,col = _getCoords() brmctx.moveClassToNewModule(filename,line,newfilename) _revertSavedFiles(brmctx.save())
def move_class(self, newfilename): lisp.save_some_buffers() filename = lisp.buffer_file_name() line, col = _getCoords() brmctx.moveClassToNewModule(filename, line, newfilename) _revertSavedFiles(brmctx.save())