Skip to content

Commit

Permalink
Src gen: Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
sveinungf committed Feb 18, 2024
1 parent e075615 commit 093ee7c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 16 deletions.
6 changes: 1 addition & 5 deletions SpreadCheetah.SourceGenerator/Extensions/SymbolExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ public static RowTypeProperty ToRowTypeProperty(

return new RowTypeProperty(
ColumnHeader: columnHeader,
Name: p.Name,
TypeFullName: p.Type.ToDisplayString(),
TypeName: p.Type.Name,
TypeNullableAnnotation: p.NullableAnnotation,
TypeSpecialType: p.Type.SpecialType);
Name: p.Name);
}
}
2 changes: 2 additions & 0 deletions SpreadCheetah.SourceGenerator/Helpers/EquatableArray.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
using System.Collections;
using System.Diagnostics.CodeAnalysis;

namespace SpreadCheetah.SourceGenerator.Helpers;

/// <summary>
/// Based on the implementation from:
/// https://github.com/CommunityToolkit/dotnet/blob/main/src/CommunityToolkit.Mvvm.SourceGenerators/Helpers/EquatableArray%7BT%7D.cs
/// </summary>
[ExcludeFromCodeCoverage]
internal readonly struct EquatableArray<T>(T[] underlyingArray)
: IEquatable<EquatableArray<T>>, IReadOnlyCollection<T>
where T : IEquatable<T>
Expand Down
2 changes: 2 additions & 0 deletions SpreadCheetah.SourceGenerator/Helpers/HashCode.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
Expand All @@ -10,6 +11,7 @@ namespace SpreadCheetah.SourceGenerator.Helpers;
/// https://github.com/CommunityToolkit/dotnet/blob/7b53ae23dfc6a7fb12d0fc058b89b6e948f48448/src/CommunityToolkit.Mvvm.SourceGenerators/Helpers/HashCode.cs
/// </summary>
[StructLayout(LayoutKind.Auto)]
[ExcludeFromCodeCoverage]
#pragma warning disable CA1066 // Implement IEquatable when overriding Object.Equals
internal struct HashCode
#pragma warning restore CA1066 // Implement IEquatable when overriding Object.Equals
Expand Down
5 changes: 0 additions & 5 deletions SpreadCheetah.SourceGenerator/Helpers/LocationMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ public static Location ToLocation(this LocationInfo info)
return Location.Create(info.FilePath, info.TextSpan, info.LineSpan);
}

public static LocationInfo? ToLocationInfo(this SyntaxNode node)
{
return node.GetLocation().ToLocationInfo();
}

public static LocationInfo? ToLocationInfo(this Location location)
{
if (location.SourceTree is null)
Expand Down
6 changes: 0 additions & 6 deletions SpreadCheetah.SourceGenerator/Models/RowTypeProperty.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
using Microsoft.CodeAnalysis;

namespace SpreadCheetah.SourceGenerator.Models;

internal sealed record RowTypeProperty(
string Name,
string TypeName,
string TypeFullName,
NullableAnnotation TypeNullableAnnotation,
SpecialType TypeSpecialType,
string ColumnHeader);

0 comments on commit 093ee7c

Please sign in to comment.