// f1(**locals())
currScopeItems.setAllUsed();
return true;
}
Iterator<String> it = new FullRepIterable(rep, true).iterator();
//search for it
while (found == false && it.hasNext()) {
String nextTokToSearch = it.next();
foundAs = scope.findFirst(nextTokToSearch, true, acceptedScopes);
found = foundAs != null;
if (found) {
foundAsStr = nextTokToSearch;
foundAs.getSingle().references.add(token);
onFoundTokenAs(token, foundAs);
}
}
if (!found) {
//this token might not be defined... (still, might be in names to ignore)
int i;
if ((i = rep.indexOf('.')) != -1) {
//if it is an attribute, we have to check the names to ignore just with its first part
rep = rep.substring(0, i);
}
if (addToNotDefined) {
com.aptana.shared_core.structure.Tuple<IToken, Found> foundInNamesToIgnore = findInNamesToIgnore(rep, token);
if (foundInNamesToIgnore == null) {
Found foundForProbablyNotDefined = makeFound(token);
if (scope.size() > 1) { //if we're not in the global scope, it might be defined later
probablyNotDefined.add(foundForProbablyNotDefined); //we are not in the global scope, so it might be defined later...
onAddToProbablyNotDefined(token, foundForProbablyNotDefined);
} else {
onAddUndefinedMessage(token, foundForProbablyNotDefined); //it is in the global scope, so, it is undefined.
}
} else {
IToken tokenInNamesToIgnore = foundInNamesToIgnore.o1;
onFoundInNamesToIgnore(token, tokenInNamesToIgnore);
}
}
} else if (checkIfIsValidImportToken) {
//ok, it was found, but is it an attribute (and if so, are all the parts in the import defined?)
//if it was an attribute (say xxx and initially it was xxx.foo, we will have to check if the token foo
//really exists in xxx, if it was found as an import)
try {
if (foundAs.isImport() && !rep.equals(foundAsStr) && foundAs.importInfo != null
&& foundAs.importInfo.wasResolved) {
//the foundAsStr equals the module resolved in the Found tok
IModule m = foundAs.importInfo.mod;
String tokToCheck;
if (foundAs.isWildImport()) {
tokToCheck = foundAsStr;
} else {
String tok = foundAs.importInfo.rep;
tokToCheck = rep.substring(foundAsStr.length() + 1);
if (tok.length() > 0) {
tokToCheck = tok + "." + tokToCheck;
}
}
for (String repToCheck : new FullRepIterable(tokToCheck)) {
int inGlobalTokens = m.isInGlobalTokens(repToCheck, nature, true, true, this.completionCache);
if (inGlobalTokens == IModule.NOT_FOUND) {
if (!isDefinitionUnknown(m, repToCheck)) {
//Check if there's some hasattr (if there is, we'll consider that the token which