'Handle a `completions` result.
Only handle the response if we are on the same line of text and
on the same `obj` as the original request.'

def _handle_completions_result(self, comp_list, info, prev_info):

    if (info.line_num != prev_info.line_num):
        return
    completion_text = info.obj
    prev_text = prev_info.obj
    if (prev_info.obj is None):
        completion_text = ''
        prev_text = ''
    if (not completion_text.startswith(prev_text)):
        return
    if (info.full_obj and (len(info.full_obj) > len(info.obj))):
        new_list = [(c, t) for (c, t) in comp_list if c.startswith(info.full_obj)]
        if new_list:
            pos = info.editor.get_position('cursor')
            new_pos = ((pos + len(info.full_obj)) - len(info.obj))
            info.editor.set_cursor_position(new_pos)
            completion_text = info.full_obj
            comp_list = new_list
    if ('.' in completion_text):
        completion_text = completion_text.split('.')[(-1)]
    comp_list = [(c.split('.')[(-1)], t) for (c, t) in comp_list]
    comp_list = [(c, t) for (c, t) in comp_list if c.startswith(completion_text)]
    info.editor.show_completion_list(comp_list, completion_text, prev_info.automatic)
