/// <summary>
        ///     Publish current diagnostics (if any) for the specified project document.
        /// </summary>
        /// <param name="projectDocument">
        ///     The project document.
        /// </param>
        public void PublishDiagnostics(ProjectDocument projectDocument)
        {
            if (projectDocument == null)
            {
                throw new ArgumentNullException(nameof(projectDocument));
            }

            DiagnosticsPublisher.Publish(
                documentUri: projectDocument.DocumentUri,
                diagnostics: projectDocument.Diagnostics.ToArray()
                );
        }
        /// <summary>
        ///     Clear current diagnostics (if any) for the specified project document.
        /// </summary>
        /// <param name="projectDocument">
        ///     The project document.
        /// </param>
        public void ClearDiagnostics(ProjectDocument projectDocument)
        {
            if (projectDocument == null)
            {
                throw new ArgumentNullException(nameof(projectDocument));
            }

            if (!projectDocument.HasDiagnostics)
            {
                return;
            }

            DiagnosticsPublisher.Publish(
                documentUri: projectDocument.DocumentUri,
                diagnostics: null // Overwrites existing diagnostics for this document with an empty list
                );
        }