示例#1
0
        private static DiagnosticMessage GetDiagnosticMessage(Diagnostic diagnostic, FrameworkName targetFramework)
        {
            var mappedLineSpan = diagnostic.Location.GetMappedLineSpan();

            return(new DiagnosticMessage(
                       diagnostic.GetMessage(),
                       RoslynDiagnosticFormatter.Format(diagnostic, targetFramework),
                       mappedLineSpan.Path,
                       mappedLineSpan.StartLinePosition.Line + 1,
                       mappedLineSpan.StartLinePosition.Character + 1,
                       mappedLineSpan.EndLinePosition.Line + 1,
                       mappedLineSpan.EndLinePosition.Character + 1));
        }
示例#2
0
        public static DiagnosticMessage ToDiagnosticMessage(this Diagnostic self, FrameworkName targetFramework)
        {
            var mappedLineSpan = self.Location.GetMappedLineSpan();

            return(new DiagnosticMessage(
                       self.GetMessage(),
                       RoslynDiagnosticFormatter.Format(self, targetFramework),
                       mappedLineSpan.Path,
                       ConvertSeverity(self.Severity),
                       mappedLineSpan.StartLinePosition.Line + 1,
                       mappedLineSpan.StartLinePosition.Character + 1,
                       mappedLineSpan.EndLinePosition.Line + 1,
                       mappedLineSpan.EndLinePosition.Character + 1));
        }