コード例 #1
0
ファイル: interface.py プロジェクト: k-anderson/emacs
    def analyze_modules(self):
        """Perform static object analysis on all project modules"""
        self._check_project()

        def _analyze_modules(handle):
            libutils.analyze_modules(self.project, task_handle=handle)

        refactor.runtask(self.env, _analyze_modules, 'Analyze project modules')
コード例 #2
0
ファイル: interface.py プロジェクト: Gosha/ropemode
    def analyze_modules(self):
        """Perform static object analysis on all project modules"""
        self._check_project()

        def _analyze_modules(handle):
            libutils.analyze_modules(self.project, task_handle=handle)

        refactor.runtask(self.env, _analyze_modules, "Analyze project modules")
コード例 #3
0
ファイル: interface.py プロジェクト: armike/emacs
 def redo(self):
     self._check_project()
     change = self.project.history.tobe_redone
     if change is None:
         self.env.message('Nothing to redo!')
         return
     if self.env.y_or_n('Redo [%s]? ' % str(change)):
         def redo(handle):
             for changes in self.project.history.redo(task_handle=handle):
                 self._reload_buffers(changes)
         refactor.runtask(self.env, redo, 'Redo refactoring',
                          interrupts=False)
コード例 #4
0
ファイル: interface.py プロジェクト: 13609594236/AcVim
    def generate_autoimport_cache(self):
        if not self._check_autoimport():
            return
        modules = self.env.get('autoimport_modules')
        modules = [ m if isinstance(m, basestring) else m.value() for m in modules ]

        def generate(handle):
            self.autoimport.generate_cache(task_handle=handle)
            self.autoimport.generate_modules_cache(modules, task_handle=handle)

        refactor.runtask(self.env, generate, 'Generate autoimport cache')
        self.write_project()
コード例 #5
0
 def redo(self):
     self._check_project()
     change = self.project.history.tobe_redone
     if change is None:
         self.env.message('Nothing to redo!')
         return
     if self.env.y_or_n('Redo [%s]? ' % str(change)):
         def redo(handle):
             for changes in self.project.history.redo(task_handle=handle):
                 self._reload_buffers(changes)
         refactor.runtask(self.env, redo, 'Redo refactoring',
                          interrupts=False)
コード例 #6
0
ファイル: interface.py プロジェクト: Gosha/ropemode
    def undo(self):
        self._check_project()
        change = self.project.history.tobe_undone
        if change is None:
            self.env.message("Nothing to undo!")
            return
        if self.env.y_or_n("Undo [%s]? " % str(change)):

            def undo(handle):
                for changes in self.project.history.undo(task_handle=handle):
                    self._reload_buffers(changes, undo=True)

            refactor.runtask(self.env, undo, "Undo refactoring", interrupts=False)
コード例 #7
0
ファイル: interface.py プロジェクト: sshanbha/vim-settings
    def generate_autoimport_cache(self):
        if not self._check_autoimport():
            return
        modules = self.env.get('autoimport_modules')
        modules = [
            m if isinstance(m, basestring) else m.value() for m in modules
        ]

        def generate(handle):
            self.autoimport.generate_cache(task_handle=handle)
            self.autoimport.generate_modules_cache(modules, task_handle=handle)

        refactor.runtask(self.env, generate, 'Generate autoimport cache')
        self.write_project()
コード例 #8
0
 def generate_autoimport_cache(self):
     if not self._check_autoimport():
         return
     modules = self.env.get('autoimport_modules')
     modnames = []
     if modules:
         for i in range(len(modules)):
             modname = modules[i]
             if not isinstance(modname, basestring):
                 modname = modname.value()
             modnames.append(modname)
     def generate(handle):
         self.autoimport.generate_cache(task_handle=handle)
         self.autoimport.generate_modules_cache(modules, task_handle=handle)
     refactor.runtask(self.env, generate, 'Generate autoimport cache')
コード例 #9
0
ファイル: interface.py プロジェクト: Szkered/dotfiles-1
 def generate_autoimport_cache(self):
     if not self._check_autoimport():
         return
     modules = self.env.get('autoimport_modules')
     modnames = []
     if modules:
         for i in range(len(modules)):
             modname = modules[i]
             if not isinstance(modname, basestring):
                 modname = modname.value()
             modnames.append(modname)
     def generate(handle):
         self.autoimport.generate_cache(task_handle=handle)
         self.autoimport.generate_modules_cache(modules, task_handle=handle)
     refactor.runtask(self.env, generate, 'Generate autoimport cache')
コード例 #10
0
ファイル: interface.py プロジェクト: Gosha/ropemode
    def _base_findit(self, do_find, optionals, get_kwds):
        self._check_project()
        self._save_buffers()
        resource, offset = self._get_location()

        action, values = dialog.show_dialog(self._askdata, ["search", "cancel"], optionals=optionals)
        if action == "search":
            kwds = get_kwds(values)

            def calculate(handle):
                resources = refactor._resources(self.project, values.get("resources"))
                return do_find(self.project, resource, offset, resources=resources, task_handle=handle, **kwds)

            result = refactor.runtask(self.env, calculate, "Find Occurrences")
            locations = [Location(location) for location in result]
            self.env.show_occurrences(locations)
コード例 #11
0
    def _base_findit(self, do_find, optionals, get_kwds):
        self._check_project()
        self._save_buffers()
        resource, offset = self._get_location()

        action, values = dialog.show_dialog(
            self._askdata, ['search', 'cancel'], optionals=optionals)
        if action == 'search':
            kwds = get_kwds(values)
            def calculate(handle):
                resources = refactor._resources(self.project,
                                                values.get('resources'))
                return do_find(self.project, resource, offset,
                               resources=resources, task_handle=handle, **kwds)
            result = refactor.runtask(self.env, calculate, 'Find Occurrences')
            locations = [Location(location) for location in result]
            self.env.show_occurrences(locations)