-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[editor] Format the text on saved. #3338
Comments
Seems to work when only reformat is selected if there is some extra char at end of line and re-format, then no. Also, may need two save to reset the dirty flag, seems the re-format occurs after and make the file dirty again. Signed-off-by: Jacques Bouthillier <jacques.bouthillier@ericsson.com>
Seems to work when only reformat is selected if there is some extra char at end of line and re-format, then no. Also, may need two save to reset the dirty flag, seems the re-format occurs after and make the file dirty again. Signed-off-by: Jacques Bouthillier <jacques.bouthillier@ericsson.com>
Format on Save is only available when the preference autoSave is "OFF" and the preference 'editor.formatOnSave' is "true" Signed-off-by: Jacques Bouthillier <jacques.bouthillier@ericsson.com>
Format on Save is only available when the preference autoSave is "OFF" and the preference 'editor.formatOnSave' is "true" Signed-off-by: Jacques Bouthillier <jacques.bouthillier@ericsson.com>
Format on Save is only available when the preference autoSave is "OFF" and the preference 'editor.formatOnSave' is "true" Signed-off-by: Jacques Bouthillier <jacques.bouthillier@ericsson.com>
Format on Save is only available when the preference autoSave is "OFF" and the preference 'editor.formatOnSave' is "true" Signed-off-by: Jacques Bouthillier <jacques.bouthillier@ericsson.com>
Format on Save is only available when the preference autoSave is "OFF" and the preference 'editor.formatOnSave' is "true" Signed-off-by: Jacques Bouthillier <jacques.bouthillier@ericsson.com>
Format on Save is only available when the preference autoSave is "OFF" and the preference 'editor.formatOnSave' is "true" Signed-off-by: Jacques Bouthillier <jacques.bouthillier@ericsson.com>
Format on manual Save when the preference 'editor.formatOnSave' is "true" Signed-off-by: Jacques Bouthillier <jacques.bouthillier@ericsson.com>
Great suggestion! Having an option to do this would be nice. This could be used for example to run Prettier on Save (but since this is opinionated, I think it should be a configuration option). |
Format on manual Save when the preference 'editor.formatOnSave' is "true" Signed-off-by: Jacques Bouthillier <jacques.bouthillier@ericsson.com>
Prettier is designed to be integrated into editors to format on save. It has many existing editor integrations. Running it automatically on save would be a big help for Shields contributors (badges/shields#2783), and similarly for any other project using Prettier. |
Format on manual Save when the preference 'editor.formatOnSave' is "true" Signed-off-by: Jacques Bouthillier <jacques.bouthillier@ericsson.com>
Exciting! @paulmelnikow If I understand @lmcbout's pull request correctly, we "just" need to somehow hook the EDIT: I'll look into how this can be automated for Shields on Gitpod. |
See also gitpod-io/gitpod#408 |
is there a way to format with prettier on save now? Was trying: "[javascript]": {
"editor.formatOnSave": true
} but not working |
@sojohnnysaid I think you may also want to install https://github.com/prettier/prettier-vscode in Theia, e.g. by downloading a EDIT: You could download it from https://open-vsx.org/extension/esbenp/prettier-vscode |
When editing in any editors, on saved, the data inside the file should be formatted. The text should be aligned.
The text was updated successfully, but these errors were encountered: