-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from Cysharp/hadashiA/iformattable-iparsable
Support System.IFormattable/IParsable etc
- Loading branch information
Showing
9 changed files
with
391 additions
and
46 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
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
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System; | ||
using Microsoft.CodeAnalysis; | ||
|
||
namespace UnitGenerator; | ||
|
||
class ReferenceSymbols | ||
{ | ||
public static ReferenceSymbols Create(Compilation compilation) | ||
{ | ||
return new ReferenceSymbols | ||
{ | ||
GuidType = compilation.GetTypeByMetadataName("System.Guid")!, | ||
UlidType = compilation.GetTypeByMetadataName("System.Ulid"), | ||
FormattableInterface = compilation.GetTypeByMetadataName("System.IFormattable")!, | ||
ParsableInterface = compilation.GetTypeByMetadataName("System.IParsable`1"), | ||
SpanFormattableInterface = compilation.GetTypeByMetadataName("System.ISpanFormattable"), | ||
SpanParsableInterface = compilation.GetTypeByMetadataName("System.ISpanParsable`1"), | ||
Utf8SpanFormattableInterface = compilation.GetTypeByMetadataName("System.IUtf8SpanFormattable"), | ||
Utf8SpanParsableInterface = compilation.GetTypeByMetadataName("System.IUtf8SpanParsable`1"), | ||
}; | ||
} | ||
|
||
public INamedTypeSymbol GuidType { get; private set; } = default!; | ||
public INamedTypeSymbol? UlidType { get; private set; } | ||
public INamedTypeSymbol FormattableInterface { get; private set; } = default!; | ||
public INamedTypeSymbol? ParsableInterface { get; private set; } | ||
public INamedTypeSymbol? SpanFormattableInterface { get; private set; } | ||
public INamedTypeSymbol? SpanParsableInterface { get; private set; } | ||
public INamedTypeSymbol? Utf8SpanFormattableInterface { get; private set; } | ||
public INamedTypeSymbol? Utf8SpanParsableInterface { get; private set; } | ||
} |
Oops, something went wrong.