Skip to content
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

Fix Symbol View In SyntaxTreeVizualizer #634

Merged
merged 1 commit into from
Oct 2, 2020
Merged

Conversation

bernd5
Copy link

@bernd5 bernd5 commented Oct 1, 2020

=> Use custom ICustomTypeDescriptor to display Symbol-Data
@bernd5 bernd5 requested a review from a team as a code owner October 1, 2020 13:31
@sharwell
Copy link
Member

sharwell commented Oct 1, 2020

Do you know why a custom TypeDescriptor is needed for displaying ISymbol, but is not needed for displaying IOperation?

@bernd5
Copy link
Author

bernd5 commented Oct 1, 2020

What happens inside of the property grid is a call like this:

var props = TypeDescriptor.GetProperties(node, new Attribute[] { BrowsableAttribute.Yes });

which calls then (more or less):

new ReflectTypeDescriptionProvider().GetProperties(node.GetType())

For SyntaxNodes it returns some properties (perhaps because of some attributes). But for symbols it returns nothing.

@sharwell
Copy link
Member

sharwell commented Oct 1, 2020

@bernd5
Copy link
Author

bernd5 commented Oct 1, 2020

That makes sense, we have the type of the Symbol implementation not the Symbol itself.

@bernd5
Copy link
Author

bernd5 commented Oct 1, 2020

We could use the adapter for all kinds of selected objects, it allows a better control...
For example we can print now "None" instead of an empty string. And we can print the result of functions without parameters...

@bernd5
Copy link
Author

bernd5 commented Oct 2, 2020

do you want to merge it or should I change something?

Copy link
Contributor

@jmarolf jmarolf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@jmarolf
Copy link
Contributor

jmarolf commented Oct 2, 2020

Thanks @bernd5! I'll go ahead and merge this in

@jmarolf jmarolf merged commit 223d750 into dotnet:master Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants