Navigation
Synopsis Compares completion proposals for the purpose of alphabetical ordering.
Function bool lessThan(CompletionProposal lhs, CompletionProposal rhs)
Usage import util::ContentCompletion;
Description Compares completion proposals for the purpose of alphabetical ordering. A proposal's newText property is used to decide order. Usable in the list sort function, see List/sort.
Examples
rascal>import util::ContentCompletion;
ok
rascal>import List;
ok
rascal>list[CompletionProposal] proposals = [sourceProposal("banana"), sourceProposal("apple")];
list[CompletionProposal]: [
  sourceProposal("banana"),
  sourceProposal("apple")
]
rascal>sort(proposals, lessThan);
list[CompletionProposal]: [
  sourceProposal("apple"),
  sourceProposal("banana")
]
Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.