Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip: create generator project #1

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

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