def on_query_completions(self, view, prefix, locations):
        pos = locations[0]
        scopes = view.scope_name(pos).split()
        if scopes not in "source.json":
            return []
        else:
            doc = view.substr(sublime.Region(0,view.size()))

            whitespaces = 0;
            for index, char in enumerate(doc[0:pos]):
                if char == '\n' or char == '\r' or char == ' ' or char == '\t':
                    whitespaces += 1

            doc = doc.replace('\n', '').replace('\r','').replace(' ', '').replace('\t', '')
            pos = pos - whitespaces

            depth = -1
            tokens = []
            token_regex = re.compile(r'"([-a-zA-Z0-9+]+)":{')

            for index, char in enumerate(doc):
                if char == '{':
                    depth += 1
                    token_regex = r'"([-a-zA-Z0-9+]+)":{$'
                    match = re.search(token_regex, doc[0:index+1])
                    try:
                        tokens.append(match.group(1))
                    except AttributeError as e:
                        pass
                if char == '}':
                    depth -= 1
                    try:
                        tokens.pop()
                    except IndexError as e:
                        pass
                if index==pos:
                    if (depth == 1 and tokens[0] == 'dependencies'):
                        # Version number
                        version_regex = r'(?:,|{|\[])"([-a-zA-Z0-9.*]+)":"[-a-zA-Z0-9.*]*$'
                        try:
                            package_name = re.search(version_regex, doc[0:index]).group(1)
                            return (self.result[package_name], AC_OPTS)
                        except AttributeError as e:
                            pass
                        except KeyError as e:
                            # TODO: Not in cache. Make HTTP request to feth completions on that package
                            return AC_OPTS
                        # Package name
                        return (self.cache, AC_OPTS)
                    elif depth == 0:
                        # In future, get completions dynamically from http://schemastore.org/schemas/json/project
                        # Replace word completions with snippets
                        return ([('version', 'version" : "$1"'),
                                    ('dependencies', 'dependencies" : {\n\t"$1": "$2"\n}'),
                                    ('commands', 'commands" : {\n\t"$1": "$2"\n}'),
                                    ('configurations', 'configurations" : {\n\t"$1": {}\n}'),
                                    ('compilationOptions', 'compilationOptions'),
                                    ('frameworks', 'frameworks" : {\n\t"$1": "$2"\n}'),
                                    ('description', 'description" : "$1"'),
                                    ('authors', 'authors" : [\n\t"$1"\n]'),
                                    ('code', 'code" : {\n\t"$1": "$2"\n}'),
                                    ('shared', 'shared" : {\n\t"$1": "$2"\n}'),
                                    ('exclude', 'exclude" : {\n\t"$1": "$2"\n}'),
                                    ('preprocess', 'preprocess" : {\n\t"$1": "$2"\n}'),
                                    ('resources', 'resources')
                                ], AC_OPTS)
                    else:
                        break

            return AC_OPTS
dataset/ETHPy150Open ligershark/Kulture/Completions.py/KKultureCompletion.on_query_completions/swapped operands of `not in`