KirillOsenkov / RoslynQuoter

Roslyn tool that for a given C# program shows syntax tree API calls to construct its syntax tree
http://roslynquoter.azurewebsites.net
Apache License 2.0
918 stars 118 forks source link

Expression Execution issue #40

Closed punitganshani closed 4 years ago

punitganshani commented 6 years ago

When we try this expression on demo site, it generates the Expression perfectly

  When().Match<Customer>(() => customer)

But when we use Quoter in code it throws exception

GetTokenForExpression(@"
                When().Match<Customer>(() => customer)
            ");

private static void GetTokenForExpression(string expression)
        {
            var quoter = new Quoter
            {
                OpenParenthesisOnNewLine = true,
                ClosingParenthesisOnNewLine = true,
                UseDefaultFormatting = false,
                RemoveRedundantModifyingCalls = true,
                ShortenCodeWithUsingStatic = true
            };
            var generatedNode = quoter.QuoteText(expression, NodeKind.Expression);
        }
KirillOsenkov commented 6 years ago

What are the steps for me to reproduce this? And what's the callstack and type of the exception being thrown?