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

Extend Syntax Tree Visualizer to work on SyntaxNodes while debugging #1680

Closed
JoshVarty opened this Issue Mar 30, 2015 · 5 comments

Comments

Projects
None yet
6 participants
@JoshVarty
Contributor

JoshVarty commented Mar 30, 2015

Right now when debugging rewritten syntax trees I had been using .ToFullString() to see if my rewriter had worked correctly.

I recently ran into an issue where I was creating an invalid syntax tree, but .ToFullString() printed it such that it appeared valid. (I was creating an InvocationExpression with the Identifier "Namespace.Type.MethodName" instead of a chain of SimpleMemberAccessExpressions with the identifiers "Namespace", "Type" and "MethodName").

Ultimately the only arbiter of truth when it comes to syntax trees is the Syntax Visualizer. When debugging it would be very useful to analyze the nodes I'm interested in so I can determine correctness.

@KirillOsenkov mentioned that there may have been a debugger visualizer at some point and mentioned I should ask @shyamnamboodiripad about this.

@shyamnamboodiripad

This comment has been minimized.

Show comment
Hide comment
@shyamnamboodiripad

shyamnamboodiripad Mar 30, 2015

Contributor

There used to be a debugger visualizer sample in early versions of Roslyn CTP when syntax trees and nodes were serializable. We removed the serialization support for nodes at some point. Since debugger visualizers are required to run in a separate app domain, we would need nodes to be serializable to make this work correctly again.

Contributor

shyamnamboodiripad commented Mar 30, 2015

There used to be a debugger visualizer sample in early versions of Roslyn CTP when syntax trees and nodes were serializable. We removed the serialization support for nodes at some point. Since debugger visualizers are required to run in a separate app domain, we would need nodes to be serializable to make this work correctly again.

@JoshVarty

This comment has been minimized.

Show comment
Hide comment
@JoshVarty

JoshVarty Apr 9, 2015

Contributor

Do you remember why serialization of nodes was removed? I recall seeing an explanation on StackOverflow (Perhaps by @Pilchie) but I can't seem to find it.

I suspect there's a good reason for the removal and it's unlikely things have changed. If that's the case, I'll go ahead and close this issue.

Contributor

JoshVarty commented Apr 9, 2015

Do you remember why serialization of nodes was removed? I recall seeing an explanation on StackOverflow (Perhaps by @Pilchie) but I can't seem to find it.

I suspect there's a good reason for the removal and it's unlikely things have changed. If that's the case, I'll go ahead and close this issue.

@Pilchie

This comment has been minimized.

Show comment
Hide comment
@Pilchie

Pilchie Apr 9, 2015

Member

The main reason was to make the core APIs part of the portable profile, which doesn't support Serialization.

Member

Pilchie commented Apr 9, 2015

The main reason was to make the core APIs part of the portable profile, which doesn't support Serialization.

@JoshVarty

This comment has been minimized.

Show comment
Hide comment
@JoshVarty

JoshVarty Apr 9, 2015

Contributor

Makes sense, I doubt that's going to change so I'll close this.

Contributor

JoshVarty commented Apr 9, 2015

Makes sense, I doubt that's going to change so I'll close this.

@JoshVarty JoshVarty closed this Apr 9, 2015

@svick

This comment has been minimized.

Show comment
Hide comment
@svick

svick Apr 9, 2015

Contributor

Would it be possible to use some other serialization that is supported in PCL (say, JSON.NET) for this, instead of binary serialization?

Contributor

svick commented Apr 9, 2015

Would it be possible to use some other serialization that is supported in PCL (say, JSON.NET) for this, instead of binary serialization?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment