IDiagnosticService.cs 1.4 KB
Newer Older
1
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.
2 3 4 5

using System;
using System.Collections.Generic;
using System.Threading;
H
Heejae Chang 已提交
6
using Microsoft.CodeAnalysis.Common;
7 8 9

namespace Microsoft.CodeAnalysis.Diagnostics
{
10 11 12
    /// <summary>
    /// Aggregates events from various diagnostic sources.
    /// </summary>
13 14 15 16
    internal interface IDiagnosticService
    {
        /// <summary>
        /// Event to get notified as new diagnostics are discovered by IDiagnosticUpdateSource
17 18 19
        /// 
        /// Notifications for this event are serialized to preserve order.
        /// However, individual event notifications may occur on any thread.
20 21 22 23 24 25
        /// </summary>
        event EventHandler<DiagnosticsUpdatedArgs> DiagnosticsUpdated;

        /// <summary>
        /// Get current diagnostics stored in IDiagnosticUpdateSource
        /// </summary>
26
        IEnumerable<DiagnosticData> GetDiagnostics(Workspace workspace, ProjectId projectId, DocumentId documentId, object id, bool includeSuppressedDiagnostics, CancellationToken cancellationToken);
27 28

        /// <summary>
H
Heejae Chang 已提交
29
        /// Get current UpdatedEventArgs stored in IDiagnosticUpdateSource
30
        /// </summary>
H
Heejae Chang 已提交
31
        IEnumerable<UpdatedEventArgs> GetDiagnosticsUpdatedEventArgs(Workspace workspace, ProjectId projectId, DocumentId documentId, CancellationToken cancellationToken);
32
    }
S
Sam Harwell 已提交
33
}