Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/31/18 14:26:32 (6 years ago)
Author:
jkarder
Message:

#2520: added analyzer and fix for adapting storable ctor signature

Location:
misc/tools/PersistenceCodeFix
Files:
3 added
9 edited

Legend:

Unmodified
Added
Removed
  • misc/tools/PersistenceCodeFix/PersistenceCodeFix.sln

    r14933 r16475  
    11
    22Microsoft Visual Studio Solution File, Format Version 12.00
    3 # Visual Studio 14
    4 VisualStudioVersion = 14.0.25420.1
     3# Visual Studio 15
     4VisualStudioVersion = 15.0.28307.168
    55MinimumVisualStudioVersion = 10.0.40219.1
    66Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PersistenceCodeFix", "PersistenceCodeFix\PersistenceCodeFix\PersistenceCodeFix.csproj", "{5D74C4E0-52B2-4F01-B024-307EF52BAE35}"
  • misc/tools/PersistenceCodeFix/PersistenceCodeFix/PersistenceCodeFix/Analyzers/MissingStorableConstructor/MissingStorableConstructorAnalyzer.cs

    r16469 r16475  
    99    public const string DiagnosticId = "MissingStorableConstructor";
    1010
    11     private static readonly LocalizableString Title = new LocalizableResourceString(nameof(Resources.MissingStorableConstructorAnalyzerTitle), Resources.ResourceManager, typeof(Resources));
    12     private static readonly LocalizableString MessageFormat = new LocalizableResourceString(nameof(Resources.MissingStorableConstructorAnalyzerMessageFormat), Resources.ResourceManager, typeof(Resources));
    13     private static readonly LocalizableString Description = new LocalizableResourceString(nameof(Resources.MissingStorableConstructorAnalyzerDescription), Resources.ResourceManager, typeof(Resources));
     11    private static readonly LocalizableString Title = new LocalizableResourceString(
     12      nameof(Resources.MissingStorableConstructorAnalyzerTitle), Resources.ResourceManager, typeof(Resources));
     13
     14    private static readonly LocalizableString MessageFormat = new LocalizableResourceString(
     15      nameof(Resources.MissingStorableConstructorAnalyzerMessageFormat), Resources.ResourceManager, typeof(Resources));
     16
     17    private static readonly LocalizableString Description = new LocalizableResourceString(
     18      nameof(Resources.MissingStorableConstructorAnalyzerDescription), Resources.ResourceManager, typeof(Resources));
     19
    1420    private const string Category = nameof(DiagnosticCategory.Persistence);
    1521
    16     private static DiagnosticDescriptor Rule = new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, Category, DiagnosticSeverity.Warning, isEnabledByDefault: true, description: Description);
     22    private static readonly DiagnosticDescriptor Rule = new DiagnosticDescriptor(
     23      DiagnosticId, Title, MessageFormat, Category, DiagnosticSeverity.Warning, isEnabledByDefault: true, description: Description);
    1724
    1825    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get { return ImmutableArray.Create(Rule); } }
  • misc/tools/PersistenceCodeFix/PersistenceCodeFix/PersistenceCodeFix/Analyzers/MissingStorableType/MissingStorableTypeAnalyzer.cs

    r14985 r16475  
    99    public const string DiagnosticId = "MissingStorableType";
    1010
    11     private static readonly LocalizableString Title = new LocalizableResourceString(nameof(Resources.MissingStorableTypeAnalyzerTitle), Resources.ResourceManager, typeof(Resources));
    12     private static readonly LocalizableString MessageFormat = new LocalizableResourceString(nameof(Resources.MissingStorableTypeAnalyzerMessageFormat), Resources.ResourceManager, typeof(Resources));
    13     private static readonly LocalizableString Description = new LocalizableResourceString(nameof(Resources.MissingStorableTypeAnalyzerDescription), Resources.ResourceManager, typeof(Resources));
     11    private static readonly LocalizableString Title = new LocalizableResourceString(
     12      nameof(Resources.MissingStorableTypeAnalyzerTitle), Resources.ResourceManager, typeof(Resources));
     13
     14    private static readonly LocalizableString MessageFormat = new LocalizableResourceString(
     15      nameof(Resources.MissingStorableTypeAnalyzerMessageFormat), Resources.ResourceManager, typeof(Resources));
     16
     17    private static readonly LocalizableString Description = new LocalizableResourceString(
     18      nameof(Resources.MissingStorableTypeAnalyzerDescription), Resources.ResourceManager, typeof(Resources));
     19
    1420    private const string Category = nameof(DiagnosticCategory.Persistence);
    1521
    16     private static DiagnosticDescriptor Rule = new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, Category, DiagnosticSeverity.Info, isEnabledByDefault: true, description: Description);
     22    private static readonly DiagnosticDescriptor Rule = new DiagnosticDescriptor(
     23      DiagnosticId, Title, MessageFormat, Category, DiagnosticSeverity.Info, isEnabledByDefault: true, description: Description);
    1724
    1825    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get { return ImmutableArray.Create(Rule); } }
  • misc/tools/PersistenceCodeFix/PersistenceCodeFix/PersistenceCodeFix/Analyzers/MissingStorableType/MissingStorableTypeFix.cs

    r16469 r16475  
    4949        SyntaxFactory.LiteralExpression(
    5050          SyntaxKind.StringLiteralExpression,
    51           SyntaxFactory.Literal(guid.ToString())
     51          SyntaxFactory.Literal(guid.ToString().ToUpperInvariant())
    5252        ));
    5353
  • misc/tools/PersistenceCodeFix/PersistenceCodeFix/PersistenceCodeFix/Analyzers/ObsoleteStorableClass/ObsoleteStorableClassAnalyzer.cs

    r14985 r16475  
    1010    public const string DiagnosticId = "ObsoleteStorableClass";
    1111
    12     private static readonly LocalizableString Title = new LocalizableResourceString(nameof(Resources.ObsoleteStorableClassAnalyzerTitle), Resources.ResourceManager, typeof(Resources));
    13     private static readonly LocalizableString MessageFormat = new LocalizableResourceString(nameof(Resources.ObsoleteStorableClassAnalyzerMessageFormat), Resources.ResourceManager, typeof(Resources));
    14     private static readonly LocalizableString Description = new LocalizableResourceString(nameof(Resources.ObsoleteStorableClassAnalyzerDescription), Resources.ResourceManager, typeof(Resources));
     12    private static readonly LocalizableString Title = new LocalizableResourceString(
     13      nameof(Resources.ObsoleteStorableClassAnalyzerTitle), Resources.ResourceManager, typeof(Resources));
     14
     15    private static readonly LocalizableString MessageFormat = new LocalizableResourceString(
     16      nameof(Resources.ObsoleteStorableClassAnalyzerMessageFormat), Resources.ResourceManager, typeof(Resources));
     17
     18    private static readonly LocalizableString Description = new LocalizableResourceString(
     19      nameof(Resources.ObsoleteStorableClassAnalyzerDescription), Resources.ResourceManager, typeof(Resources));
     20
    1521    private const string Category = nameof(DiagnosticCategory.Persistence);
    1622
    17     private static DiagnosticDescriptor Rule = new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, Category, DiagnosticSeverity.Warning, isEnabledByDefault: true, description: Description);
     23    private static readonly DiagnosticDescriptor Rule = new DiagnosticDescriptor(
     24      DiagnosticId, Title, MessageFormat, Category, DiagnosticSeverity.Warning, isEnabledByDefault: true, description: Description);
    1825
    1926    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get { return ImmutableArray.Create(Rule); } }
  • misc/tools/PersistenceCodeFix/PersistenceCodeFix/PersistenceCodeFix/Analyzers/ObsoleteStorableClass/ObsoleteStorableClassFix.cs

    r16469 r16475  
    5252        SyntaxFactory.LiteralExpression(
    5353          SyntaxKind.StringLiteralExpression,
    54           SyntaxFactory.Literal(guid.ToString())
     54          SyntaxFactory.Literal(guid.ToString().ToUpperInvariant())
    5555        ));
    5656
  • misc/tools/PersistenceCodeFix/PersistenceCodeFix/PersistenceCodeFix/PersistenceCodeFix.csproj

    r14989 r16475  
    4242    <Compile Include="Analyzers\MissingStorableType\MissingStorableTypeAnalyzer.cs" />
    4343    <Compile Include="Analyzers\MissingStorableType\MissingStorableTypeFix.cs" />
     44    <Compile Include="Analyzers\ObsoleteStorableConstructor\ObsoleteStorableConstructorAnalyzer.cs" />
     45    <Compile Include="Analyzers\ObsoleteStorableConstructor\ObsoleteStorableConstructorFix.cs" />
    4446    <Compile Include="IDocumentCodeFixProvider.cs" />
    4547    <Compile Include="Properties\AssemblyInfo.cs" />
  • misc/tools/PersistenceCodeFix/PersistenceCodeFix/PersistenceCodeFix/Resources.Designer.cs

    r14985 r16475  
    2121    // To add or remove a member, edit your .ResX file then rerun ResGen
    2222    // with the /str option, or rebuild your VS project.
    23     [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
     23    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
    2424    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    2525    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
     
    142142            }
    143143        }
     144       
     145        /// <summary>
     146        ///   Looks up a localized string similar to This kind of StorableConstructor signature is obsolete; Use the new signature instead.
     147        /// </summary>
     148        internal static string ObsoleteStorableConstructorAnalyzerDescription {
     149            get {
     150                return ResourceManager.GetString("ObsoleteStorableConstructorAnalyzerDescription", resourceCulture);
     151            }
     152        }
     153       
     154        /// <summary>
     155        ///   Looks up a localized string similar to Type &apos;{0}&apos; should use the new StorableConstructor signature.
     156        /// </summary>
     157        internal static string ObsoleteStorableConstructorAnalyzerMessageFormat {
     158            get {
     159                return ResourceManager.GetString("ObsoleteStorableConstructorAnalyzerMessageFormat", resourceCulture);
     160            }
     161        }
     162       
     163        /// <summary>
     164        ///   Looks up a localized string similar to Obsolete StorableConstructor signature.
     165        /// </summary>
     166        internal static string ObsoleteStorableConstructorAnalyzerTitle {
     167            get {
     168                return ResourceManager.GetString("ObsoleteStorableConstructorAnalyzerTitle", resourceCulture);
     169            }
     170        }
    144171    }
    145172}
  • misc/tools/PersistenceCodeFix/PersistenceCodeFix/PersistenceCodeFix/Resources.resx

    r14985 r16475  
    145145    <value>Obsolete StorableClass attribute</value>
    146146  </data>
     147  <data name="ObsoleteStorableConstructorAnalyzerDescription" xml:space="preserve">
     148    <value>This kind of StorableConstructor signature is obsolete; Use the new signature instead</value>
     149  </data>
     150  <data name="ObsoleteStorableConstructorAnalyzerMessageFormat" xml:space="preserve">
     151    <value>Type '{0}' should use the new StorableConstructor signature</value>
     152  </data>
     153  <data name="ObsoleteStorableConstructorAnalyzerTitle" xml:space="preserve">
     154    <value>Obsolete StorableConstructor signature</value>
     155  </data>
    147156</root>
Note: See TracChangeset for help on using the changeset viewer.