Beispiel #1
0
 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())
Beispiel #2
0
 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())
Beispiel #3
0
 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)
Beispiel #4
0
 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)
Beispiel #5
0
 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?"
Beispiel #6
0
    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())
Beispiel #7
0
 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?"
Beispiel #8
0
    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())
Beispiel #9
0
    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
Beispiel #10
0
    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
Beispiel #11
0
 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())
Beispiel #12
0
 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())