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 diagnostics/formatting - support unsaved buffers #17098

Open
1 task done
krstp opened this issue Aug 29, 2024 · 2 comments
Open
1 task done

JSON diagnostics/formatting - support unsaved buffers #17098

krstp opened this issue Aug 29, 2024 · 2 comments
Labels
diagnostics Feedback for diagnostics, error messages, logs, etc editor Feedback for code editing, formatting, editor iterations, etc enhancement [core label] popovers Feedback for tooltips, syntax hints, info popups, toasts, etc tooling An umbrella label for language tools, linters, formatters, etc

Comments

@krstp
Copy link

krstp commented Aug 29, 2024

Check for existing issues

  • Completed

Describe the feature

When using JSON formatter I would like to see in the interface a pop-up window or a bubble that will communicate to the user what is wrong with the user provided snippet/code. Currently the formatter will just not proceed not providing really any user feedback.

If applicable, add mockups / screenshots to help present your vision of the feature

Screenshot 2024-08-29 at 11 38 15 AM

@krstp krstp added admin read Pending admin review enhancement [core label] triage Maintainer needs to classify the issue labels Aug 29, 2024
@notpeter
Copy link
Member

notpeter commented Sep 6, 2024

Not sure exactly what you're asking for. Currently if there's a JSON error, it shows a squiggly underline which shows the error on hover. Additionally you can open the Project Diagnostics Panel (cmd-shift-m or the little Red X in the lower left) and see all the errors at once. You can also use the editor: go to diagnostic / editor: go to previous diagnostic action (default bind of F8/shift-F8) to have them pop up inline.

Is your request that we put errors in a big red box? Or that it should be more persistent and show the error while you're editing until you've fixed it? Just want to be clear what you're looking for.

Screenshot 2024-09-06 at 14 43 38

@notpeter notpeter added editor Feedback for code editing, formatting, editor iterations, etc popovers Feedback for tooltips, syntax hints, info popups, toasts, etc diagnostics Feedback for diagnostics, error messages, logs, etc tooling An umbrella label for language tools, linters, formatters, etc and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Sep 6, 2024
@krstp
Copy link
Author

krstp commented Sep 11, 2024

Sorry for a late reply, other things took priority; just getting to it now.

In summary, after retesting, in latest release the issue boils down to the input MUST be saved into a file - such as in your example these are persistent/saved json files.

If the JSON paste is not saved but only pasted into untitled buffer, regardless of specifying the code type CMD+K M -> JSON, the code will not format. Only after saving the file the code "action" shows up as in your screenshot and I am able to format the code.

There were other tickets in the same fashion, I would need to look for them.

Core issue: often times I do not want to be saving the JSON input, I only want to format it ad-hoc for clarity of reading. In such cases paste of the output JSON buffer into ZED and ad-hoc formatting would really help. In current state, per latest ZED iterations, in order to prettify the code the json input needs to be saved.

I guess, this would make this ticket a request to be able to format an unsaved JSON buffer.

I hope this clarifies. Thanks for your follow up.

@notpeter notpeter changed the title JSON formatter - provide snipped/code error JSON formatter - support unsaved buffers Sep 16, 2024
@notpeter notpeter changed the title JSON formatter - support unsaved buffers JSON diagnostics/formatting - support unsaved buffers Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
diagnostics Feedback for diagnostics, error messages, logs, etc editor Feedback for code editing, formatting, editor iterations, etc enhancement [core label] popovers Feedback for tooltips, syntax hints, info popups, toasts, etc tooling An umbrella label for language tools, linters, formatters, etc
Projects
None yet
Development

No branches or pull requests

2 participants