Skip to content

Commit 5682281

Browse files
author
Christian Käser
committed
Use DocumentationResources for SA1643 in SA1642SA1643CodeFixProvider
1 parent 23dbd9e commit 5682281

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/DocumentationRules/SA1642SA1643CodeFixProvider.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ namespace StyleCop.Analyzers.DocumentationRules
66
using System;
77
using System.Collections.Immutable;
88
using System.Composition;
9+
using System.Globalization;
910
using System.Linq;
1011
using System.Text.RegularExpressions;
12+
using System.Threading;
1113
using System.Threading.Tasks;
1214
using Helpers;
1315
using Microsoft.CodeAnalysis;
@@ -79,6 +81,9 @@ private static Task<Document> GetTransformedDocumentAsync(Document document, Syn
7981
var typeDeclaration = node.FirstAncestorOrSelf<BaseTypeDeclarationSyntax>();
8082
var declarationSyntax = node.FirstAncestorOrSelf<BaseMethodDeclarationSyntax>();
8183
bool isStruct = typeDeclaration.IsKind(SyntaxKind.StructDeclaration);
84+
var settings = document.Project.AnalyzerOptions.GetStyleCopSettings(CancellationToken.None);
85+
var culture = new CultureInfo(settings.DocumentationRules.DocumentationCulture);
86+
var resourceManager = DocumentationResources.ResourceManager;
8287

8388
TypeParameterListSyntax typeParameterList;
8489
ClassDeclarationSyntax classDeclaration = typeDeclaration as ClassDeclarationSyntax;
@@ -122,7 +127,10 @@ private static Task<Document> GetTransformedDocumentAsync(Document document, Syn
122127
}
123128
else if (declarationSyntax is DestructorDeclarationSyntax)
124129
{
125-
standardText = SA1643DestructorSummaryDocumentationMustBeginWithStandardText.DestructorStandardText;
130+
standardText =
131+
ImmutableArray.Create(
132+
resourceManager.GetString("DestructorStandardTextFirstPart", culture),
133+
resourceManager.GetString("DestructorStandardTextSecondPart", culture));
126134
}
127135
else
128136
{

0 commit comments

Comments
 (0)