-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Format ExprName
#4803
Merged
Merged
Format ExprName
#4803
Conversation
This file contains 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
This was referenced Jun 2, 2023
Merged
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
MichaReiser
added
internal
An internal refactor or improvement
formatter
Related to the formatter
labels
Jun 2, 2023
Closed
PR Check ResultsEcosystem✅ ecosystem check detected no changes. BenchmarkLinux
Windows
|
MichaReiser
force-pushed
the
format-expr-name
branch
from
June 2, 2023 11:00
0dd25f8
to
57a621b
Compare
MichaReiser
force-pushed
the
format-expr-name
branch
from
June 2, 2023 12:45
57a621b
to
8f58b27
Compare
This was referenced Jun 2, 2023
Merged
charliermarsh
approved these changes
Jun 2, 2023
konstin
approved these changes
Jun 2, 2023
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.
Also formats StmtExpr and changes the snapshots, but both look good
MichaReiser
force-pushed
the
format-expr-name
branch
from
June 3, 2023 13:15
8f58b27
to
ff0bff4
Compare
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.
Summary
Implements formatting of
ExprName
.We, unfortunately, don't have the
Identifier
range. Luckily, we get away by simply using theName
range because it only encloses theIdentifier
.We may need to inspect the source code in other places to get the Identifier's range, or decide not to bother and use
dynamic_text
if the syntax element is rarely used (e.g.nonlocal
).Test Plan
I added a new test asserting my assumption that the name and identifier ranges are identical.
There are no snapshot changes because the new implementation slices the same text as the
verbatim_range
implementation.