Remove leftover generator APIs

このコミットが含まれているのは:
Sergio Pedri committed 2023-10-14 00:35:04 +02:00
1 親 bb18d79bbf
コミット a724cb3efe
3ファイル変更
-68

検索条件に一致するファイルはありません

-1
ファイルの表示
@@ -26,7 +26,6 @@
<Compile Include="$(MSBuildThisFileDirectory)Helpers\ImmutableArrayBuilder{T}.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Helpers\IndentedTextWriter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Helpers\ObjectPool{T}.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Models\DeferredDiagnosticInfo.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Models\DiagnosticInfo.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Models\HierarchyInfo.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Models\TypeInfo.cs" />
-42
ファイルの表示
@@ -55,46 +55,4 @@ internal static class CompilationExtensions
{
return compilation.Options is CSharpCompilationOptions { AllowUnsafe: true };
}
/// <summary>
/// <para>
/// Checks whether or not a type with a specified metadata name is accessible from a given <see cref="Compilation"/> instance.
/// </para>
/// <para>
/// This method enumerates candidate type symbols to find a match in the following order:
/// <list type="number">
/// <item><description>
/// If only one type with the given name is found within the compilation and its referenced assemblies, check its accessibility.
/// </description></item>
/// <item><description>
/// If the current <paramref name="compilation"/> defines the symbol, check its accessibility.
/// </description></item>
/// <item><description>
/// Otherwise, check whether the type exists and is accessible from any of the referenced assemblies.
/// </description></item>
/// </list>
/// </para>
/// </summary>
/// <param name="compilation">The <see cref="Compilation"/> to consider for analysis.</param>
/// <param name="fullyQualifiedMetadataName">The fully-qualified metadata type name to find.</param>
/// <returns>Whether a type with the specified metadata name can be accessed from the given compilation.</returns>
public static bool HasAccessibleTypeWithMetadataName(this Compilation compilation, string fullyQualifiedMetadataName)
{
// If there is only a single matching symbol, check its accessibility
if (compilation.GetTypeByMetadataName(fullyQualifiedMetadataName) is INamedTypeSymbol typeSymbol)
{
return compilation.IsSymbolAccessibleWithin(typeSymbol, compilation.Assembly);
}
// Otherwise, check all available types
foreach (INamedTypeSymbol currentTypeSymbol in compilation.GetTypesByMetadataName(fullyQualifiedMetadataName))
{
if (compilation.IsSymbolAccessibleWithin(currentTypeSymbol, compilation.Assembly))
{
return true;
}
}
return false;
}
}
-25
ファイルの表示
@@ -1,25 +0,0 @@
using System.Collections.Immutable;
using System.Linq;
using ComputeSharp.SourceGeneration.Helpers;
using Microsoft.CodeAnalysis;
namespace ComputeSharp.SourceGeneration.Models;
/// <summary>
/// A model for a serializeable diagnostic info to be reconstructed later in a pipeline.
/// </summary>
/// <param name="Descriptor">The wrapped <see cref="DiagnosticDescriptor"/> instance.</param>
/// <param name="Arguments">The diagnostic arguments.</param>
internal sealed record DeferredDiagnosticInfo(DiagnosticDescriptor Descriptor, EquatableArray<string> Arguments)
{
/// <summary>
/// Creates a new <see cref="DeferredDiagnosticInfo"/> instance with the specified parameters.
/// </summary>
/// <param name="descriptor">The input <see cref="DiagnosticDescriptor"/> for the diagnostics to create.</param>
/// <param name="args">The optional arguments for the formatted message to include.</param>
/// <returns>A new <see cref="DeferredDiagnosticInfo"/> instance with the specified parameters.</returns>
public static DeferredDiagnosticInfo Create(DiagnosticDescriptor descriptor, params object[] args)
{
return new(descriptor, args.Select(static arg => arg.ToString()).ToImmutableArray());
}
}