예제 #1
0
def symbol_info(filename, module_name, symbol_name, cabal = None, no_ghci = False):
    result = None
    if hdevtools.hdevtools_enabled():
        result = hdevtools.hdevtools_info(filename, symbol_name, cabal = cabal)
    if not result and ghcmod.ghcmod_enabled():
        result = ghcmod.ghcmod_info(filename, module_name, symbol_name, cabal = cabal)
    if not result and not filename and not no_ghci:
        result = ghci.ghci_info(module_name, symbol_name, cabal = cabal)
    return result
예제 #2
0
파일: util.py 프로젝트: wrvn/SublimeHaskell
def symbol_info(filename, module_name, symbol_name, cabal = None, no_ghci = False):
    result = None
    if hdevtools.hdevtools_enabled():
        result = hdevtools.hdevtools_info(filename, symbol_name, cabal = cabal)
    if not result and ghcmod.ghcmod_enabled():
        result = ghcmod.ghcmod_info(filename, module_name, symbol_name, cabal = cabal)
    if not result and not filename and not no_ghci:
        result = ghci.ghci_info(module_name, symbol_name, cabal = cabal)
    return result
예제 #3
0
def symbol_info(filename, module_name, symbol_name, cabal=None):
    result = None
    if common.get_setting_async("enable_hdevtools"):
        result = hdevtools.hdevtools_info(filename, symbol_name, cabal=cabal)
    if not result:
        result = ghcmod.ghcmod_info(filename, module_name, symbol_name, cabal=cabal)
    if not result and filename:
        result = ghci.ghci_info(module_name, symbol_name, cabal=cabal)
    return result
예제 #4
0
def refine_type(decl, hdevtools_only=True):
    """
    Refine type for sources decl
    """
    hdevtools_enabled = common.get_setting_async("enable_hdevtools")

    if decl.location:
        if decl.what == "function" and not decl.type:
            info = None
            if hdevtools_only and hdevtools_enabled:
                info = hdevtools.hdevtools_info(decl.location.filename, decl.name)
            else:
                info = symbol_info(decl.location.filename, decl.module.name, decl.name)
            if info:
                decl.type = info.type