Navigation
Synopsis Create proposals from the symboltree from the label annotations.
Function
  1. list[CompletionProposal] createProposalsFromLabels(SymbolTree tree)
  2. list[CompletionProposal] createProposalsFromLabels(list[SymbolTree] tree)
Usage import util::ContentCompletion;
Description Create proposals from the symboltree from the label annotations. The newText property of a proposal will be the symbol's name, the proposal text shown will be the label. Remember to set the "label" annotation on the tree and all children.
Examples
rascal>import ParseTree;
ok
rascal>import Type;
ok
rascal>import util::ContentCompletion;
ok
rascal>SymbolTree symbol = symbol("main", "method", ());
SymbolTree: symbol(
  "main",
  "method",
  ())
rascal>symbol@label = "main (Entry Point)";
SymbolTree: symbol(
  "main",
  "method",
  ())[
  @label="main (Entry Point)"
]
rascal>createProposalsFromLabels(symbol);
list[CompletionProposal]: [sourceProposal("main","main (Entry Point)")]
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.