def get_best_type(self, types):
        if not types:
            return None

        region = self.view.sel()[0]
        file_region = region_by_region(self.view, region, '')
        if region.a != region.b:
            return sorted(types, key = lambda r: file_region.precise_in_region(self.view, r))[0]
        else:
            return types[0]
dataset/ETHPy150Open SublimeHaskell/SublimeHaskell/haskell_type.py/SublimeHaskellShowType.get_best_type/original