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

How can I use indent line in editor? #4

Open
EricTownsChina opened this issue Feb 23, 2024 · 4 comments
Open

How can I use indent line in editor? #4

EricTownsChina opened this issue Feb 23, 2024 · 4 comments
Assignees

Comments

@EricTownsChina
Copy link

I want to parse a big json and level is deep, how can I use indent line in my CodeEditor?

@MegatronKing
Copy link
Contributor

MegatronKing commented Feb 25, 2024

Beautify json? I think you should do it yourself and then set it to CodeEditor. The following is a code snippet.

String beautifyJson(String source) {
    const JsonDecoder decoder = JsonDecoder();
    final JsonEncoder encoder = JsonEncoder.withIndent(indent);
    return encoder.convert(decoder.convert(source));
  }

@EricTownsChina
Copy link
Author

Beautify json? I think you should do it yourself and then set it to CodeEditor. The following is a code snippet.

String beautifyJson(String source) {
    const JsonDecoder decoder = JsonDecoder();
    final JsonEncoder encoder = JsonEncoder.withIndent(indent);
    return encoder.convert(decoder.convert(source));
  }

截屏2024-03-03 00 34 08
Thank you for your reply! Actually I want to display the indentation line as shown in the picture. Can it be achieved?

@MegatronKing
Copy link
Contributor

It is not difficult to implement, but still need to write some code. I will complete this support in the next version.

@MegatronKing MegatronKing self-assigned this Mar 5, 2024
@EricTownsChina
Copy link
Author

N�ice! 😄

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

No branches or pull requests

2 participants