/// <summary>
        /// Gets all the diagnostics for this event, respecting the callers setting on if they're getting it for pull
        /// diagnostics or push diagnostics.  Most clients should use this to ensure they see the proper set of
        /// diagnostics in their scenario (or an empty array if not in their scenario).
        /// </summary>
        public static ImmutableArray <DiagnosticData> GetPullDiagnostics(
            this DiagnosticsUpdatedArgs args, IGlobalOptionService globalOptions, Option2 <DiagnosticMode> diagnosticMode)
        {
            // If push diagnostics are on, they get nothing since they're asking for pull diagnostics.
            if (globalOptions.IsPushDiagnostics(diagnosticMode))
            {
                return(ImmutableArray <DiagnosticData> .Empty);
            }

            return(args.GetAllDiagnosticsRegardlessOfPushPullSetting());
        }
Пример #2
0
        /// <summary>
        /// Gets all the diagnostics for this event, respecting the callers setting on if they're getting it for pull
        /// diagnostics or push diagnostics.  Most clients should use this to ensure they see the proper set of
        /// diagnostics in their scenario (or an empty array if not in their scenario).
        /// </summary>
        public ImmutableArray <DiagnosticData> GetPullDiagnostics(
            IGlobalOptionService globalOptions, Option2 <DiagnosticMode> diagnosticMode)
        {
            // If push diagnostics are on, they get nothing since they're asking for pull diagnostics.
            if (globalOptions.IsPushDiagnostics(diagnosticMode))
            {
                return(ImmutableArray <DiagnosticData> .Empty);
            }

            return(_diagnostics);
        }