@@ -28,15 +28,15 @@ ConcurrentDictionary<string, Diagnostic> Diagnostics
2828 /// <param name="sponsorable">The names of the sponsorable accounts that can be funded for the given product.</param>
2929 /// <param name="product">The product or project developed by the sponsorable(s).</param>
3030 /// <param name="prefix">Custom prefix to use for diagnostic IDs.</param>
31- /// <param name="kind ">The kind of diagnostic to create.</param>
31+ /// <param name="status ">The kind of status diagnostic to create.</param>
3232 /// <returns>The given <see cref="DiagnosticDescriptor"/>.</returns>
33- /// <exception cref="NotImplementedException">The <paramref name="kind "/> is not one of the known ones.</exception>
34- public DiagnosticDescriptor GetDescriptor ( string [ ] sponsorable , string product , string prefix , DiagnosticKind kind ) => kind switch
33+ /// <exception cref="NotImplementedException">The <paramref name="status "/> is not one of the known ones.</exception>
34+ public DiagnosticDescriptor GetDescriptor ( string [ ] sponsorable , string product , string prefix , SponsorStatus status ) => status switch
3535 {
36- DiagnosticKind . Unknown => CreateUnknown ( sponsorable , product , prefix ) ,
37- DiagnosticKind . Sponsor => CreateSponsor ( sponsorable , prefix ) ,
38- DiagnosticKind . Expiring => CreateExpiring ( sponsorable , prefix ) ,
39- DiagnosticKind . Expired => CreateExpired ( sponsorable , prefix ) ,
36+ SponsorStatus . Unknown => CreateUnknown ( sponsorable , product , prefix ) ,
37+ SponsorStatus . Sponsor => CreateSponsor ( sponsorable , prefix ) ,
38+ SponsorStatus . Expiring => CreateExpiring ( sponsorable , prefix ) ,
39+ SponsorStatus . Expired => CreateExpired ( sponsorable , prefix ) ,
4040 _ => throw new NotImplementedException ( ) ,
4141 } ;
4242
@@ -67,23 +67,23 @@ public Diagnostic Push(string product, Diagnostic diagnostic)
6767 /// Gets the status of the given product based on a previously stored diagnostic.
6868 /// </summary>
6969 /// <param name="product">The product to check status for.</param>
70- /// <returns>Optional <see cref="DiagnosticKind "/> that was reported, if any.</returns>
71- public DiagnosticKind ? GetStatus ( string product )
70+ /// <returns>Optional <see cref="SponsorStatus "/> that was reported, if any.</returns>
71+ public SponsorStatus ? GetStatus ( string product )
7272 {
7373 // NOTE: the SponsorLinkAnalyzer.SetStatus uses diagnostic properties to store the
7474 // kind of diagnostic as a simple string instead of the enum. We do this so that
7575 // multiple analyzers or versions even across multiple products, which all would
7676 // have their own enum, can still share the same diagnostic kind.
7777 if ( Diagnostics . TryGetValue ( product , out var diagnostic ) &&
78- diagnostic . Properties . TryGetValue ( nameof ( DiagnosticKind ) , out var value ) )
78+ diagnostic . Properties . TryGetValue ( nameof ( SponsorStatus ) , out var value ) )
7979 {
8080 // Switch on value matching DiagnosticKind names
8181 return value switch
8282 {
83- nameof ( DiagnosticKind . Unknown ) => DiagnosticKind . Unknown ,
84- nameof ( DiagnosticKind . Sponsor ) => DiagnosticKind . Sponsor ,
85- nameof ( DiagnosticKind . Expiring ) => DiagnosticKind . Expiring ,
86- nameof ( DiagnosticKind . Expired ) => DiagnosticKind . Expired ,
83+ nameof ( SponsorStatus . Unknown ) => SponsorStatus . Unknown ,
84+ nameof ( SponsorStatus . Sponsor ) => SponsorStatus . Sponsor ,
85+ nameof ( SponsorStatus . Expiring ) => SponsorStatus . Expiring ,
86+ nameof ( SponsorStatus . Expired ) => SponsorStatus . Expired ,
8787 _ => null ,
8888 } ;
8989 }
0 commit comments