Skip to content

wip: create generator project#1

Draft
ttd2089 wants to merge 1 commit intomainfrom
feat/generate-default-value-parsers
Draft

wip: create generator project#1
ttd2089 wants to merge 1 commit intomainfrom
feat/generate-default-value-parsers

Conversation

@ttd2089
Copy link
Member

@ttd2089 ttd2089 commented Sep 25, 2023

Creates a generator project that catches all references to generic names and generates warnings. This is the first step in catching references to the AddDefaultParser generic method and replacing them with calls to add explicitly constructed parsers that use either the TryParse or string constructors on the associated type. This avoids the need to use reflection and makes the code safer for trimming, as well as allowing us to raise an error if the type doesn't support a default parser.

Creates a generator project that catches all references to generic names
and generates warnings. This is the first step in catching references to
the AddDefaultParser generic method and replacing them with calls to
add explicitly constructed parsers that use either the TryParse or
string constructors on the associated type. This avoids the need to use
reflection and makes the code safer for trimming, as well as allowing
us to raise an error if the type doesn't support a default parser.
@@ -0,0 +1,5 @@
using Geis;
Copy link
Member

@Insomniak47 Insomniak47 Sep 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not to be the old man "No, the kids are wrong" but I'd prefer not using top level statements

{
public void Initialize(IncrementalGeneratorInitializationContext context)
{
//System.Diagnostics.Debugger.Launch();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be good to put this behind a flag and conditional compile it in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants