This repository was archived by the owner on Aug 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 653
refactor(rome_rowan): Remove AstNode
constraint from BatchMutation
#3026
Merged
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
Deploying with
|
Latest commit: |
c477afd
|
Status: | ✅ Deploy successful! |
Preview URL: | https://1fbecc4a.tools-8rn.pages.dev |
Branch Preview URL: | https://refactor-batch-mutation-synt.tools-8rn.pages.dev |
Parser conformance results on ubuntu-latestjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
|
## Summary This PR removes the `N: AstNode<Language=L>` constraint from the `BatchMutation` and changes the `root` to a `SyntaxNode<L>`. The main motivation for this change is that I want to use the `BatchMutation` for removing all `ParenthesizedExpression`s in the formatter but this isn't possible because: * The formatter accepts any Js node as the root and there's no `JsAnyNode` * It isn't guaranteed that the `root` type doesn't change in case the `root` node is a `JsParenthesizedExpression` that gets removed. ## Tests `cargo test && rustcs`
aafbc0e
to
6dd962f
Compare
ematipico
approved these changes
Aug 8, 2022
ematipico
reviewed
Aug 8, 2022
IWANABETHATGUY
pushed a commit
to IWANABETHATGUY/tools
that referenced
this pull request
Aug 10, 2022
IWANABETHATGUY
pushed a commit
to IWANABETHATGUY/tools
that referenced
this pull request
Aug 22, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
This PR removes the
N: AstNode<Language=L>
constraint from theBatchMutation
and changes theroot
to aSyntaxNode<L>
.The main motivation for this change is that I want to use the
BatchMutation
for removing allParenthesizedExpression
s in the formatter but this isn't possible because:JsAnyNode
root
type doesn't change in case theroot
node is aJsParenthesizedExpression
that gets removed.Tests
cargo test && rustcs