-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
[prettier] Adds prettier-plugin-move #18405
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Skipped Deployments
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to additional tests requested in the PR's body, it would be great to see separate tests for more complicated (nested, breaking, etc.) imports (aka uses) and attributes
external-crates/move/crates/move-analyzer/prettier-move/src/cst/Common.ts
Outdated
Show resolved
Hide resolved
external-crates/move/crates/move-analyzer/prettier-move/src/cst/Common.ts
Outdated
Show resolved
Hide resolved
external-crates/move/crates/move-analyzer/prettier-move/src/cst/Common.ts
Show resolved
Hide resolved
external-crates/move/crates/move-analyzer/prettier-move/src/cst/Common.ts
Show resolved
Hide resolved
external-crates/move/crates/move-analyzer/prettier-move/src/cst/Common.ts
Outdated
Show resolved
Hide resolved
|
||
fun binary_expression_folding() { | ||
// binary_expression | ||
say_something_really_long && say_something_really_long || say_something_really_long; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add tests for parenthesized variants
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was hoping for something that will exercise breaks involving parenthesized conditions. Something like a couple of differently parenthesized variants of the following:
((say_something_really_long || say_something_really_long) && say_something_really_long) || (say_something_really_long && say_something_really_long) || (say_something_really_long || say_something_really_long)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not technically feasible today. I'm waiting on Tim to try and patch the structure of the binary_expression
, so we know we're inside a binary expression. But overall these are the hardest to get and require special treatment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acknowledged. As suggested in the other comment, let's add some additional explanation and a test, and move on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be really good to get a bit more detailed explanation on the difficulty related to binary expressions, even if they are not fully handled as part of this PR, so that we know what's missing (if anything) and what kind of effort could be involved in getting this to completion
external-crates/move/crates/move-analyzer/prettier-move/tests/functions/expression.move
Show resolved
Hide resolved
external-crates/move/crates/move-analyzer/prettier-move/tests/functions/expression.move
Show resolved
Hide resolved
external-crates/move/crates/move-analyzer/prettier-move/tests/mega-test/misc.exp.move
Show resolved
Hide resolved
external-crates/move/crates/move-analyzer/prettier-move/tests/mega-test/misc.exp.move
Show resolved
Hide resolved
08d5b54
to
990ac64
Compare
function printBindField(path: AstPath<Node>, options: ParserOptions, print: printFn): Doc { | ||
const nonFormatting = path.node.nonFormattingChildren; | ||
const isMut = !!path.node.children.find((c) => c.text === 'mut'); | ||
// const rename = nonFormatting.length == 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove?
|
||
fun binary_expression_folding() { | ||
// binary_expression | ||
say_something_really_long && say_something_really_long || say_something_really_long; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was hoping for something that will exercise breaks involving parenthesized conditions. Something like a couple of differently parenthesized variants of the following:
((say_something_really_long || say_something_really_long) && say_something_really_long) || (say_something_really_long && say_something_really_long) || (say_something_really_long || say_something_really_long)
external-crates/move/crates/move-analyzer/prettier-move/tests/sui-framework/package.exp.move
Show resolved
Hide resolved
Here's a summary of testing that needs to happen either as part of this PR or a series of the following ones (in the latter case we should probably keep track of this via a series of opened issue):
|
92518b9
to
4cd6bb4
Compare
29fa35d
to
9709700
Compare
This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
Is this obsolete in favor of #20203? |
@tedks correct! Closing! |
Description
Upstreams the prettier plugin development.
Test plan
Features tests.
Release notes
Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.
For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.