assertTrue(nameToken == null);
if(offset <= namedRef.getDotOffset()) {
nodeAtOffset = namedRef.getParent();
}
PrefixSearchOptions searchOptions = new PrefixSearchOptions();
return performCompletionSearch(offset, mr, module, nodeAtOffset, searchOptions);
} else if(nodeAtOffset instanceof RefModule) {
RefModule refModule = (RefModule) nodeAtOffset;
// RefModule has a specialized way to setup prefix len things
String source = parseResult.source;
PrefixSearchOptions searchOptions = codeCompletionRefModule(offset, tokenAtOffsetRight, source, refModule);
return performCompletionSearch(offset, mr, module, nodeAtOffset, searchOptions);
}
if(nameToken != null) {
assertTrue(nameToken.getSourceRange().contains(offset));
PrefixSearchOptions searchOptions = new PrefixSearchOptions();
String searchPrefix = nameToken.getSourceValue().substring(0, offset - nameToken.getStartPos());
int rplLen = nameToken.getEndPos() - offset;
searchOptions.setPrefixSearchOptions(searchPrefix, rplLen);
// Because of some parser limitations, in some cases nodeForNameLookup needs to be corrected,
// such that it won't be the same as nodeForNameLookup
ASTNode nodeForNameLookup = getStartingNodeForNameLookup(nameToken.getStartPos(), module);
return performCompletionSearch(offset, mr, module, nodeForNameLookup, searchOptions);
} else {
PrefixSearchOptions searchOptions = new PrefixSearchOptions();
return performCompletionSearch(offset, mr, module, nodeAtOffset, searchOptions);
}
}