(String prefix, Stream<Dict.Prop> propStream)
| 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) + " — <span class='doc'>" + format(q.getDocumentation()) + "</span>"); |
| 687 | }) |
| 688 | .filter(x -> x != null) |
| 689 | .collect(Collectors.toList()); |
| 690 | } |
| 691 |
no test coverage detected