def on_query_completions(self, view, prefix, locations):
        results = []
        try:
            pos = locations[0]
            env = getenv()
            p = openProcess(["gocode", "-sock=tcp", "-addr=localhost:37777", "-f=json", "autocomplete", view.file_name().encode('utf-8'), str(pos)], env=env, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
            src = view.substr(sublime.Region(0, view.size()))
            stdout, stderr = p.communicate(input=src.encode())
            if p.returncode != 0:
                err = stderr.decode('utf-8')
                print("gocode failed: %s" % (err))
                return []

            try:
                j = json.loads(stdout.decode("utf8"))
            except __HOLE__:
                print("Not valid JSON")
                return []

            if len(j) == 2:
                for r in j[1]:
                    #results.append(['trigger': r['name'], 'contents': r['name']])
                    results.append([ r['name'], r['name']])
        except Exception as e:
            print(e)
        return results
dataset/ETHPy150Open newhook/gomode/gomode.py/GoModeAutocomplete.on_query_completions