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

Add one click format button #403

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

maizehsu
Copy link

TL;DR

Add a one click format button to the main editor.

What changed?

  • Add a utility function that formats file content based on file type.
  • Add a button UI in Toolbar that controls the formatting of the file content.

How to test?

Open a file under JSON, YAML or XML format and click format to see the change. Other file formats should stay the same after formatting.

JSON before format:

image

JSON after format:

image

YAML before format:

image

YAML after format:

image

XML before format:

image

XML after format:

image

Why make this change?

One click format or in the future configurable format on save could be a really handy feature when bulk editing files like JSON and yaml.

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.

None yet

1 participant