def on_query_completions(self, view, prefix, locations): if not FSharpAutocomplete.WAIT_ON_COMPLETIONS: return [] try: data = completions_queue.get(block=True, timeout=.75) data = json.loads(data.decode('utf-8')) return [[item, item] for item in data['Data']] except: return [] finally: FSharpAutocomplete.WAIT_ON_COMPLETIONS = False
def fetch_completions(): data = completions_queue.get(block=True, timeout=.75) data = json.loads(data.decode('utf-8')) completions = [[item["Name"], item["Name"]] for item in data['Data']] return completions