MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / assembleCompletions

Method assembleCompletions

src/main/java/fieldbox/boxes/Box.java:662–688  ·  view source on GitHub ↗
(String prefix, Stream<Dict.Prop> propStream)

Source from the content-addressed store, hash-verified

660
661 return l1;
662 }
663
664 private List<Completion> assembleCompletions(String prefix, Stream<Dict.Prop> propStream) {
665 Set<String> s1 = new LinkedHashSet<>();
666
667 try {
668 s1 = propStream
669 .filter(x -> x.getAttributes().get(availableForCompletion) == null || x.getAttributes().get(availableForCompletion).test(this))
670 .map(Dict.Prop::getName)
671 .filter(x -> !x.startsWith("_"))
672 .collect(Collectors.toSet());
673 } catch (IllegalArgumentException e) {// skip error about unconnected boxes
674 }
675
676
677 return s1.stream()
678 .filter(x -> x.startsWith(prefix))
679 .sorted()
680 .map(x -> {
681 Dict.Prop q = new Dict.Prop(x).findCanon();
682 if (q == null) {
683 return null;
684 } else
685 return new Completion(-1, -1, x, "<span class='type'>" + Conversions.fold(q.getTypeInformation(), t -> compress(
686 t)) + "</span> " + possibleToString(this, q) + " &mdash; <span class='doc'>" + format(q.getDocumentation()) + "</span>");
687 })
688 .filter(x -> x != null)
689 .collect(Collectors.toList());
690 }
691

Callers 1

getCompletionsForMethod · 0.95

Calls 13

foldMethod · 0.95
compressMethod · 0.95
possibleToStringMethod · 0.95
formatMethod · 0.95
collectMethod · 0.80
getAttributesMethod · 0.80
getTypeInformationMethod · 0.80
getDocumentationMethod · 0.80
getMethod · 0.65
mapMethod · 0.45
testMethod · 0.45
streamMethod · 0.45

Tested by

no test coverage detected