From 48227e6b02a714cf0131007ed0de5913d9fa3af3 Mon Sep 17 00:00:00 2001 From: Sam Harwell Date: Thu, 6 Apr 2023 09:24:53 -0500 Subject: [PATCH] Update to Microsoft.CodeAnalysis.Analyzers 3.3.5-beta1.23205.2 --- NuGet.config | 1 + StyleCop.Analyzers/Directory.Build.props | 3 ++- .../GeneratorSyntaxExtensions.cs | 3 +-- .../OperationLightupGenerator.cs | 11 +++++----- .../SyntaxLightupGenerator.cs | 12 +++++----- .../XmlSyntaxFactory.cs | 15 +++++++++++++ ...StyleCop.Analyzers.Status.Generator.csproj | 1 + .../StyleCop.Analyzers.Test.CSharp10.csproj | 1 + .../StyleCop.Analyzers.Test.CSharp11.csproj | 1 + .../StyleCop.Analyzers.Test.CSharp7.csproj | 1 + .../StyleCop.Analyzers.Test.CSharp8.csproj | 1 + .../StyleCop.Analyzers.Test.CSharp9.csproj | 1 + .../StyleCop.Analyzers.Test.csproj | 1 + .../PartialElementDocumentationSummaryBase.cs | 8 +++---- .../Helpers/FileHeaderHelpers.cs | 22 +++++++++---------- .../Helpers/ObjectPools/ObjectPool`1.cs | 2 ++ .../SA0001XmlCommentAnalysisDisabled.cs | 2 +- .../SpecialRules/SA0002InvalidSettingsFile.cs | 9 ++------ .../StyleCopTester/StyleCopTester.csproj | 1 + 19 files changed, 57 insertions(+), 39 deletions(-) create mode 100644 StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/XmlSyntaxFactory.cs diff --git a/NuGet.config b/NuGet.config index 10f1a4c5d..e72a4de73 100644 --- a/NuGet.config +++ b/NuGet.config @@ -5,6 +5,7 @@ + diff --git a/StyleCop.Analyzers/Directory.Build.props b/StyleCop.Analyzers/Directory.Build.props index b6d1e5089..9e7184d13 100644 --- a/StyleCop.Analyzers/Directory.Build.props +++ b/StyleCop.Analyzers/Directory.Build.props @@ -13,6 +13,7 @@ 10 enable 99 + true @@ -47,7 +48,7 @@ - + diff --git a/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/GeneratorSyntaxExtensions.cs b/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/GeneratorSyntaxExtensions.cs index ad25f4aa3..58e151ec8 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/GeneratorSyntaxExtensions.cs +++ b/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/GeneratorSyntaxExtensions.cs @@ -3,7 +3,6 @@ namespace StyleCop.Analyzers.CodeGeneration { - using System; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; @@ -13,7 +12,7 @@ public static TSyntax WithLeadingBlankLine(this TSyntax syntax) where TSyntax : SyntaxNode { return syntax.WithLeadingTrivia(SyntaxFactory.TriviaList( - SyntaxFactory.PreprocessingMessage(Environment.NewLine))); + SyntaxFactory.PreprocessingMessage(XmlSyntaxFactory.CrLf))); } } } diff --git a/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/OperationLightupGenerator.cs b/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/OperationLightupGenerator.cs index f9aa8be29..091b5b68c 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/OperationLightupGenerator.cs +++ b/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/OperationLightupGenerator.cs @@ -16,7 +16,6 @@ namespace StyleCop.Analyzers.CodeGeneration using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; - using Microsoft.CodeAnalysis.Text; [Generator] internal sealed class OperationLightupGenerator : IIncrementalGenerator @@ -740,20 +739,20 @@ private void GenerateOperationWrapperHelper(in SourceProductionContext context, SyntaxFactory.Trivia(SyntaxFactory.DocumentationComment( SyntaxFactory.XmlText(" "), SyntaxFactory.XmlSummaryElement( - SyntaxFactory.XmlNewLine(Environment.NewLine), + SyntaxFactory.XmlText(XmlSyntaxFactory.XmlCarriageReturnLineFeedWithContinuation), SyntaxFactory.XmlText(" Gets the type that is wrapped by the given wrapper."), - SyntaxFactory.XmlNewLine(Environment.NewLine), + SyntaxFactory.XmlText(XmlSyntaxFactory.XmlCarriageReturnLineFeedWithContinuation), SyntaxFactory.XmlText(" ")), - SyntaxFactory.XmlNewLine(Environment.NewLine), + SyntaxFactory.XmlText(XmlSyntaxFactory.XmlCarriageReturnLineFeedWithContinuation), SyntaxFactory.XmlText(" "), SyntaxFactory.XmlParamElement( "wrapperType", SyntaxFactory.XmlText("Type of the wrapper for which the wrapped type should be retrieved.")), - SyntaxFactory.XmlNewLine(Environment.NewLine), + SyntaxFactory.XmlText(XmlSyntaxFactory.XmlCarriageReturnLineFeedWithContinuation), SyntaxFactory.XmlText(" "), SyntaxFactory.XmlReturnsElement( SyntaxFactory.XmlText("The wrapped type, or null if there is no info.")), - SyntaxFactory.XmlNewLine(Environment.NewLine).WithoutTrailingTrivia())))); + SyntaxFactory.XmlText(XmlSyntaxFactory.XmlCarriageReturnLineFeedWithContinuation).WithoutTrailingTrivia())))); var wrapperHelperClass = SyntaxFactory.ClassDeclaration( attributeLists: default, diff --git a/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/SyntaxLightupGenerator.cs b/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/SyntaxLightupGenerator.cs index 78fb4566d..7c656a034 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/SyntaxLightupGenerator.cs +++ b/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/SyntaxLightupGenerator.cs @@ -4,7 +4,6 @@ namespace StyleCop.Analyzers.CodeGeneration { using System; - using System.Collections; using System.Collections.Generic; using System.Collections.Immutable; using System.Diagnostics; @@ -18,7 +17,6 @@ namespace StyleCop.Analyzers.CodeGeneration using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; - using Microsoft.CodeAnalysis.Text; [Generator] internal sealed class SyntaxLightupGenerator : IIncrementalGenerator @@ -1198,20 +1196,20 @@ private void GenerateSyntaxWrapperHelper(in SourceProductionContext context, Imm SyntaxFactory.Trivia(SyntaxFactory.DocumentationComment( SyntaxFactory.XmlText(" "), SyntaxFactory.XmlSummaryElement( - SyntaxFactory.XmlNewLine(Environment.NewLine), + SyntaxFactory.XmlText(XmlSyntaxFactory.XmlCarriageReturnLineFeedWithContinuation), SyntaxFactory.XmlText(" Gets the type that is wrapped by the given wrapper."), - SyntaxFactory.XmlNewLine(Environment.NewLine), + SyntaxFactory.XmlText(XmlSyntaxFactory.XmlCarriageReturnLineFeedWithContinuation), SyntaxFactory.XmlText(" ")), - SyntaxFactory.XmlNewLine(Environment.NewLine), + SyntaxFactory.XmlText(XmlSyntaxFactory.XmlCarriageReturnLineFeedWithContinuation), SyntaxFactory.XmlText(" "), SyntaxFactory.XmlParamElement( "wrapperType", SyntaxFactory.XmlText("Type of the wrapper for which the wrapped type should be retrieved.")), - SyntaxFactory.XmlNewLine(Environment.NewLine), + SyntaxFactory.XmlText(XmlSyntaxFactory.XmlCarriageReturnLineFeedWithContinuation), SyntaxFactory.XmlText(" "), SyntaxFactory.XmlReturnsElement( SyntaxFactory.XmlText("The wrapped type, or null if there is no info.")), - SyntaxFactory.XmlNewLine(Environment.NewLine).WithoutTrailingTrivia())))); + SyntaxFactory.XmlText(XmlSyntaxFactory.XmlCarriageReturnLineFeedWithContinuation).WithoutTrailingTrivia())))); var wrapperHelperClass = SyntaxFactory.ClassDeclaration( attributeLists: default, diff --git a/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/XmlSyntaxFactory.cs b/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/XmlSyntaxFactory.cs new file mode 100644 index 000000000..4dc254249 --- /dev/null +++ b/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/XmlSyntaxFactory.cs @@ -0,0 +1,15 @@ +// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +namespace StyleCop.Analyzers.CodeGeneration +{ + using Microsoft.CodeAnalysis; + using Microsoft.CodeAnalysis.CSharp; + + internal static class XmlSyntaxFactory + { + public const string CrLf = "\r\n"; + + public static SyntaxToken XmlCarriageReturnLineFeedWithContinuation { get; } = SyntaxFactory.XmlTextNewLine(CrLf, continueXmlDocumentationComment: true); + } +} diff --git a/StyleCop.Analyzers/StyleCop.Analyzers.Status.Generator/StyleCop.Analyzers.Status.Generator.csproj b/StyleCop.Analyzers/StyleCop.Analyzers.Status.Generator/StyleCop.Analyzers.Status.Generator.csproj index 54e701083..203ffd6b8 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers.Status.Generator/StyleCop.Analyzers.Status.Generator.csproj +++ b/StyleCop.Analyzers/StyleCop.Analyzers.Status.Generator/StyleCop.Analyzers.Status.Generator.csproj @@ -4,6 +4,7 @@ net472 Exe + false true diff --git a/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp10/StyleCop.Analyzers.Test.CSharp10.csproj b/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp10/StyleCop.Analyzers.Test.CSharp10.csproj index fef1d1b58..fdf190e99 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp10/StyleCop.Analyzers.Test.CSharp10.csproj +++ b/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp10/StyleCop.Analyzers.Test.CSharp10.csproj @@ -3,6 +3,7 @@ net472 + false true true diff --git a/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp11/StyleCop.Analyzers.Test.CSharp11.csproj b/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp11/StyleCop.Analyzers.Test.CSharp11.csproj index 7a51f08ac..481f53262 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp11/StyleCop.Analyzers.Test.CSharp11.csproj +++ b/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp11/StyleCop.Analyzers.Test.CSharp11.csproj @@ -3,6 +3,7 @@ net472 + false true true diff --git a/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp7/StyleCop.Analyzers.Test.CSharp7.csproj b/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp7/StyleCop.Analyzers.Test.CSharp7.csproj index d1a849d23..af6d8b98e 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp7/StyleCop.Analyzers.Test.CSharp7.csproj +++ b/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp7/StyleCop.Analyzers.Test.CSharp7.csproj @@ -3,6 +3,7 @@ net46 + false true true diff --git a/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp8/StyleCop.Analyzers.Test.CSharp8.csproj b/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp8/StyleCop.Analyzers.Test.CSharp8.csproj index 27ba0c96b..5cc860e80 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp8/StyleCop.Analyzers.Test.CSharp8.csproj +++ b/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp8/StyleCop.Analyzers.Test.CSharp8.csproj @@ -3,6 +3,7 @@ net472 + false true true diff --git a/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp9/StyleCop.Analyzers.Test.CSharp9.csproj b/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp9/StyleCop.Analyzers.Test.CSharp9.csproj index 4a860f855..c5dc6f6d6 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp9/StyleCop.Analyzers.Test.CSharp9.csproj +++ b/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp9/StyleCop.Analyzers.Test.CSharp9.csproj @@ -3,6 +3,7 @@ net472 + false true true diff --git a/StyleCop.Analyzers/StyleCop.Analyzers.Test/StyleCop.Analyzers.Test.csproj b/StyleCop.Analyzers/StyleCop.Analyzers.Test/StyleCop.Analyzers.Test.csproj index 8e11e2636..470058aef 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers.Test/StyleCop.Analyzers.Test.csproj +++ b/StyleCop.Analyzers/StyleCop.Analyzers.Test/StyleCop.Analyzers.Test.csproj @@ -3,6 +3,7 @@ net452 + false true true diff --git a/StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/PartialElementDocumentationSummaryBase.cs b/StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/PartialElementDocumentationSummaryBase.cs index 27f174efc..5968d85d6 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/PartialElementDocumentationSummaryBase.cs +++ b/StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/PartialElementDocumentationSummaryBase.cs @@ -167,7 +167,7 @@ private string ExpandDocumentation(Compilation compilation, DocumentationComment { var sb = new StringBuilder(); - sb.AppendLine(""); + sb.Append("\n"); foreach (XmlNodeSyntax xmlNode in documentCommentTrivia.Content) { @@ -177,11 +177,11 @@ private string ExpandDocumentation(Compilation compilation, DocumentationComment } else { - sb.AppendLine(xmlNode.ToString()); + sb.Append(xmlNode.ToString()).Append('\n'); } } - sb.AppendLine(""); + sb.Append("\n"); return sb.ToString(); } @@ -209,7 +209,7 @@ private void ExpandIncludeTag(Compilation compilation, StringBuilder sb, XmlNode foreach (var x in expandedInclude) { - sb.AppendLine(x.ToString()); + sb.Append(x.ToString()).Append('\n'); } } } diff --git a/StyleCop.Analyzers/StyleCop.Analyzers/Helpers/FileHeaderHelpers.cs b/StyleCop.Analyzers/StyleCop.Analyzers/Helpers/FileHeaderHelpers.cs index 8c6b96906..5296de96c 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers/Helpers/FileHeaderHelpers.cs +++ b/StyleCop.Analyzers/StyleCop.Analyzers/Helpers/FileHeaderHelpers.cs @@ -56,7 +56,7 @@ internal static FileHeader ParseFileHeader(SyntaxNode root) fileHeaderStart = Math.Min(trivia.FullSpan.Start, fileHeaderStart); fileHeaderEnd = trivia.FullSpan.End; - sb.AppendLine(commentString.Substring(2).Trim()); + sb.Append(commentString.Substring(2).Trim()).Append('\n'); break; case SyntaxKind.MultiLineCommentTrivia: // only process a MultiLineCommentTrivia if no SingleLineCommentTrivia have been processed @@ -79,7 +79,7 @@ internal static FileHeader ParseFileHeader(SyntaxNode root) foreach (var part in triviaStringParts) { var trimmedPart = part.TrimStart(' ', '*'); - sb.AppendLine(trimmedPart); + sb.Append(trimmedPart).Append('\n'); } fileHeaderStart = trivia.FullSpan.Start; @@ -106,9 +106,9 @@ internal static FileHeader ParseFileHeader(SyntaxNode root) if (sb.Length > 0) { - // remove the final newline - var eolLength = Environment.NewLine.Length; - sb.Remove(sb.Length - eolLength, eolLength); + // remove the final newline, which is always in '\n' form + const int EolLength = 1; + sb.Remove(sb.Length - EolLength, EolLength); } return new FileHeader(StringBuilderPool.ReturnAndFree(sb), fileHeaderStart, fileHeaderEnd); @@ -179,7 +179,7 @@ private static string ProcessSingleLineCommentsHeader(SyntaxTriviaList triviaLis fileHeaderEnd = int.MinValue; // wrap the XML from the file header in a single root element to make XML parsing work. - sb.AppendLine(""); + sb.Append("\n"); int i; for (i = startIndex; !done && (i < triviaList.Count); i++) @@ -206,7 +206,7 @@ private static string ProcessSingleLineCommentsHeader(SyntaxTriviaList triviaLis fileHeaderStart = Math.Min(trivia.FullSpan.Start, fileHeaderStart); fileHeaderEnd = trivia.FullSpan.End; - sb.AppendLine(commentString.Substring(2)); + sb.Append(commentString.Substring(2)).Append('\n'); break; case SyntaxKind.EndOfLineTrivia: @@ -220,7 +220,7 @@ private static string ProcessSingleLineCommentsHeader(SyntaxTriviaList triviaLis } } - sb.AppendLine(""); + sb.Append("\n"); return StringBuilderPool.ReturnAndFree(sb); } @@ -229,7 +229,7 @@ private static string ProcessMultiLineCommentsHeader(SyntaxTrivia multiLineComme var sb = StringBuilderPool.Allocate(); // wrap the XML from the file header in a single root element to make XML parsing work. - sb.AppendLine(""); + sb.Append("\n"); fileHeaderStart = multiLineComment.FullSpan.Start; fileHeaderEnd = multiLineComment.FullSpan.End; @@ -242,10 +242,10 @@ private static string ProcessMultiLineCommentsHeader(SyntaxTrivia multiLineComme foreach (var commentLine in commentLines) { - sb.AppendLine(commentLine.TrimStart(' ', '*')); + sb.Append(commentLine.TrimStart(' ', '*')).Append('\n'); } - sb.AppendLine(""); + sb.Append("\n"); return StringBuilderPool.ReturnAndFree(sb); } } diff --git a/StyleCop.Analyzers/StyleCop.Analyzers/Helpers/ObjectPools/ObjectPool`1.cs b/StyleCop.Analyzers/StyleCop.Analyzers/Helpers/ObjectPools/ObjectPool`1.cs index 9434b8b3f..54f373c0f 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers/Helpers/ObjectPools/ObjectPool`1.cs +++ b/StyleCop.Analyzers/StyleCop.Analyzers/Helpers/ObjectPools/ObjectPool`1.cs @@ -43,7 +43,9 @@ internal class ObjectPool private T firstItem; internal ObjectPool(Func factory) +#pragma warning disable RS1035 // Do not use APIs banned for analyzers (false positive: https://github.com/dotnet/roslyn-analyzers/issues/6571) : this(factory, Environment.ProcessorCount * 2) +#pragma warning restore RS1035 // Do not use APIs banned for analyzers { } diff --git a/StyleCop.Analyzers/StyleCop.Analyzers/SpecialRules/SA0001XmlCommentAnalysisDisabled.cs b/StyleCop.Analyzers/StyleCop.Analyzers/SpecialRules/SA0001XmlCommentAnalysisDisabled.cs index 600b352cd..7b94f9f65 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers/SpecialRules/SA0001XmlCommentAnalysisDisabled.cs +++ b/StyleCop.Analyzers/StyleCop.Analyzers/SpecialRules/SA0001XmlCommentAnalysisDisabled.cs @@ -29,7 +29,7 @@ internal class SA0001XmlCommentAnalysisDisabled : DiagnosticAnalyzer private static readonly LocalizableString Description = new LocalizableResourceString(nameof(SpecialResources.SA0001Description), SpecialResources.ResourceManager, typeof(SpecialResources)); private static readonly DiagnosticDescriptor Descriptor = - new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, AnalyzerCategory.SpecialRules, DiagnosticSeverity.Warning, AnalyzerConstants.EnabledByDefault, Description, HelpLink); + new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, AnalyzerCategory.SpecialRules, DiagnosticSeverity.Warning, AnalyzerConstants.EnabledByDefault, Description, HelpLink, customTags: new string[] { "CompilationEnd" }); private static readonly Action CompilationStartAction = HandleCompilationStart; diff --git a/StyleCop.Analyzers/StyleCop.Analyzers/SpecialRules/SA0002InvalidSettingsFile.cs b/StyleCop.Analyzers/StyleCop.Analyzers/SpecialRules/SA0002InvalidSettingsFile.cs index f030056cd..9604c4775 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers/SpecialRules/SA0002InvalidSettingsFile.cs +++ b/StyleCop.Analyzers/StyleCop.Analyzers/SpecialRules/SA0002InvalidSettingsFile.cs @@ -7,7 +7,6 @@ namespace StyleCop.Analyzers.SpecialRules { using System; using System.Collections.Immutable; - using System.Globalization; using System.Linq; using LightJson.Serialization; using Microsoft.CodeAnalysis; @@ -31,7 +30,7 @@ internal class SA0002InvalidSettingsFile : DiagnosticAnalyzer private static readonly DiagnosticDescriptor Descriptor = #pragma warning disable RS1033 // Define diagnostic description correctly (Description ends with formatted exception text) - new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, AnalyzerCategory.SpecialRules, DiagnosticSeverity.Warning, AnalyzerConstants.EnabledByDefault, Description, HelpLink); + new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, AnalyzerCategory.SpecialRules, DiagnosticSeverity.Warning, AnalyzerConstants.EnabledByDefault, Description, HelpLink, customTags: new[] { "CompilationEnd" }); #pragma warning restore RS1033 // Define diagnostic description correctly private static readonly Action CompilationAction = HandleCompilation; @@ -63,11 +62,7 @@ private static void HandleCompilation(CompilationAnalysisContext context) } catch (Exception ex) when (ex is JsonParseException || ex is InvalidSettingsException) { - string details = ex.Message; - string completeDescription = string.Format(Description.ToString(CultureInfo.CurrentCulture), details); - - var completeDescriptor = new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, AnalyzerCategory.SpecialRules, DiagnosticSeverity.Warning, AnalyzerConstants.EnabledByDefault, completeDescription, HelpLink); - context.ReportDiagnostic(Diagnostic.Create(completeDescriptor, Location.None)); + context.ReportDiagnostic(Diagnostic.Create(Descriptor, Location.None, ex.Message)); } } } diff --git a/StyleCop.Analyzers/StyleCopTester/StyleCopTester.csproj b/StyleCop.Analyzers/StyleCopTester/StyleCopTester.csproj index 663f60705..61672301a 100644 --- a/StyleCop.Analyzers/StyleCopTester/StyleCopTester.csproj +++ b/StyleCop.Analyzers/StyleCopTester/StyleCopTester.csproj @@ -4,6 +4,7 @@ Exe net46 + false true