code: private CompletionProvider helpCompletion() {
          return (code, cursor, anchor) -> {
              List<Suggestion> result;
              int pastSpace = code.indexOf(' ') + 1; // zero if no space
              if (pastSpace == 0) {
                  // initially suggest commands (with slash) and subjects,
                  // however, if their subject starts without slash, include
                  // commands without slash
                  boolean noslash = code.length() > 0 && !code.startsWith("/");
                  result = new FixedCompletionProvider(commands.values().stream()
                          .filter(cmd -> cmd.kind.showInHelp || cmd.kind == CommandKind.HELP_SUBJECT)
                          .map(c -> ((noslash && c.command.startsWith("/"))
                                  ? c.command.substring(1)
                                  : c.command) + " ")
                          .toArray(String[]::new))
                          .completionSuggestions(code, cursor, anchor);
              } else if (code.startsWith("/se") || code.startsWith("se")) {
                  result = new FixedCompletionProvider(SET_SUBCOMMANDS)
                          .completionSuggestions(code.substring(pastSpace), cursor - pastSpace, anchor);
              } else {
                  result = Collections.emptyList();
              }
              anchor[0] += pastSpace;
              return result;
          };
      }
docs: Completion of help, commands and subjects