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

Formatter v2 part 4: Core algorithm #10673

Merged
merged 19 commits into from
May 13, 2023
Merged

Formatter v2 part 4: Core algorithm #10673

merged 19 commits into from
May 13, 2023

Conversation

shenglol
Copy link
Contributor

@shenglol shenglol commented May 11, 2023

Closes #7155.

This implements the pretty-printing algorithm described in chapter 2 and 3 of A pretty printer by Philip Wadler (the v1 formatter only implements chapter 1). The new implementation adds new classes under src/Bicep.Core/PrettyPrintV2, and the existing v1 formatter is not removed, since I'm planning to make the v2 formatter an experimental feature for now. I still need to create some follow-up PRs to do the following:

  • Add baseline tests for each dataset
  • Add an experimental feature config for pretty-printing
  • Add pretty-printing related settings to Bicep configs, Bicep VS Code extension configs, and potentially .editorconfig
  • Update the VS Code extension to forward pretty-printing related settings to the language server (or use workspace_configuration instead)
  • Update BicepDocumentFormattingHandler
  • Implement range formatting
Microsoft Reviewers: Open in CodeFlow

Copy link
Member

@majastrz majastrz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@shenglol shenglol enabled auto-merge (squash) May 13, 2023 03:07
@shenglol shenglol merged commit 4f03900 into main May 13, 2023
@shenglol shenglol deleted the shenglol/pretty-printer-v2 branch May 13, 2023 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement a prettier formatter
2 participants