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

Move formatting to server side #300

Closed
antico5 opened this issue Nov 29, 2022 · 2 comments · Fixed by #429
Closed

Move formatting to server side #300

antico5 opened this issue Nov 29, 2022 · 2 comments · Fixed by #429
Labels
status:ready This issue is ready to be worked on type:feature New feature or request

Comments

@antico5
Copy link
Collaborator

antico5 commented Nov 29, 2022

Right now we are executing code formatting (prettier/forge fmt) on the client side. We could move that to the server side by implementing the textDocument/willSaveWaitUntil method, or the textDocument/formatting method (probably VSCode issues the latter when the "format on save" setting is enabled)

@kanej
Copy link
Member

kanej commented Dec 20, 2022

Our support for forge fmt is run on the command line. It takes formatting settings from the context it is executed in.

The PR #316 changes the context to run forge fmt in the root of the workspace folder.

On moving formatting to server side we would have the option to leverage project information to run the formatting command in the folder where the forge.toml file exists, supporting formatting rules across a monorepo for instance.

@kanej
Copy link
Member

kanej commented Dec 21, 2022

vim.coc supports the format command. So if we add it to the language server, vim gets it as well.

@kanej kanej added type:feature New feature or request priority:medium status:ready This issue is ready to be worked on labels Jan 2, 2023
@kanej kanej moved this to Todo in hardhat-vscode Jan 2, 2023
@kanej kanej removed the status in hardhat-vscode Jan 4, 2023
@kanej kanej moved this to Todo in hardhat-vscode Mar 13, 2023
@antico5 antico5 moved this from Todo to In Progress in hardhat-vscode Mar 13, 2023
@kanej kanej moved this from In Progress to In Review in hardhat-vscode Mar 21, 2023
@github-project-automation github-project-automation bot moved this from In Review to Done in hardhat-vscode Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready This issue is ready to be worked on type:feature New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants