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 })
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 })
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)
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)
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())
def __init__(self, view): impsec = op.parse_import_section(view) self.items = [rec.module_name for rec in impsec.recs if rec.is_star]