mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
29 lines
997 B
C#
29 lines
997 B
C#
using System.Text;
|
|
using JetBrains.Annotations;
|
|
using Microsoft.CodeAnalysis.Text;
|
|
|
|
namespace Terminal.Gui.Analyzers.Internal;
|
|
|
|
internal interface IStandardCSharpCodeGenerator<T> where T : IGeneratedTypeMetadata<T>
|
|
{
|
|
/// <summary>
|
|
/// Generates and returns the full source text corresponding to <see cref="Metadata"/>,
|
|
/// in the requested <paramref name="encoding"/> or <see cref="Encoding.UTF8"/> if not provided.
|
|
/// </summary>
|
|
/// <param name="encoding">
|
|
/// The <see cref="Encoding"/> of the generated source text or <see cref="Encoding.UTF8"/> if not
|
|
/// provided.
|
|
/// </param>
|
|
/// <returns></returns>
|
|
[UsedImplicitly]
|
|
[SkipLocalsInit]
|
|
ref readonly SourceText GenerateSourceText (Encoding? encoding = null);
|
|
|
|
/// <summary>
|
|
/// A type implementing <see cref="IGeneratedTypeMetadata{T}"/> which
|
|
/// will be used for source generation.
|
|
/// </summary>
|
|
[UsedImplicitly]
|
|
T Metadata { get; set; }
|
|
}
|