'Find all possible hits for the first token in the submitted
scoperefs (normally the current blob and the builtin blob).
We need to check all required modules as well --
these look like <import module=lib symbol="*">
Also check imported names: <import symbol=Namespace />
Returns a list of <hit> or [] if we could
not resolve.
Example for \'String\' normally:
retval: [(<class \'String\'>, (<blob \'*\'>, [])),]
Let\'s say they opened it in the source to add a new method:
retval: [(<class \'String\'>, (<blob \'*\'>, [])),]
(<class \'String\'>, (<blob \'this\'>, [\'file\', \'class\']))]'

def _hits_from_first_part(self, first_token, only_scoperef):

    if self._get_current_names:
        hits = []
        scoperef = (only_scoperef or self._base_scoperefs[0])
        while True:
            elem = self._elem_from_scoperef(scoperef)
            if (elem is not None):
                if (only_scoperef is None):
                    hits.append((elem, scoperef))
                elif (first_token in elem.names):
                    self._append_hits_from_name(hits, first_token, scoperef, elem)
            scoperef = self.parent_scoperef_from_scoperef(scoperef)
            if (not scoperef):
                break
        if (only_scoperef is None):
            hits += [(sc[0], sc) for sc in self._base_scoperefs[1:]]
        return hits
    scoperef = (only_scoperef or self._base_scoperefs[0])
    hits = []
    self.log("_hit_from_first_part:    try    to    resolve    '%s'    ...", first_token)
    while scoperef:
        elem = self._elem_from_scoperef(scoperef)
        if ((elem is not None) and (first_token in elem.names)):
            self.log("_hit_from_first_part:    is    '%s'    accessible    on    %s?    yes:    %s", first_token, scoperef, elem.names[first_token])
            self._append_hits_from_name(hits, first_token, scoperef, elem)
            break
        self.log("_hit_from_first_part:    is    '%s'    accessible    on    %s?    no", first_token, scoperef)
        scoperef = self.parent_scoperef_from_scoperef(scoperef)
    if (only_scoperef or (hits and self._hit_helper.is_variable(hits[0]))):
        return hits
    for scoperef in self._base_scoperefs[1:]:
        elem = self._elem_from_scoperef(scoperef)
        if (first_token in elem.names):
            self.log("_hit_from_first_part:    is    '%s'    accessible    on    %s?    yes:    %s", first_token, scoperef, elem.names[first_token])
            self._append_hits_from_name(hits, first_token, scoperef, elem)
    if (not hits):
        for scoperef in self._base_scoperefs[2:]:
            imports = self._get_required_modules(scoperef[0])
            for imp in imports:
                blob = self._get_imported_blob(imp)
                if (blob and (first_token in blob.names)):
                    hits.append((blob.names[first_token], (blob, [first_token])))
    return hits
