IStandardCSharpCodeGenerator.cs 997 B

12345678910111213141516171819202122232425262728
  1. using System.Text;
  2. using JetBrains.Annotations;
  3. using Microsoft.CodeAnalysis.Text;
  4. namespace Terminal.Gui.Analyzers.Internal;
  5. internal interface IStandardCSharpCodeGenerator<T> where T : IGeneratedTypeMetadata<T>
  6. {
  7. /// <summary>
  8. /// Generates and returns the full source text corresponding to <see cref="Metadata"/>,
  9. /// in the requested <paramref name="encoding"/> or <see cref="Encoding.UTF8"/> if not provided.
  10. /// </summary>
  11. /// <param name="encoding">
  12. /// The <see cref="Encoding"/> of the generated source text or <see cref="Encoding.UTF8"/> if not
  13. /// provided.
  14. /// </param>
  15. /// <returns></returns>
  16. [UsedImplicitly]
  17. [SkipLocalsInit]
  18. ref readonly SourceText GenerateSourceText (Encoding? encoding = null);
  19. /// <summary>
  20. /// A type implementing <see cref="IGeneratedTypeMetadata{T}"/> which
  21. /// will be used for source generation.
  22. /// </summary>
  23. [UsedImplicitly]
  24. T Metadata { get; set; }
  25. }