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

Reimplement range format #16292

Open
fisker opened this issue May 15, 2024 · 0 comments
Open

Reimplement range format #16292

fisker opened this issue May 15, 2024 · 0 comments
Labels
status:needs discussion Issues needing discussion and a decision to be made before action can be taken type:refactor Issues about tackling technical debt

Comments

@fisker
Copy link
Member

fisker commented May 15, 2024

Currently, we first parse the whole file and find the suitable range to format, and reparse the text in range, but we lost context eg yield expression become top level (issue).

I believe correct solution should be,

  1. parse whole file
  2. find the range node
  3. start print from the range node (instead of root node)
  4. add text around range node
@fisker fisker added status:needs discussion Issues needing discussion and a decision to be made before action can be taken type:refactor Issues about tackling technical debt labels May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:needs discussion Issues needing discussion and a decision to be made before action can be taken type:refactor Issues about tackling technical debt
Projects
None yet
Development

No branches or pull requests

1 participant