

def GetTypeCompletions(self, view, baseTypes=True):
    global cacheLock
    with cacheLock:
        global completionCache
        scripts = completionCache.get('types', None)
        if (not scripts):
            scripts = []
            paths = SublimePapyrus.GetSourcePaths(view)
            for path in paths:
                if os.path.isdir(path):
                    files = [f for f in os.listdir(path) if ('.psc' in f)]
                    for file in files:
                        scripts.append((('%s\tscript' % file[:(- 4)].lower()), ('%s' % file[:(- 4)])))
            scripts = list(set(scripts))
            self.SetTypeCompletions(scripts)
        if baseTypes:
            scripts.extend([('bool\ttype', 'Bool'), ('float\ttype', 'Float'), ('int\ttype', 'Int'), ('string\ttype', 'String')])
        return scripts

dataset/ETHPy150Open Kapiainen/SublimePapyrus/Source/Modules/Skyrim/Plugin.py EventListener.GetTypeCompletions/original