Minor code refactoring
このコミットが含まれているのは:
1 親
00f1b8d911
コミット
18f7d956b4
2ファイル変更
+15
-17
検索条件に一致するファイルはありません
@@ -14,14 +14,6 @@ namespace ComputeSharp.SourceGenerators.Extensions
|
||||
/// </summary>
|
||||
internal static class SyntaxNodeExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// A custom <see cref="SymbolDisplayFormat"/> instance with fully qualified style, without global::.
|
||||
/// </summary>
|
||||
internal static readonly SymbolDisplayFormat FullyQualifiedWithoutGlobalFormat = new(
|
||||
globalNamespaceStyle: SymbolDisplayGlobalNamespaceStyle.Omitted,
|
||||
typeQualificationStyle: SymbolDisplayTypeQualificationStyle.NameAndContainingTypesAndNamespaces,
|
||||
genericsOptions: SymbolDisplayGenericsOptions.IncludeTypeParameters);
|
||||
|
||||
/// <summary>
|
||||
/// Checks a <see cref="SyntaxNode"/> value and replaces the value type to be HLSL compatible, if needed.
|
||||
/// </summary>
|
||||
@@ -53,7 +45,7 @@ namespace ComputeSharp.SourceGenerators.Extensions
|
||||
where TRoot : SyntaxNode
|
||||
{
|
||||
ITypeSymbol typeSymbol = semanticModel.GetTypeInfo(sourceType).Type!;
|
||||
string typeName = typeSymbol.ToDisplayString(FullyQualifiedWithoutGlobalFormat);
|
||||
string typeName = typeSymbol.ToDisplayString(ISymbolExtensions.FullyQualifiedWithoutGlobalFormat);
|
||||
|
||||
discoveredTypes.Add((INamedTypeSymbol)typeSymbol);
|
||||
|
||||
@@ -80,7 +72,7 @@ namespace ComputeSharp.SourceGenerators.Extensions
|
||||
public static TypeSyntax ReplaceAndTrackType(this LiteralExpressionSyntax node, SyntaxNode sourceNode, SemanticModel semanticModel, ICollection<INamedTypeSymbol> discoveredTypes)
|
||||
{
|
||||
ITypeSymbol typeSymbol = semanticModel.GetTypeInfo(sourceNode).Type!;
|
||||
string typeName = typeSymbol.ToDisplayString(FullyQualifiedWithoutGlobalFormat);
|
||||
string typeName = typeSymbol.ToDisplayString(ISymbolExtensions.FullyQualifiedWithoutGlobalFormat);
|
||||
|
||||
discoveredTypes.Add((INamedTypeSymbol)typeSymbol);
|
||||
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする