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

JSON / YAML auto-formatting #10

Open
jhalterman opened this issue Jan 25, 2018 · 6 comments
Open

JSON / YAML auto-formatting #10

jhalterman opened this issue Jan 25, 2018 · 6 comments

Comments

@jhalterman
Copy link

I really like the JSON / YAML modes and was wondering if it would make sense to offer an auto-formatting option based on the mode where text is formatted to be more readable according to the mode.

@elkozmon
Copy link
Owner

Certainly, I will try to add this feature in the next version.
Btw I was also thinking about automatic mode recognition.

@elkozmon elkozmon added this to the 0.4.0 milestone Jan 26, 2018
@jhalterman
Copy link
Author

Auto recognizing sounds good. I would have the formatting be optional, enabled via a button though, since some people may not want to save formatted code to their ZNode.

elkozmon added a commit to elkozmon/zoonavigator-web that referenced this issue Apr 2, 2018
@jhalterman
Copy link
Author

Using Zoonavigator heavily right now and wondering again about auto-formatting. Did you end up doing anything with this?

For me, every time I open a znode the first thing I do is change the format to JSON then hit reformat. Doing this over and over, it gets old :)

@elkozmon
Copy link
Owner

Yes and no. You shouldn't have to change the format every time you open a znode as ZooNavigator now remembers which format was used for which node. However, there is no option that reformats the data for you automatically. I refrain from putting it in as a default option because for some it might be more reasonable to keep the data small rather than nice. I could, however, put it in as another toggle button or sth. Would that work for you?

@jhalterman
Copy link
Author

jhalterman commented Dec 17, 2018

I agree, that auto-formatting would be bad for some cases. It would be nice to have as a toggle though, so when I just want to browse data I can see it formatted without having to manually format. It might make sense if auto-formatted data doesn't prompt a user to save though, only a change made by the user should prompt to save. That way the auto-formatted data is never saved automatically.

@elkozmon
Copy link
Owner

I see. I haven't really thought about just browsing the nodes. Rather, I thought about it more like Format on save feature. I agree with you tho, it would certainly be a nice thing to have. I'm reopening this and hopefully will be able to look into it soon. It might be tricky to implement using the current formatter exactly because of what you've described, prompting user to save etc.

@elkozmon elkozmon reopened this Dec 17, 2018
@elkozmon elkozmon removed this from the 0.4.0 milestone Jan 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants