Skip to content

Gracefully handles the expression tree with custom Expression implementations #76

@CXuesong

Description

@CXuesong

Describe the bug
When working with IQueryable, I have an expression tree with some custom Expression-derived class inside. I want to visualize the expression tree but it fails.

To Reproduce
Expression tree DebugView. Note there is an Extension<WikiClientLibrary.Cargo.Linq.CargoQueryRootExpression> node, which is a custom Expression class.

.Call System.Linq.Queryable.Where(
    .Call System.Linq.Queryable.Select(
        .Extension<WikiClientLibrary.Cargo.Linq.CargoQueryRootExpression>,
        '(.Lambda #Lambda1<System.Func`2[WikiClientLibrary.Tests.UnitTestProject1.Tests.CargoTests+LolSkin,<>f__AnonymousType1`3[System.String,System.String,System.DateTime]]>))
    ,
    '(.Lambda #Lambda2<System.Func`2[<>f__AnonymousType1`3[System.String,System.String,System.DateTime],System.Boolean]>))

.Lambda #Lambda1<System.Func`2[WikiClientLibrary.Tests.UnitTestProject1.Tests.CargoTests+LolSkin,<>f__AnonymousType1`3[System.String,System.String,System.DateTime]]>(WikiClientLibrary.Tests.UnitTestProject1.Tests.CargoTests+LolSkin $s)
{
    .New <>f__AnonymousType1`3[System.String,System.String,System.DateTime](
        $s.Name,
        $s.Champion,
        $s.ReleaseDate)
}

.Lambda #Lambda2<System.Func`2[<>f__AnonymousType1`3[System.String,System.String,System.DateTime],System.Boolean]>(<>f__AnonymousType1`3[System.String,System.String,System.DateTime] $s)
{
    $s.Champion == (.Constant<WikiClientLibrary.Tests.UnitTestProject1.Tests.CargoTests+<>c__DisplayClass3_0>(WikiClientLibrary.Tests.UnitTestProject1.Tests.CargoTests+<>c__DisplayClass3_0).closureParams).Champion
}

Expected behavior
I assume I should still be able to see the rest part of the expression. Perhaps you can replace the unknown expressions with some placeholders, but for now I'm completely blocked from visualizing any part of the expression.

Screenshots
image

Version info:

  • Visual Studio version: 2019
  • Visualizer location: [VS install path, or Documents subfolder]
  • Version: 1.7.109

Note that the visualizer location and version can be found at the bottom of the Settings popup (click the gear icon).

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions