Skip to content

Commit 6688e58

Browse files
cleanup: remove unused types
1 parent 5eabbeb commit 6688e58

File tree

8 files changed

+0
-506
lines changed

8 files changed

+0
-506
lines changed
Lines changed: 0 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +0,0 @@
1-
using Microsoft.CodeAnalysis;
2-
3-
namespace TUnit.Core.SourceGenerator.Models;
4-
5-
/// <summary>
6-
/// Context for collecting and reporting diagnostics during source generation
7-
/// </summary>
8-
public class DiagnosticContext
9-
{
10-
private readonly List<Diagnostic> _diagnostics =
11-
[
12-
];
13-
private readonly SourceProductionContext _sourceProductionContext;
14-
15-
public DiagnosticContext(SourceProductionContext sourceProductionContext)
16-
{
17-
_sourceProductionContext = sourceProductionContext;
18-
}
19-
20-
/// <summary>
21-
/// Reports a diagnostic immediately
22-
/// </summary>
23-
public void ReportDiagnostic(Diagnostic diagnostic)
24-
{
25-
_sourceProductionContext.ReportDiagnostic(diagnostic);
26-
_diagnostics.Add(diagnostic);
27-
}
28-
29-
/// <summary>
30-
/// Creates and reports an error diagnostic
31-
/// </summary>
32-
public void ReportError(string id, string title, string message, Location? location = null)
33-
{
34-
var diagnostic = Diagnostic.Create(
35-
new DiagnosticDescriptor(
36-
id,
37-
title,
38-
message,
39-
"TUnit",
40-
DiagnosticSeverity.Error,
41-
isEnabledByDefault: true),
42-
location ?? Location.None);
43-
44-
ReportDiagnostic(diagnostic);
45-
}
46-
47-
/// <summary>
48-
/// Creates and reports a warning diagnostic
49-
/// </summary>
50-
public void ReportWarning(string id, string title, string message, Location? location = null)
51-
{
52-
var diagnostic = Diagnostic.Create(
53-
new DiagnosticDescriptor(
54-
id,
55-
title,
56-
message,
57-
"TUnit",
58-
DiagnosticSeverity.Warning,
59-
isEnabledByDefault: true),
60-
location ?? Location.None);
61-
62-
ReportDiagnostic(diagnostic);
63-
}
64-
65-
/// <summary>
66-
/// Creates and reports an info diagnostic
67-
/// </summary>
68-
public void ReportInfo(string id, string title, string message, Location? location = null)
69-
{
70-
var diagnostic = Diagnostic.Create(
71-
new DiagnosticDescriptor(
72-
id,
73-
title,
74-
message,
75-
"TUnit",
76-
DiagnosticSeverity.Info,
77-
isEnabledByDefault: true),
78-
location ?? Location.None);
79-
80-
ReportDiagnostic(diagnostic);
81-
}
82-
83-
/// <summary>
84-
/// Gets all diagnostics that have been reported
85-
/// </summary>
86-
public IReadOnlyList<Diagnostic> GetDiagnostics() => _diagnostics.AsReadOnly();
87-
88-
/// <summary>
89-
/// Checks if any errors have been reported
90-
/// </summary>
91-
public bool HasErrors => _diagnostics.Exists(d => d.Severity == DiagnosticSeverity.Error);
92-
}
Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +0,0 @@
1-
namespace TUnit.Core.SourceGenerator.Models.Extracted;
2-
3-
/// <summary>
4-
/// Primitive representation of a property with a data source.
5-
/// Contains only strings and primitives - no Roslyn symbols.
6-
/// Used for both instance and static property injection.
7-
/// </summary>
8-
public sealed class PropertyDataModel : IEquatable<PropertyDataModel>
9-
{
10-
// Property identity
11-
public required string PropertyName { get; init; }
12-
public required string PropertyTypeName { get; init; }
13-
public required string ContainingTypeName { get; init; }
14-
public required string MinimalContainingTypeName { get; init; }
15-
public required string Namespace { get; init; }
16-
public required string AssemblyName { get; init; }
17-
18-
// Property characteristics
19-
public required bool IsStatic { get; init; }
20-
public required bool HasPublicGetter { get; init; }
21-
public required bool HasPublicSetter { get; init; }
22-
23-
// Data source
24-
public required DataSourceModel DataSource { get; init; }
25-
26-
// Attributes
27-
public required EquatableArray<ExtractedAttribute> PropertyAttributes { get; init; }
28-
29-
public bool Equals(PropertyDataModel? other)
30-
{
31-
if (other is null)
32-
{
33-
return false;
34-
}
35-
36-
if (ReferenceEquals(this, other))
37-
{
38-
return true;
39-
}
40-
41-
return PropertyName == other.PropertyName
42-
&& ContainingTypeName == other.ContainingTypeName
43-
&& IsStatic == other.IsStatic
44-
&& DataSource.Equals(other.DataSource);
45-
}
46-
47-
public override bool Equals(object? obj)
48-
{
49-
return Equals(obj as PropertyDataModel);
50-
}
51-
52-
public override int GetHashCode()
53-
{
54-
unchecked
55-
{
56-
var hash = PropertyName.GetHashCode();
57-
hash = (hash * 397) ^ ContainingTypeName.GetHashCode();
58-
hash = (hash * 397) ^ IsStatic.GetHashCode();
59-
hash = (hash * 397) ^ DataSource.GetHashCode();
60-
return hash;
61-
}
62-
}
63-
}
Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +0,0 @@
1-
using System.Collections.Immutable;
2-
using Microsoft.CodeAnalysis;
3-
4-
namespace TUnit.Core.SourceGenerator.Models;
5-
6-
/// <summary>
7-
/// Model representing a generic test class registration for AOT support.
8-
/// </summary>
9-
public record GenericTestRegistration
10-
{
11-
/// <summary>
12-
/// The generic type definition (e.g., MyTest<>).
13-
/// </summary>
14-
public required INamedTypeSymbol GenericTypeDefinition { get; init; }
15-
16-
/// <summary>
17-
/// The concrete type arguments (e.g., int, string).
18-
/// </summary>
19-
public required ImmutableArray<ITypeSymbol> TypeArguments { get; init; }
20-
21-
/// <summary>
22-
/// The fully qualified name of the concrete type (e.g., MyTest<int>).
23-
/// </summary>
24-
public required string ConcreteTypeName { get; init; }
25-
26-
/// <summary>
27-
/// The constructed concrete type.
28-
/// </summary>
29-
public required INamedTypeSymbol ConcreteType { get; init; }
30-
}
Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +0,0 @@
1-
using Microsoft.CodeAnalysis;
2-
3-
namespace TUnit.Core.SourceGenerator.Models;
4-
5-
/// <summary>
6-
/// Context for property injection generation containing all necessary information
7-
/// </summary>
8-
public class PropertyInjectionContext : IEquatable<PropertyInjectionContext>
9-
{
10-
public required INamedTypeSymbol ClassSymbol { get; init; }
11-
public required string ClassName { get; init; }
12-
public required string SafeClassName { get; init; }
13-
public DiagnosticContext? DiagnosticContext { get; init; }
14-
15-
public bool Equals(PropertyInjectionContext? other)
16-
{
17-
if (ReferenceEquals(null, other))
18-
return false;
19-
if (ReferenceEquals(this, other))
20-
return true;
21-
22-
return SymbolEqualityComparer.Default.Equals(ClassSymbol, other.ClassSymbol) &&
23-
ClassName == other.ClassName &&
24-
SafeClassName == other.SafeClassName;
25-
// Note: DiagnosticContext is not included in equality as it's contextual/runtime state
26-
}
27-
28-
public override bool Equals(object? obj)
29-
{
30-
return Equals(obj as PropertyInjectionContext);
31-
}
32-
33-
public override int GetHashCode()
34-
{
35-
unchecked
36-
{
37-
var hashCode = SymbolEqualityComparer.Default.GetHashCode(ClassSymbol);
38-
hashCode = (hashCode * 397) ^ ClassName.GetHashCode();
39-
hashCode = (hashCode * 397) ^ SafeClassName.GetHashCode();
40-
return hashCode;
41-
}
42-
}
43-
}
Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +0,0 @@
1-
namespace TUnit.Core.SourceGenerator.Models;
2-
3-
public record StaticClassDataSourceInjectorModel
4-
{
5-
public required string FullyQualifiedTypeName { get; init; }
6-
public required string PropertyName { get; init; }
7-
public required string InjectableType { get; init; }
8-
public required string MinimalTypeName { get; set; }
9-
}

0 commit comments

Comments
 (0)