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

Resolve symbols early in all analyzers #586

Closed
Sergio0694 opened this issue Jan 26, 2023 · 0 comments · Fixed by #587
Closed

Resolve symbols early in all analyzers #586

Sergio0694 opened this issue Jan 26, 2023 · 0 comments · Fixed by #587
Labels
analyzer 👓 A new analyzer being implemented or updated mvvm-toolkit 🧰 Issues/PRs for the MVVM Toolkit optimization ☄ Performance or memory usage improvements

Comments

@Sergio0694
Copy link
Member

Sergio0694 commented Jan 26, 2023

context.Compilation.GetTypeByMetadataName

Not so good to do this call here. Better:

context.RegisterCompilationStartAction(context =>
{
    var notifyDataErrorInfoAttributeSymbol = context.Compilation.GetTypeByMetadataName("CommunityToolkit.Mvvm.ComponentModel.NotifyDataErrorInfoAttribute");
    if (notifyDataErrorInfoAttributeSymbol is null)
    {
        return;
    }

    context.RegisterSymbolAction(context =>
    {
        // Logic goes here.
    }
}

Originally posted by @Youssef1313 in #581 (comment)

@Sergio0694 Sergio0694 added optimization ☄ Performance or memory usage improvements mvvm-toolkit 🧰 Issues/PRs for the MVVM Toolkit analyzer 👓 A new analyzer being implemented or updated labels Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer 👓 A new analyzer being implemented or updated mvvm-toolkit 🧰 Issues/PRs for the MVVM Toolkit optimization ☄ Performance or memory usage improvements
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant