Skip to content

Resolve symbols early in all analyzers #586

@Sergio0694

Description

@Sergio0694

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    analyzer 👓A new analyzer being implemented or updatedmvvm-toolkit 🧰Issues/PRs for the MVVM Toolkitoptimization ☄Performance or memory usage improvements

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions