コード例 #1
0
        private ImmutableArray <GitreeListNode> CreateLists(SourceNode node)
        {
            return(node
                   .ChildrenInfos()
                   .Select(CreateListOption)
                   .Values()
                   .ToImmutableArray());

            Option <GitreeListNode> CreateListOption(ChildInfo info)
            {
                if (info.IsList &&
                    Gitree.SeparatableKinds.Contains(info.Node.Kind) &&
                    info.Node is IListNode list)
                {
                    var treeNodes = CreateList(list.NodeList);
                    var name      = Gitree.ChildListAliases.TryGetValue(info.Name, out var alias)
                        ? alias : info.Name;
                    return(new GitreeListNode(name, treeNodes).Some());
                }
                return(default);