-
Notifications
You must be signed in to change notification settings - Fork 0
Virtual nodes support #3
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
Open
psxvoid
wants to merge
53
commits into
main
Choose a base branch
from
virtual-nodes-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Additional notes: - to prevent msbuild warnings install packages: System.CodeDome Microsoft.Win32.Registry
Additional notes: - MethodBodyVirtualQuery now matches only actual SyntaxNodes that represent a method body instead of matching a parent, containing the body (like MethodDeclarationSyntax) - MethodBodyVirtualQuery now performs multiple checks to ensure that the matched type is an actual method body variant - MethodBodyVirtualQuery now replaces the matching nodes in the query walker - MethodBodyDeclarationSyntax now supports ArrowExpressionClauseSyntax body type - CombinedSyntaxNode now also has MixedNode property that can return VirtualNode or SyntaxNode - add GetBody and TryGetBody methods (moved from RJ) - GetBody and TryGetBody are more consistent with their purpose
Additional changes: - fix combined query walker incorrect order of virtual query and sub-query - add IsContainer and GetFirstChildOfType SyntaxNode extensions - move method-body-member, method member and method-body syntax node matchers from RJ - add nested-block and nested-block-parent syntax node matchers
Additional notes: - GetBody now works with local funcs - treat LocalFunc as method body member - treat LocalFunc as method body parent - fix nested block parent matcher matches a method body (it shouldn't) - fix nested block matcher matches a method body (it shouldn't)
Additional notes: - fix incorrect equal behavior for combined nodes with the same base node but different virtual nodes - treat try, finally, catch and else clauses as a nested block parents - extract AssertMatch to SyntaxNodeMatcherTestBase - add unit tests for MethodBodyMemberSyntaxNodeMatcher - treat TryStatement as method body member - do not treat several body member child statements as body members - try-body virtual query now can also override the nested-body query
Previously mixed nodes were compared using the equality operator. It means that two virtual nodes of the same won't be equal until operator == is overloaded. In contrast by comparing mixed node types we don't have to overload the == operator for the most cases.
Additional notes: - do not treat LocalFunctionStatement as nested block parent because it should match MethodBody instead
Additional notes: - add missing v-queries to the query builder From(Span) method
Additional notes: - add VirtualSyntaxNodeWithSpanOverride to override TextSpan of a SyntaxNode - add "empty" virtual syntax node kind - add a static property for getting an empty virtual syntax node (see VirtualSyntaxNode class) - add NotNull extension for getting not nullable values - add an extension for getting source text bounds from FileLinePositionSpan - add an extension for casting a SyntaxNode to another SyntaxNode type - add IVirtualSyntaxNodeMather for finding specific virtual nodes - add experimental BasicSyntaxTreeQuery and BasicSyntaxTreeQueryWalker that support quering both virtual syntax nodes and native syntax nodes with separate syntax node matcher (no unit tests) - use experimental BasicSyntaxTreeQuery for matching nodes by TextSpan in SyntaxTreeBuilder - add SourceTextPosition virtual node matcher for matching virtual nodes with overriden SourceSpan - consider IfConditionSyntax virtual node as a node with overridable source-span (to differentiate it from a condition expression) - define more strictly differences between a method body syntax and nested block syntax - multiple changes to method-body, method-body-member, method-body-parent, nested-block and nested-block-parent syntax node matchers accordingly to definition of related virtual syntax nodes
Additional notes: - the support is only added to the basic syntax tree query walker - for now it supports mixing multiple non-overridable queries and a single overridable query - because of that IVirtualQueryRouting now returns array of results - a single result per overridable and non-overridable virtual query
Additional notes: - treat arrow expression clause as nested block parent - treat expression statement as nested block parent
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.