use of abs.frontend.typechecker.KindedName in project abstools by abstools.
the class PartialFunctionTest method assertHasFunction.
private FunctionDecl assertHasFunction(Model model, String regex) {
FunctionDecl result = getFunction(model, Pattern.compile(regex));
String errorMessage = "No expanded function with name " + regex + " created" + " (functions: " + getFunctions(model) + ")";
assertNotNull(errorMessage, result);
Decl decl = model.lookup(new KindedName(Kind.FUN, result.getName()));
assertFalse("Could not lookup function " + result.getName(), decl.isUnknown());
return result;
}
use of abs.frontend.typechecker.KindedName in project abstools by abstools.
the class ProposalFactory method addClassProposals.
/**
* add the classes in the current module
* @param node the node under the cursor
*/
private void addClassProposals(ASTNode<?> node) {
ProposalComparator comp = new ProposalComparator();
ArrayList<ICompletionProposal> tempNonqual = new ArrayList<ICompletionProposal>();
ArrayList<ICompletionProposal> tempQual = new ArrayList<ICompletionProposal>();
ModuleDecl moddecl = node.getModuleDecl();
// Only crash when debugging:
assert moddecl != null : "Node is not in a Module!";
if (moddecl == null)
return;
Map<KindedName, ResolvedName> visibleNames = moddecl.getVisibleNames();
for (Entry<KindedName, ResolvedName> kentry : visibleNames.entrySet()) {
KindedName kname = kentry.getKey();
if (qualifierIsPrefixOf(kname.getName()) && kname.getKind() == Kind.CLASS) {
CompletionProposal proposal = makeVisibleNameProposal(kentry.getValue(), kname);
if (kname.isQualified()) {
tempQual.add(proposal);
} else {
tempNonqual.add(proposal);
}
}
}
Collections.sort(tempNonqual, comp);
proposals.addAll(0, tempNonqual);
Collections.sort(tempQual, comp);
proposals.addAll(0, tempQual);
}
Aggregations