-
-
Notifications
You must be signed in to change notification settings - Fork 748
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimized the Type Module Source Generator (#6388)
- Loading branch information
1 parent
16355ea
commit 6ab57c1
Showing
16 changed files
with
280 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"dotnet.defaultSolution": "HotChocolate.Core.sln" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +0,0 @@ | ||
namespace HotChocolate.Types.Analyzers.Inspectors; | ||
|
||
public sealed class AggregateInfo : ISyntaxInfo, IEquatable<AggregateInfo> | ||
{ | ||
private readonly IReadOnlyList<ISyntaxInfo> _syntaxInfos; | ||
|
||
public AggregateInfo(IReadOnlyList<ISyntaxInfo> syntaxInfos) | ||
{ | ||
_syntaxInfos = syntaxInfos; | ||
} | ||
|
||
public IReadOnlyList<ISyntaxInfo> Items => _syntaxInfos; | ||
|
||
public bool Equals(AggregateInfo? other) | ||
{ | ||
if (ReferenceEquals(null, other)) | ||
{ | ||
return false; | ||
} | ||
|
||
if (ReferenceEquals(this, other)) | ||
{ | ||
return true; | ||
} | ||
|
||
return Equals(_syntaxInfos, other._syntaxInfos); | ||
} | ||
|
||
public override bool Equals(object? obj) | ||
=> ReferenceEquals(this, obj) || | ||
obj is AggregateInfo other && Equals(other); | ||
|
||
public override int GetHashCode() | ||
=> _syntaxInfos.GetHashCode(); | ||
|
||
public static bool operator ==(AggregateInfo? left, AggregateInfo? right) | ||
=> Equals(left, right); | ||
|
||
public static bool operator !=(AggregateInfo? left, AggregateInfo? right) | ||
=> !Equals(left, right); | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/HotChocolate/Core/src/Types.Analyzers/Inspectors/ISyntaxInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
namespace HotChocolate.Types.Analyzers.Inspectors; | ||
|
||
public interface ISyntaxInfo | ||
public interface ISyntaxInfo : IEquatable<ISyntaxInfo> | ||
{ | ||
} |
Oops, something went wrong.