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

New view for interactive analysis of individual nodes based on caret selection #55

Closed
Rekkonnect opened this issue Jun 5, 2024 · 0 comments · Fixed by #72
Closed

New view for interactive analysis of individual nodes based on caret selection #55

Rekkonnect opened this issue Jun 5, 2024 · 0 comments · Fixed by #72
Labels
enhancement New feature or request
Milestone

Comments

@Rekkonnect
Copy link
Owner

Summary

Create a view that will display only select properties and methods of the currently selected syntax object (node, token or trivia)

Motivation

The project began as a syntax tree viewer, which was later expanded into supporting displaying symbols and operations. However, the implementation was driven by the constraint for a tree-like view. This constraint poses problems for the usability and predictability of the feature.

The main goal is explorability and direct listing of the objects that may be returned. However, such a view hides away the clue of the path to the displayed object, and also doesn't show all the available children if they're not contained in the result returned from Roslyn. Not to mention that operations needed a custom OperationTree which bundles operations under the umbrella of every top-level symbol that contains the first operation.

Details

The new view will be based on this skeleton example:

Current node:
N    ClassDeclarationSyntax

Parent: FileScopedNamespaceDeclarationSyntax

Properties:
...

(expandable)
+ ChildNodes():   IEnumerable<SyntaxNode>
+ ChildTokens():   IEnumerable<SyntaxNode>
+ ChildNodesAndTokens():   IEnumerable<SyntaxNode>

+ SemanticModel.GetSymbolInfo(this): ...
+ SemanticModel.GetTypeInfo(this): ...
+ SemanticModel.GetAliasInfo(this): ...
+ SemanticModel.GetPreprocessingSymbolInfo(this): ...
+ SemanticModel.GetSpeculativeSymbolInfo(this): ...
+ SemanticModel.GetSpeculativeTypeInfo(this): ...
+ SemanticModel.GetSpeculativeAliasInfo(this): ...

+ SemanticModel.GetOperation(this):   IOperation

This is more to the point, and provides a raw introspection of the expected results. This makes Syndiesis a much stronger Roslyn playground with many built-in conveniences for a test workflow. The most important aspect is giving a direct mapping of the information at hand with the expected outcome, which will be helpful to determine the information to expect when building a Roslyn tool.

The already existing views of symbols and operations won't be removed, but will be less likely to see improvements after the introduction of this view.

@Rekkonnect Rekkonnect added this to the v1.2.0 milestone Jun 5, 2024
@Rekkonnect Rekkonnect added the enhancement New feature or request label Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant