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

make the timeout for formatOnSave configurable #43702

Merged
merged 2 commits into from
Mar 2, 2018
Merged

make the timeout for formatOnSave configurable #43702

merged 2 commits into from
Mar 2, 2018

Conversation

buyology
Copy link
Contributor

@buyology buyology commented Feb 14, 2018

Fixes #41194

As reported by users of extensions for TypeScript, Python, ruby and go formatOnSave-commands can take longer than the hard coded 750 ms, e.g. for large projects or complex commands.

This removes the hardcoded value and instead makes it user configurable.

@@ -298,6 +298,12 @@ configurationRegistry.registerConfiguration({
'description': nls.localize('formatOnSave', "Format a file on save. A formatter must be available, the file must not be auto-saved, and editor must not be shutting down."),
'overridable': true,
'scope': ConfigurationScope.RESOURCE
},
'editor.formatOnSaveTimeout': {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting is editor-global, it will be hard for end user to figure out correct timeout as it depends on the language and the machine speed.

Copy link
Contributor Author

@buyology buyology Feb 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. Made it overridable, then at least every extension that identifies this as a potential issue can provide a sane default (and the user the opportunity to configure it for that specific usage).

@buyology
Copy link
Contributor Author

Any update on this @jrieken?

@prateek
Copy link

prateek commented Feb 23, 2018

+1 I was about to put up a PR for the same thing.

@jrieken jrieken added this to the March 2018 milestone Feb 26, 2018
@jrieken jrieken added the formatting Source formatter issues label Feb 26, 2018
@jrieken
Copy link
Member

jrieken commented Feb 26, 2018

Back from vacations... Too late for Feb-endgame but will take a look in March.

Copy link
Member

@jrieken jrieken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I will merge as soon as master is open for business again.

@jrieken jrieken added the feature-request Request for new features or functionality label Mar 2, 2018
@jrieken jrieken merged commit 41f7a57 into microsoft:master Mar 2, 2018
@jrieken jrieken added verification-needed Verification of issue is requested release-notes Release notes issues labels Mar 26, 2018
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality formatting Source formatter issues release-notes Release notes issues verification-needed Verification of issue is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Format Document working, editor.formatOnSave=true broken
4 participants