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

Beautify Cadence #72

Open
alxflw opened this issue Jan 26, 2022 · 3 comments
Open

Beautify Cadence #72

alxflw opened this issue Jan 26, 2022 · 3 comments
Labels
feature A new user feature or a new package API feedback

Comments

@alxflw
Copy link

alxflw commented Jan 26, 2022

Issue To Be Solved

Developers could oftentimes copy and paste or write code that is not well formatted. It becomes hard to read.

(Optional): Suggest A Solution

We might be able to agree on formatting conventions for Cadence and support beautification.

@alxflw alxflw added feature A new user feature or a new package API feedback labels Jan 26, 2022
@turbolent turbolent removed their assignment Jan 26, 2022
@turbolent
Copy link
Member

turbolent commented Jan 26, 2022

There is an issue tracking the development of a pretty printer for Cadence in the Cadence repo: onflow/cadence#209.

I have been working on an implementation in my spare and documented the status in the issue. It would be nice to finish it, it's ca 2/3 done.

Once Cadence exposes a pretty printing function, it could be exported from the Cadence language server, then used here in the Visual Studio Code, and other editors (e.g. the Playground).

@DylanTinianov DylanTinianov self-assigned this Jul 12, 2022
@jamietdavidson
Copy link

Bump - is there anything I can do to help this?

@turbolent
Copy link
Member

@jamietdavidson Cadence now includes a pretty-printer that is complete in the sense that it can format all code, though it does not retain comment at the moment. Once this last functionality is implemented (see onflow/cadence#308), the pretty-printing functionality could be added to the language server, then finally used from VS Code.
Help is much appreciated, the Cadence team can assist if you plan to contribute 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new user feature or a new package API feedback
Projects
None yet
Development

No branches or pull requests

4 participants