22// The .NET Foundation licenses this file to you under the MIT license.
33// See the LICENSE file in the project root for more information.
44
5+ #nullable enable
6+
57using System . Collections . Immutable ;
68using System . Diagnostics ;
79using System . Linq ;
810using Microsoft . CodeAnalysis . Diagnostics ;
911using Microsoft . CodeAnalysis . Options ;
12+ using Roslyn . Utilities ;
1013
1114#if CODE_STYLE
1215using OptionSet = Microsoft . CodeAnalysis . Diagnostics . AnalyzerConfigOptions ;
@@ -22,20 +25,20 @@ internal abstract class AbstractBuiltInCodeStyleDiagnosticAnalyzer : AbstractCod
2225 /// </summary>
2326 /// <param name="diagnosticId">Diagnostic ID reported by this analyzer</param>
2427 /// <param name="option">
25- /// Per-language option that can be used to configure the given diagnosticId.
26- /// Null , if there is no such unique option.
28+ /// Per-language option that can be used to configure the given <paramref name=" diagnosticId"/> .
29+ /// <see langword="null"/> , if there is no such unique option.
2730 /// </param>
2831 /// <param name="title">Title for the diagnostic descriptor</param>
2932 /// <param name="messageFormat">
3033 /// Message for the diagnostic descriptor.
31- /// Null if the message is identical to the title.
34+ /// <see langword="null"/> if the message is identical to the title.
3235 /// </param>
3336 /// <param name="configurable">Flag indicating if the reported diagnostics are configurable by the end users</param>
3437 protected AbstractBuiltInCodeStyleDiagnosticAnalyzer (
3538 string diagnosticId ,
36- IPerLanguageOption option ,
39+ IPerLanguageOption ? option ,
3740 LocalizableString title ,
38- LocalizableString messageFormat = null ,
41+ LocalizableString ? messageFormat = null ,
3942 bool configurable = true )
4043 : base ( diagnosticId , title , messageFormat , configurable )
4144 {
@@ -48,22 +51,22 @@ protected AbstractBuiltInCodeStyleDiagnosticAnalyzer(
4851 /// </summary>
4952 /// <param name="diagnosticId">Diagnostic ID reported by this analyzer</param>
5053 /// <param name="option">
51- /// Language specific option that can be used to configure the given diagnosticId.
52- /// Null , if there is no such unique option.
54+ /// Language specific option that can be used to configure the given <paramref name=" diagnosticId"/> .
55+ /// <see langword="null"/> , if there is no such unique option.
5356 /// </param>
5457 /// <param name="language">Language for the given language-specific <paramref name="option"/>.</param>
5558 /// <param name="title">Title for the diagnostic descriptor</param>
5659 /// <param name="messageFormat">
5760 /// Message for the diagnostic descriptor.
58- /// Null if the message is identical to the title.
61+ /// <see langword="null"/> if the message is identical to the title.
5962 /// </param>
6063 /// <param name="configurable">Flag indicating if the reported diagnostics are configurable by the end users</param>
6164 protected AbstractBuiltInCodeStyleDiagnosticAnalyzer (
6265 string diagnosticId ,
63- ILanguageSpecificOption option ,
66+ ILanguageSpecificOption ? option ,
6467 string language ,
6568 LocalizableString title ,
66- LocalizableString messageFormat = null ,
69+ LocalizableString ? messageFormat = null ,
6770 bool configurable = true )
6871 : base ( diagnosticId , title , messageFormat , configurable )
6972 {
@@ -88,11 +91,11 @@ protected AbstractBuiltInCodeStyleDiagnosticAnalyzer(
8891 string diagnosticId ,
8992 ImmutableHashSet < IPerLanguageOption > options ,
9093 LocalizableString title ,
91- LocalizableString messageFormat = null ,
94+ LocalizableString ? messageFormat = null ,
9295 bool configurable = true )
9396 : base ( diagnosticId , title , messageFormat , configurable )
9497 {
95- Debug . Assert ( options != null ) ;
98+ RoslynDebug . Assert ( options != null ) ;
9699 Debug . Assert ( options . Count > 1 ) ;
97100 AddDiagnosticIdToOptionMapping ( diagnosticId , options ) ;
98101 }
@@ -117,11 +120,11 @@ protected AbstractBuiltInCodeStyleDiagnosticAnalyzer(
117120 ImmutableHashSet < ILanguageSpecificOption > options ,
118121 string language ,
119122 LocalizableString title ,
120- LocalizableString messageFormat = null ,
123+ LocalizableString ? messageFormat = null ,
121124 bool configurable = true )
122125 : base ( diagnosticId , title , messageFormat , configurable )
123126 {
124- Debug . Assert ( options != null ) ;
127+ RoslynDebug . Assert ( options != null ) ;
125128 Debug . Assert ( options . Count > 1 ) ;
126129 AddDiagnosticIdToOptionMapping ( diagnosticId , options , language ) ;
127130 }
@@ -180,15 +183,15 @@ protected AbstractBuiltInCodeStyleDiagnosticAnalyzer(ImmutableArray<DiagnosticDe
180183 {
181184 }
182185
183- private static void AddDiagnosticIdToOptionMapping ( string diagnosticId , IPerLanguageOption option )
186+ private static void AddDiagnosticIdToOptionMapping ( string diagnosticId , IPerLanguageOption ? option )
184187 {
185188 if ( option != null )
186189 {
187190 AddDiagnosticIdToOptionMapping ( diagnosticId , ImmutableHashSet . Create ( option ) ) ;
188191 }
189192 }
190193
191- private static void AddDiagnosticIdToOptionMapping ( string diagnosticId , ILanguageSpecificOption option , string language )
194+ private static void AddDiagnosticIdToOptionMapping ( string diagnosticId , ILanguageSpecificOption ? option , string language )
192195 {
193196 if ( option != null )
194197 {
0 commit comments