Skip to content

Speedup conversion time for code without "MyClass" and "WithEvents / Handles" #1090

Open
@LucTremblay

Description

@LucTremblay

Hi, I am looking for a way to speed up my conversion time.

I looked at ours overall busniness code and we only have a few utilisation of the key words "MyClass" and "WithEvents / Handles" that we can take care manually.

I would like to know your advice, if we could safely remove the following from DeclarationNodeVisitor.cs, as it's seems to cut in half (if not more) the time it takes to convert, especially the WithEvents / Handles part.

MyClass

    private static HashSet<string> GetMyClassAccessedNames(VBSyntax.ClassBlockSyntax classBlock)
    {
        //var memberAccesses = classBlock.DescendantNodes().OfType<VBSyntax.MemberAccessExpressionSyntax>();
        //var accessedTextNames = new HashSet<string>(memberAccesses
            //.Where(mae => mae.Expression is VBSyntax.MyClassExpressionSyntax)
            //.Select(mae => mae.Name.Identifier.Text), StringComparer.OrdinalIgnoreCase);
        //return accessedTextNames;
        return new HashSet<string>();
    }

WithEvents / Handles

    private async Task<HandledEventsAnalysis> GetMethodWithHandlesAsync(VBSyntax.TypeBlockSyntax parentType, IMethodSymbol designerGeneratedInitializeComponentOrNull)
    {
        //if (parentType == null || _semanticModel.GetDeclaredSymbol((SyntaxNode)parentType) is not INamedTypeSymbol containingType) {
        return new HandledEventsAnalysis(CommonConversions, null, Array.Empty<(HandledEventsAnalysis.EventContainer EventContainer, (IPropertySymbol Property, bool IsNeverWrittenOrOverridden) PropertyDetails, (EventDescriptor Event, IMethodSymbol HandlingMethod, int ParametersToDiscard)[] HandledMethods)>());
        //}
        //return await HandledEventsAnalyzer.AnalyzeAsync(CommonConversions, containingType, designerGeneratedInitializeComponentOrNull, _typeToInheritors);
    }

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions