Skip to content

Commit 04f8fc7

Browse files
committed
Merge pull request #488 from pdelvo/roslyn_1_0_0_rc
2 parents 45d1f1b + 0da3896 commit 04f8fc7

File tree

71 files changed

+227
-376
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+227
-376
lines changed

StyleCop.Analyzers/StyleCop.Analyzers.Test/Helpers/DiagnosticVerifier.Helper.cs

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,8 @@ protected static async Task<ImmutableArray<Diagnostic>> GetSortedDiagnosticsFrom
7070
foreach (var project in projects)
7171
{
7272
var compilation = await project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
73-
var driver = AnalyzerDriver.Create(compilation, ImmutableArray.Create(analyzer), null, out compilation, cancellationToken);
74-
var discarded = compilation.GetDiagnostics(cancellationToken);
75-
var diags = await driver.GetDiagnosticsAsync().ConfigureAwait(false);
73+
var compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create(analyzer), null, cancellationToken);
74+
var diags = await compilationWithAnalyzers.GetAnalyzerDiagnosticsAsync().ConfigureAwait(false);
7675
foreach (var diag in diags)
7776
{
7877
if (diag.Location == Location.None || diag.Location.IsInMetadata)
@@ -106,7 +105,7 @@ protected static async Task<ImmutableArray<Diagnostic>> GetSortedDiagnosticsFrom
106105
/// <see cref="Diagnostic.Location"/>.</returns>
107106
private static Diagnostic[] SortDistinctDiagnostics(IEnumerable<Diagnostic> diagnostics)
108107
{
109-
return diagnostics.OrderBy(d => d.Location.SourceSpan.Start).Distinct(default(DiagnosticEqualityComparer)).ToArray();
108+
return diagnostics.OrderBy(d => d.Location.SourceSpan.Start).ToArray();
110109
}
111110

112111
#endregion
@@ -170,7 +169,7 @@ private static Project CreateProject(string[] sources, string language = Languag
170169

171170
var projectId = ProjectId.CreateNewId(debugName: TestProjectName);
172171

173-
var solution = new CustomWorkspace()
172+
var solution = new AdhocWorkspace()
174173
.CurrentSolution
175174
.AddProject(projectId, TestProjectName, TestProjectName, language)
176175
.AddMetadataReference(projectId, CorlibReference)
@@ -190,42 +189,6 @@ private static Project CreateProject(string[] sources, string language = Languag
190189
return solution.GetProject(projectId);
191190
}
192191
#endregion
193-
194-
/// <summary>
195-
/// A little helper to be able to use Enumerable.Distinct. Currently Roslyn does have a bug so that Diagnostic.GetHashCode()
196-
/// is not implemented correctly. <see href="https://github.com/dotnet/roslyn/issues/57"/>.
197-
/// </summary>
198-
private struct DiagnosticEqualityComparer : IEqualityComparer<Diagnostic>
199-
{
200-
public bool Equals(Diagnostic x, Diagnostic y)
201-
{
202-
return (x == null && y == null)
203-
|| x.Equals(y);
204-
}
205-
206-
public int GetHashCode(Diagnostic obj)
207-
{
208-
return this.Combine(obj.Descriptor,
209-
this.Combine(obj.Location.GetHashCode(),
210-
this.Combine(obj.Severity.GetHashCode(), obj.WarningLevel)));
211-
}
212-
213-
private int Combine<T>(T newKeyPart, int currentKey) where T : class
214-
{
215-
int hash = unchecked(currentKey * (int)0xA5555529);
216-
217-
if (newKeyPart != null)
218-
{
219-
return unchecked(hash + newKeyPart.GetHashCode());
220-
}
221-
222-
return hash;
223-
}
224-
private int Combine(int newKey, int currentKey)
225-
{
226-
return unchecked((currentKey * (int)0xA5555529) + newKey);
227-
}
228-
}
229192
}
230193
}
231194

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
namespace StyleCop.Analyzers.Test.Helpers
2+
{
3+
/// <summary>
4+
/// Indicates that a specific test is related to an open issue.
5+
/// </summary>
6+
[System.AttributeUsage(System.AttributeTargets.All, Inherited = false, AllowMultiple = true)]
7+
public sealed class OpenIssueAttribute : System.Attribute
8+
{
9+
/// <summary>
10+
/// Initializes a new instance of the <see cref="OpenIssueAttribute"/> class.
11+
/// </summary>
12+
/// <param name="issue">A link to the open issue.</param>
13+
public OpenIssueAttribute(string issue)
14+
{
15+
this.Issue = issue;
16+
}
17+
18+
public string Issue { get; }
19+
}
20+
}

StyleCop.Analyzers/StyleCop.Analyzers.Test/MaintainabilityRules/SA1400UnitTests.cs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
{
33
using System.Threading;
44
using System.Threading.Tasks;
5+
using Analyzers.MaintainabilityRules;
6+
using Helpers;
57
using Microsoft.CodeAnalysis;
68
using Microsoft.CodeAnalysis.CodeFixes;
79
using Microsoft.CodeAnalysis.Diagnostics;
810
using Microsoft.VisualStudio.TestTools.UnitTesting;
9-
using StyleCop.Analyzers.MaintainabilityRules;
1011
using TestHelper;
1112

1213
[TestClass]
@@ -487,37 +488,37 @@ public async Task TestInterfacePropertyDeclarationWithDirectivesAsync()
487488

488489
#region EventFieldDeclarationSyntax
489490

490-
[TestMethod]
491+
[TestMethod, Ignore, OpenIssue("https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/496")]
491492
public async Task TestEventFieldDeclarationAsync()
492493
{
493494
await this.TestNestedDeclarationAsync("private", "MemberName", "event EventHandler MemberName", ", AnotherMemberName;");
494495
}
495496

496-
[TestMethod]
497+
[TestMethod, Ignore, OpenIssue("https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/496")]
497498
public async Task TestEventFieldDeclarationWithAttributesAsync()
498499
{
499500
await this.TestNestedDeclarationWithAttributesAsync("private", "MemberName", "event EventHandler MemberName", ", AnotherMemberName;");
500501
}
501502

502-
[TestMethod]
503+
[TestMethod, Ignore, OpenIssue("https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/496")]
503504
public async Task TestEventFieldDeclarationWithDirectivesAsync()
504505
{
505506
await this.TestNestedDeclarationWithDirectivesAsync("private", "MemberName", "event EventHandler MemberName", ", AnotherMemberName;");
506507
}
507508

508-
[TestMethod]
509+
[TestMethod, Ignore, OpenIssue("https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/496")]
509510
public async Task TestStaticEventFieldDeclarationAsync()
510511
{
511512
await this.TestNestedDeclarationAsync("private", "MemberName", "static event EventHandler MemberName", ", AnotherMemberName;");
512513
}
513514

514-
[TestMethod]
515+
[TestMethod, Ignore, OpenIssue("https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/496")]
515516
public async Task TestStaticEventFieldDeclarationWithAttributesAsync()
516517
{
517518
await this.TestNestedDeclarationWithAttributesAsync("private", "MemberName", "static event EventHandler MemberName", ", AnotherMemberName;");
518519
}
519520

520-
[TestMethod]
521+
[TestMethod, Ignore, OpenIssue("https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/496")]
521522
public async Task TestStaticEventFieldDeclarationWithDirectivesAsync()
522523
{
523524
await this.TestNestedDeclarationWithDirectivesAsync("private", "MemberName", "static event EventHandler MemberName", ", AnotherMemberName;");
@@ -545,37 +546,37 @@ public async Task TestInterfaceEventFieldDeclarationWithDirectivesAsync()
545546

546547
#region FieldDeclarationSyntax
547548

548-
[TestMethod]
549+
[TestMethod, Ignore, OpenIssue("https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/496")]
549550
public async Task TestFieldDeclarationAsync()
550551
{
551552
await this.TestNestedDeclarationAsync("private", "MemberName", "System.EventHandler MemberName", ", AnotherMemberName;");
552553
}
553554

554-
[TestMethod]
555+
[TestMethod, Ignore, OpenIssue("https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/496")]
555556
public async Task TestFieldDeclarationWithAttributesAsync()
556557
{
557558
await this.TestNestedDeclarationWithAttributesAsync("private", "MemberName", "System.EventHandler MemberName", ", AnotherMemberName;");
558559
}
559560

560-
[TestMethod]
561+
[TestMethod, Ignore, OpenIssue("https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/496")]
561562
public async Task TestFieldDeclarationWithDirectivesAsync()
562563
{
563564
await this.TestNestedDeclarationWithDirectivesAsync("private", "MemberName", "System.EventHandler MemberName", ", AnotherMemberName;");
564565
}
565566

566-
[TestMethod]
567+
[TestMethod, Ignore, OpenIssue("https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/496")]
567568
public async Task TestStaticFieldDeclarationAsync()
568569
{
569570
await this.TestNestedDeclarationAsync("private", "MemberName", "static System.EventHandler MemberName", ", AnotherMemberName;");
570571
}
571572

572-
[TestMethod]
573+
[TestMethod, Ignore, OpenIssue("https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/496")]
573574
public async Task TestStaticFieldDeclarationWithAttributesAsync()
574575
{
575576
await this.TestNestedDeclarationWithAttributesAsync("private", "MemberName", "static System.EventHandler MemberName", ", AnotherMemberName;");
576577
}
577578

578-
[TestMethod]
579+
[TestMethod, Ignore, OpenIssue("https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/496")]
579580
public async Task TestStaticFieldDeclarationWithDirectivesAsync()
580581
{
581582
await this.TestNestedDeclarationWithDirectivesAsync("private", "MemberName", "static System.EventHandler MemberName", ", AnotherMemberName;");

StyleCop.Analyzers/StyleCop.Analyzers.Test/StyleCop.Analyzers.Test.csproj

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,40 +43,40 @@
4343
<ItemGroup>
4444
<Reference Include="Microsoft.CodeAnalysis, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
4545
<SpecificVersion>False</SpecificVersion>
46-
<HintPath>..\..\packages\Microsoft.CodeAnalysis.Common.1.0.0.0-beta2\lib\net45\Microsoft.CodeAnalysis.dll</HintPath>
46+
<HintPath>..\..\packages\Microsoft.CodeAnalysis.Common.1.0.0-rc1\lib\net45\Microsoft.CodeAnalysis.dll</HintPath>
4747
</Reference>
4848
<Reference Include="Microsoft.CodeAnalysis.CSharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
4949
<SpecificVersion>False</SpecificVersion>
50-
<HintPath>..\..\packages\Microsoft.CodeAnalysis.CSharp.1.0.0.0-beta2\lib\net45\Microsoft.CodeAnalysis.CSharp.dll</HintPath>
50+
<HintPath>..\..\packages\Microsoft.CodeAnalysis.CSharp.1.0.0-rc1\lib\net45\Microsoft.CodeAnalysis.CSharp.dll</HintPath>
5151
</Reference>
5252
<Reference Include="Microsoft.CodeAnalysis.CSharp.Desktop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
5353
<SpecificVersion>False</SpecificVersion>
54-
<HintPath>..\..\packages\Microsoft.CodeAnalysis.CSharp.1.0.0.0-beta2\lib\net45\Microsoft.CodeAnalysis.CSharp.Desktop.dll</HintPath>
54+
<HintPath>..\..\packages\Microsoft.CodeAnalysis.CSharp.1.0.0-rc1\lib\net45\Microsoft.CodeAnalysis.CSharp.Desktop.dll</HintPath>
5555
</Reference>
5656
<Reference Include="Microsoft.CodeAnalysis.CSharp.Workspaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
5757
<SpecificVersion>False</SpecificVersion>
58-
<HintPath>..\..\packages\Microsoft.CodeAnalysis.CSharp.Workspaces.1.0.0.0-beta2\lib\net45\Microsoft.CodeAnalysis.CSharp.Workspaces.dll</HintPath>
58+
<HintPath>..\..\packages\Microsoft.CodeAnalysis.CSharp.Workspaces.1.0.0-rc1\lib\net45\Microsoft.CodeAnalysis.CSharp.Workspaces.dll</HintPath>
5959
</Reference>
6060
<Reference Include="Microsoft.CodeAnalysis.CSharp.Workspaces.Desktop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6161
<SpecificVersion>False</SpecificVersion>
62-
<HintPath>..\..\packages\Microsoft.CodeAnalysis.CSharp.Workspaces.1.0.0.0-beta2\lib\net45\Microsoft.CodeAnalysis.CSharp.Workspaces.Desktop.dll</HintPath>
62+
<HintPath>..\..\packages\Microsoft.CodeAnalysis.CSharp.Workspaces.1.0.0-rc1\lib\net45\Microsoft.CodeAnalysis.CSharp.Workspaces.Desktop.dll</HintPath>
6363
</Reference>
6464
<Reference Include="Microsoft.CodeAnalysis.Desktop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6565
<SpecificVersion>False</SpecificVersion>
66-
<HintPath>..\..\packages\Microsoft.CodeAnalysis.Common.1.0.0.0-beta2\lib\net45\Microsoft.CodeAnalysis.Desktop.dll</HintPath>
66+
<HintPath>..\..\packages\Microsoft.CodeAnalysis.Common.1.0.0-rc1\lib\net45\Microsoft.CodeAnalysis.Desktop.dll</HintPath>
6767
</Reference>
6868
<Reference Include="Microsoft.CodeAnalysis.Workspaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6969
<SpecificVersion>False</SpecificVersion>
70-
<HintPath>..\..\packages\Microsoft.CodeAnalysis.Workspaces.Common.1.0.0.0-beta2\lib\net45\Microsoft.CodeAnalysis.Workspaces.dll</HintPath>
70+
<HintPath>..\..\packages\Microsoft.CodeAnalysis.Workspaces.Common.1.0.0-rc1\lib\net45\Microsoft.CodeAnalysis.Workspaces.dll</HintPath>
7171
</Reference>
7272
<Reference Include="Microsoft.CodeAnalysis.Workspaces.Desktop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7373
<SpecificVersion>False</SpecificVersion>
74-
<HintPath>..\..\packages\Microsoft.CodeAnalysis.Workspaces.Common.1.0.0.0-beta2\lib\net45\Microsoft.CodeAnalysis.Workspaces.Desktop.dll</HintPath>
74+
<HintPath>..\..\packages\Microsoft.CodeAnalysis.Workspaces.Common.1.0.0-rc1\lib\net45\Microsoft.CodeAnalysis.Workspaces.Desktop.dll</HintPath>
7575
</Reference>
7676
<Reference Include="System" />
77-
<Reference Include="System.Collections.Immutable, Version=1.1.32.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
78-
<Private>True</Private>
79-
<HintPath>..\..\packages\System.Collections.Immutable.1.1.32-beta\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath>
77+
<Reference Include="System.Collections.Immutable, Version=1.1.33.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
78+
<SpecificVersion>False</SpecificVersion>
79+
<HintPath>..\..\packages\System.Collections.Immutable.1.1.33-beta\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath>
8080
</Reference>
8181
<Reference Include="System.Composition.AttributedModel">
8282
<HintPath>..\..\packages\Microsoft.Composition.1.0.27\lib\portable-net45+win8+wp8+wpa81\System.Composition.AttributedModel.dll</HintPath>
@@ -94,8 +94,9 @@
9494
<HintPath>..\..\packages\Microsoft.Composition.1.0.27\lib\portable-net45+win8+wp8+wpa81\System.Composition.TypedParts.dll</HintPath>
9595
</Reference>
9696
<Reference Include="System.Core" />
97-
<Reference Include="System.Reflection.Metadata">
98-
<HintPath>..\..\packages\System.Reflection.Metadata.1.0.17-beta\lib\portable-net45+win8\System.Reflection.Metadata.dll</HintPath>
97+
<Reference Include="System.Reflection.Metadata, Version=1.0.18.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
98+
<SpecificVersion>False</SpecificVersion>
99+
<HintPath>..\..\packages\System.Reflection.Metadata.1.0.18-beta\lib\portable-net45+win8\System.Reflection.Metadata.dll</HintPath>
99100
</Reference>
100101
<Reference Include="System.Xml.Linq" />
101102
<Reference Include="System.Data.DataSetExtensions" />
@@ -119,6 +120,7 @@
119120
<Compile Include="Helpers\CodeFixVerifier.Helper.cs" />
120121
<Compile Include="Helpers\DiagnosticResult.cs" />
121122
<Compile Include="Helpers\DiagnosticVerifier.Helper.cs" />
123+
<Compile Include="Helpers\OpenIssueAttribute.cs" />
122124
<Compile Include="MaintainabilityRules\DebugMessagesUnitTestsBase.cs" />
123125
<Compile Include="MaintainabilityRules\FileMayOnlyContainTestBase.cs" />
124126
<Compile Include="MaintainabilityRules\SA1119UnitTests.cs" />
@@ -169,6 +171,8 @@
169171
</ProjectReference>
170172
</ItemGroup>
171173
<ItemGroup>
174+
<Analyzer Include="..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.0.0-rc1\tools\analyzers\C#\Microsoft.CodeAnalysis.CSharp.Analyzers.dll" />
175+
<Analyzer Include="..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.0.0-rc1\tools\analyzers\Microsoft.CodeAnalysis.Analyzers.dll" />
172176
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.0.0-alpha003\tools\analyzers\StyleCop.Analyzers.dll" />
173177
</ItemGroup>
174178
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

StyleCop.Analyzers/StyleCop.Analyzers.Test/Verifiers/CodeFixVerifier.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ private async Task VerifyFixAsync(string language, DiagnosticAnalyzer analyzer,
9393
{
9494
var actions = new List<CodeAction>();
9595
var context = new CodeFixContext(document, analyzerDiagnostics[0], (a, d) => actions.Add(a), cancellationToken);
96-
await codeFixProvider.ComputeFixesAsync(context).ConfigureAwait(false);
96+
await codeFixProvider.RegisterCodeFixesAsync(context).ConfigureAwait(false);
9797

9898
if (!actions.Any())
9999
{
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Microsoft.CodeAnalysis.Common" version="1.0.0.0-beta2" targetFramework="net45" />
4-
<package id="Microsoft.CodeAnalysis.CSharp" version="1.0.0.0-beta2" targetFramework="net45" />
5-
<package id="Microsoft.CodeAnalysis.CSharp.Workspaces" version="1.0.0.0-beta2" targetFramework="net45" />
6-
<package id="Microsoft.CodeAnalysis.Workspaces.Common" version="1.0.0.0-beta2" targetFramework="net45" />
3+
<package id="Microsoft.CodeAnalysis.Analyzers" version="1.0.0-rc1" targetFramework="net45" />
4+
<package id="Microsoft.CodeAnalysis.Common" version="1.0.0-rc1" targetFramework="net45" />
5+
<package id="Microsoft.CodeAnalysis.CSharp" version="1.0.0-rc1" targetFramework="net45" />
6+
<package id="Microsoft.CodeAnalysis.CSharp.Workspaces" version="1.0.0-rc1" targetFramework="net45" />
7+
<package id="Microsoft.CodeAnalysis.Workspaces.Common" version="1.0.0-rc1" targetFramework="net45" />
78
<package id="Microsoft.Composition" version="1.0.27" targetFramework="net45" />
89
<package id="StyleCop.Analyzers" version="1.0.0-alpha003" targetFramework="net45" />
9-
<package id="System.Collections.Immutable" version="1.1.32-beta" targetFramework="net45" />
10-
<package id="System.Reflection.Metadata" version="1.0.17-beta" targetFramework="net45" />
10+
<package id="System.Collections.Immutable" version="1.1.33-beta" targetFramework="net45" />
11+
<package id="System.Reflection.Metadata" version="1.0.18-beta" targetFramework="net45" />
1112
</packages>

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ public class SA1642SA1643CodeFixProvider : CodeFixProvider
2828
ImmutableArray.Create(SA1642ConstructorSummaryDocumentationMustBeginWithStandardText.DiagnosticId, SA1643DestructorSummaryDocumentationMustBeginWithStandardText.DiagnosticId);
2929

3030
/// <inheritdoc/>
31-
public override ImmutableArray<string> GetFixableDiagnosticIds()
32-
{
33-
return FixableDiagnostics;
34-
}
31+
public override ImmutableArray<string> FixableDiagnosticIds => FixableDiagnostics;
3532

3633
/// <inheritdoc/>
3734
public override FixAllProvider GetFixAllProvider()
@@ -40,7 +37,7 @@ public override FixAllProvider GetFixAllProvider()
4037
}
4138

4239
/// <inheritdoc/>
43-
public override async Task ComputeFixesAsync(CodeFixContext context)
40+
public override async Task RegisterCodeFixesAsync(CodeFixContext context)
4441
{
4542
foreach (var diagnostic in context.Diagnostics)
4643
{
@@ -89,7 +86,7 @@ public override async Task ComputeFixesAsync(CodeFixContext context)
8986
var newRoot = root.ReplaceNode(node, newNode);
9087

9188
var newDocument = context.Document.WithSyntaxRoot(newRoot);
92-
context.RegisterFix(CodeAction.Create("Add standard text.", newDocument), diagnostic);
89+
context.RegisterCodeFix(CodeAction.Create("Add standard text.", token => Task.FromResult(newDocument)), diagnostic);
9390
}
9491
}
9592

StyleCop.Analyzers/StyleCop.Analyzers/LayoutRules/SA1500CurlyBracketsForMultiLineStatementsMustNotShareLine.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
/// }
4848
/// </code>
4949
/// </remarks>
50+
[DiagnosticAnalyzer(LanguageNames.CSharp)]
5051
public class SA1500CurlyBracketsForMultiLineStatementsMustNotShareLine : DiagnosticAnalyzer
5152
{
5253
/// <summary>

0 commit comments

Comments
 (0)