Esempio n. 1
0
def parse_import(imp):
    return symbols.Import(
        get_value(imp, 'name'),
        is_qualified=get_value(imp, 'qualified'),
        import_as=get_value(imp, 'as'),
        position=parse_position(imp.get('pos')),
    ) if imp else None
Esempio n. 2
0
    def collect_completions(self, backend, modinfo, lookup):
        if Settings.COMPONENT_DEBUG.completions:
            print('ghc-mod collect_completions for {0}'.format(modinfo))

        modname, is_qualified, qualname = modinfo
        mod_imported = [symbols.Import(modname, is_qualified, qualname)]
        syms = backend.command_backend('browse -d -o ' + modname) if backend is not None else []
        Logging.log('ghc-mod collect_completions: syms {0}'.format(syms), Logging.LOG_DEBUG)
        return [self.parse_syminfo(sym, mod_imported) for sym in syms if sym.startswith(lookup)]
Esempio n. 3
0
def parse_import(imp):
    return symbols.Import(imp['name'], imp['qualified'], imp.get('as'),
                          parse_position(imp.get('pos'))) if imp else None
Esempio n. 4
0
def parse_import(imp):
    if not imp:
        return None
    return symbols.Import(imp['name'], imp['qualified'], imp.get('as'),
                          parse_position(imp.get('pos')))