/// <summary>
        ///     Get hover content for an <see cref="MSBuildUnusedItemGroup"/>.
        /// </summary>
        /// <param name="unusedItemGroup">
        ///     The <see cref="MSBuildUnusedItemGroup"/>.
        /// </param>
        /// <returns>
        ///     The content, or <c>null</c> if no content is provided.
        /// </returns>
        public MarkedStringContainer UnusedItemGroup(MSBuildUnusedItemGroup unusedItemGroup)
        {
            if (unusedItemGroup == null)
            {
                throw new ArgumentNullException(nameof(unusedItemGroup));
            }

            string condition          = unusedItemGroup.Condition;
            string evaluatedCondition = _projectDocument.MSBuildProject.ExpandString(condition);

            List <MarkedString> content = new List <MarkedString>
            {
                $"Unused Item Group: `{unusedItemGroup.OriginatingElement.ItemType}` (condition is false)"
            };

            string itemTypeHelp = MSBuildSchemaHelp.ForItemType(unusedItemGroup.Name);

            if (itemTypeHelp != null)
            {
                content.Add(itemTypeHelp);
            }

            StringBuilder descriptionContent = new StringBuilder();

            string[] includes = unusedItemGroup.Includes.ToArray();
            descriptionContent.AppendLine(
                $"Include: `{unusedItemGroup.OriginatingElement.Include}`  "
                );
            descriptionContent.AppendLine();
            descriptionContent.Append(
                $"Would have evaluated to {unusedItemGroup.Items.Count} item"
                );
            if (!unusedItemGroup.HasSingleItem)
            {
                descriptionContent.Append("s");
            }
            descriptionContent.AppendLine(":");

            foreach (string include in includes.Take(5))
            {
                // TODO: Consider making hyperlinks for includes that map to files which exist.
                descriptionContent.AppendLine(
                    $"* `{include}`"
                    );
            }
            if (includes.Length > 5)
            {
                descriptionContent.AppendLine("* ...");
            }

            content.Add(
                descriptionContent.ToString()
                );

            string helpLink = MSBuildSchemaHelp.HelpLinkForItem(unusedItemGroup.Name);

            if (!String.IsNullOrWhiteSpace(helpLink))
            {
                content.Add(
                    $"[Help]({helpLink})"
                    );
            }

            return(new MarkedStringContainer(content));
        }
        /// <summary>
        ///     Get hover content for metadata of an <see cref="MSBuildItemGroup"/>.
        /// </summary>
        /// <param name="itemGroup">
        ///     The <see cref="MSBuildItemGroup"/>.
        /// </param>
        /// <param name="metadataName">
        ///     The metadata name.
        /// </param>
        /// <returns>
        ///     The content, or <c>null</c> if no content is provided.
        /// </returns>
        public MarkedStringContainer ItemGroupMetadata(MSBuildItemGroup itemGroup, string metadataName)
        {
            if (itemGroup == null)
            {
                throw new ArgumentNullException(nameof(itemGroup));
            }

            if (String.IsNullOrWhiteSpace(metadataName))
            {
                throw new ArgumentException("Argument cannot be null, empty, or entirely composed of whitespace: 'metadataName'.", nameof(metadataName));
            }

            if (itemGroup.Name == "PackageReference")
            {
                return(ItemGroup(itemGroup));
            }

            if (metadataName == "Condition")
            {
                return(Condition(itemGroup.Name, itemGroup.FirstItem.Xml.Condition));
            }

            if (metadataName == "Include")
            {
                metadataName = "Identity";
            }

            List <MarkedString> content = new List <MarkedString>
            {
                $"Item Metadata: `{itemGroup.Name}.{metadataName}`"
            };

            string metadataHelp = MSBuildSchemaHelp.ForItemMetadata(itemGroup.Name, metadataName);

            if (metadataHelp != null)
            {
                content.Add(metadataHelp);
            }

            string[] metadataValues =
                itemGroup.GetMetadataValues(metadataName).Where(
                    value => !String.IsNullOrWhiteSpace(value)
                    )
                .Distinct()
                .ToArray();

            StringBuilder metadataContent = new StringBuilder();

            if (metadataValues.Length > 0)
            {
                metadataContent.AppendLine("Values:");
                foreach (string metadataValue in metadataValues)
                {
                    metadataContent.AppendLine(
                        $"* `{metadataValue}`"
                        );
                }
            }
            else
            {
                metadataContent.AppendLine("No values are present for this metadata.");
            }

            content.Add(
                metadataContent.ToString()
                );

            string helpLink = MSBuildSchemaHelp.HelpLinkForItem(itemGroup.Name);

            if (!String.IsNullOrWhiteSpace(helpLink))
            {
                content.Add(
                    $"[Help]({helpLink})"
                    );
            }

            return(new MarkedStringContainer(content));
        }
        /// <summary>
        ///     Get hover content for an <see cref="MSBuildItemGroup"/>.
        /// </summary>
        /// <param name="itemGroup">
        ///     The <see cref="MSBuildItemGroup"/>.
        /// </param>
        /// <returns>
        ///     The content, or <c>null</c> if no content is provided.
        /// </returns>
        public MarkedStringContainer ItemGroup(MSBuildItemGroup itemGroup)
        {
            if (itemGroup == null)
            {
                throw new ArgumentNullException(nameof(itemGroup));
            }

            if (itemGroup.Name == "PackageReference")
            {
                string packageVersion = itemGroup.GetFirstMetadataValue("Version");

                // TODO: Verify package is from NuGet (later, we can also recognise MyGet)

                return(new MarkedStringContainer(
                           $"NuGet Package: [{itemGroup.FirstInclude}](https://nuget.org/packages/{itemGroup.FirstInclude}/{packageVersion})",
                           $"Version: {packageVersion}"
                           ));
            }

            List <MarkedString> content = new List <MarkedString>
            {
                $"Item Group: `{itemGroup.OriginatingElement.ItemType}`"
            };

            string itemTypeHelp = MSBuildSchemaHelp.ForItemType(itemGroup.Name);

            if (itemTypeHelp != null)
            {
                content.Add(itemTypeHelp);
            }

            string[]      includes           = itemGroup.Includes.ToArray();
            StringBuilder itemIncludeContent = new StringBuilder();

            itemIncludeContent.AppendLine(
                $"Include: `{itemGroup.OriginatingElement.Include}`  "
                );
            itemIncludeContent.AppendLine();
            itemIncludeContent.Append(
                $"Evaluates to {itemGroup.Items.Count} item"
                );
            if (!itemGroup.HasSingleItem)
            {
                itemIncludeContent.Append("s");
            }
            itemIncludeContent.AppendLine(".");

            foreach (string include in includes.Take(5))
            {
                // TODO: Consider making hyperlinks for includes that map to files which exist.
                itemIncludeContent.AppendLine(
                    $"* `{include}`"
                    );
            }
            if (includes.Length > 5)
            {
                itemIncludeContent.AppendLine("* ...");
            }

            content.Add(
                itemIncludeContent.ToString()
                );

            string helpLink = MSBuildSchemaHelp.HelpLinkForItem(itemGroup.Name);

            if (!String.IsNullOrWhiteSpace(helpLink))
            {
                content.Add(
                    $"[Help]({helpLink})"
                    );
            }

            return(new MarkedStringContainer(content));
        }