示例#1
0
 public DiagnosticsUpdatedEventArgs(object tag, string filePath, DiagnosticsUpdatedKind kind, DiagnosticSourceKind source, ImmutableArray <Diagnostic> diagnostics, SyntaxHighlightDataList diagnosticHighlights = null)
 {
     Tag                  = tag;
     FilePath             = filePath;
     Kind                 = kind;
     Diagnostics          = diagnostics;
     DiagnosticHighlights = diagnosticHighlights;
     Source               = source;
 }
示例#2
0
 public Diagnostic(int offset, int length, string project, string file, int line, string message, string code, DiagnosticLevel level,
                   DiagnosticCategory category, DiagnosticSourceKind kind = DiagnosticSourceKind.Analysis)
 {
     StartOffset = offset;
     Length      = length;
     Project     = project;
     File        = file;
     Line        = line;
     Spelling    = message;
     Level       = level;
     Category    = category;
     Code        = code;
     Source      = kind;
 }
示例#3
0
        /// <inheritdoc/>
        public void Create(object tag, string filePath, DiagnosticSourceKind source, ImmutableArray <Diagnostic> diagnostics, SyntaxHighlightDataList diagnosticHighlights = null)
        {
            Dispatcher.UIThread.Post(() =>
            {
                foreach (var diagnostic in diagnostics)
                {
                    if (diagnostic.Level != DiagnosticLevel.Hidden)
                    {
                        Errors.InsertSorted(new ErrorViewModel(diagnostic, tag));
                    }
                }

                DiagnosticsUpdated?.Invoke(this, new DiagnosticsUpdatedEventArgs(tag, filePath, DiagnosticsUpdatedKind.DiagnosticsCreated, source, diagnostics, diagnosticHighlights));
            });
        }