예제 #1
0
    def run(self, edit):
        reg = single_selected_region(self.view)
        rec = op.parse_import_section(self.view).record_at_or_stop(reg)

        run_command_thru_palette(self.view.window(), 'poli_rename_import', {
            'imported_as': rec.imported_as
        })
예제 #2
0
    def run(self, edit, force):
        reg = single_selected_region(self.view)
        rec = op.parse_import_section(self.view).record_at_or_stop(reg)

        self.view.run_command('poli_remove_import', {
            'imported_as': rec.imported_as,
            'force': force
        })
예제 #3
0
 def __init__(self, view, args, chain_tail):
     rec = op.parse_import_section(view).record_for_imported_name(
         args['imported_as']
     )
     if rec is None:
         raise RuntimeError
     disallowed_names = op.known_names(view)
     super().__init__(view, chain_tail, rec.name, disallowed_names)
예제 #4
0
파일: navigate.py 프로젝트: egnartsms/poli
    def run(self, edit):
        reg = single_selected_region(self.view)

        if op.reg_import_section(self.view).contains(reg):
            impsec = op.parse_import_section(self.view)
            rec = impsec.record_at_or_stop(reg)
            op.goto_module_entry(self.view.window(), rec.module_name, rec.name)
        else:
            mtch = op.reference_at(self.view, reg)
            if mtch is None:
                sublime.status_message("No name under cursor")
                return

            star, name = mtch.group('star', 'name')
            op.goto_ref(self.view, star, name)
예제 #5
0
 def __init__(self, view, args, chain_tail):
     super().__init__(view, chain_tail)
     impsec = op.parse_import_section(view)
     self.imported_names = list(impsec.imported_names())
예제 #6
0
파일: refactor.py 프로젝트: egnartsms/poli
 def __init__(self, view):
     impsec = op.parse_import_section(view)
     self.items = [rec.module_name for rec in impsec.recs if rec.is_star]