Free cookie consent management tool by TermsFeed Policy Generator

Changeset 14989


Ignore:
Timestamp:
05/16/17 15:56:38 (8 years ago)
Author:
jkarder
Message:

#2520: worked on persistence code fix

  • added SequentialFixAllProvider
Location:
trunk/tools/PersistenceCodeFix/PersistenceCodeFix/PersistenceCodeFix
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/PersistenceCodeFix/PersistenceCodeFix/PersistenceCodeFix/Analyzers/MissingStorableConstructor/MissingStorableConstructorFix.cs

    r14985 r14989  
    1515namespace PersistenceCodeFix {
    1616  [ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(MissingStorableConstructorFix)), Shared]
    17   public sealed class MissingStorableConstructorFix : CodeFixProvider {
     17  public sealed class MissingStorableConstructorFix : CodeFixProvider, IDocumentCodeFixProvider {
    1818    private const string title = "Add storable constructor";
    1919
     
    2323
    2424    public sealed override FixAllProvider GetFixAllProvider() {
    25       return WellKnownFixAllProviders.BatchFixer;
     25      return SequentialFixAllProvider.Instance;
    2626    }
    2727
     
    124124      return members;
    125125    }
     126
     127    public Task<Document> FixDocumentAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) {
     128      return AddStorableConstructor(document, (BaseTypeDeclarationSyntax)node, cancellationToken);
     129    }
    126130  }
    127131}
  • trunk/tools/PersistenceCodeFix/PersistenceCodeFix/PersistenceCodeFix/Analyzers/MissingStorableType/MissingStorableTypeFix.cs

    r14985 r14989  
    1414namespace PersistenceCodeFix {
    1515  [ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(MissingStorableTypeFix)), Shared]
    16   public sealed class MissingStorableTypeFix : CodeFixProvider {
     16  public sealed class MissingStorableTypeFix : CodeFixProvider, IDocumentCodeFixProvider {
    1717    private const string title = "Add StorableType attribute";
    1818
     
    2222
    2323    public sealed override FixAllProvider GetFixAllProvider() {
    24       return WellKnownFixAllProviders.BatchFixer;
     24      return SequentialFixAllProvider.Instance;
    2525    }
    2626
     
    113113      return attrLists == null ? SyntaxFactory.List(new[] { attrList }) : attrLists.Add(attrList);
    114114    }
     115
     116    public Task<Document> FixDocumentAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) {
     117      return AddStorableTypeAttribute(document, (BaseTypeDeclarationSyntax)node, cancellationToken);
     118    }
    115119  }
    116120}
  • trunk/tools/PersistenceCodeFix/PersistenceCodeFix/PersistenceCodeFix/Analyzers/ObsoleteStorableClass/ObsoleteStorableClassFix.cs

    r14985 r14989  
    1414namespace PersistenceCodeFix {
    1515  [ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(ObsoleteStorableClassFix)), Shared]
    16   public sealed class ObsoleteStorableClassFix : CodeFixProvider {
     16  public sealed class ObsoleteStorableClassFix : CodeFixProvider, IDocumentCodeFixProvider {
    1717    private const string title = "Change to StorableType attribute";
    1818
     
    2222
    2323    public sealed override FixAllProvider GetFixAllProvider() {
    24       return WellKnownFixAllProviders.BatchFixer;
     24      return SequentialFixAllProvider.Instance;
    2525    }
    2626
     
    9191      return document.WithSyntaxRoot(newRoot);
    9292    }
     93
     94    public Task<Document> FixDocumentAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) {
     95      return ChangeToStorableTypeAttribute(document, (AttributeSyntax)node, cancellationToken);
     96    }
    9397  }
    9498}
  • trunk/tools/PersistenceCodeFix/PersistenceCodeFix/PersistenceCodeFix/PersistenceCodeFix.csproj

    r14985 r14989  
    4242    <Compile Include="Analyzers\MissingStorableType\MissingStorableTypeAnalyzer.cs" />
    4343    <Compile Include="Analyzers\MissingStorableType\MissingStorableTypeFix.cs" />
     44    <Compile Include="IDocumentCodeFixProvider.cs" />
    4445    <Compile Include="Properties\AssemblyInfo.cs" />
    4546    <Compile Include="Resources.Designer.cs">
     
    4849      <DependentUpon>Resources.resx</DependentUpon>
    4950    </Compile>
     51    <Compile Include="SequentialFixAllProvider.cs" />
    5052  </ItemGroup>
    5153  <ItemGroup>
Note: See TracChangeset for help on using the changeset viewer.