-
Notifications
You must be signed in to change notification settings - Fork 30.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
make the timeout for formatOnSave configurable #43702
Conversation
@@ -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': { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
Any update on this @jrieken? |
+1 I was about to put up a PR for the same thing. |
Back from vacations... Too late for Feb-endgame but will take a look in March. |
There was a problem hiding this 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.
Fixes #41194
As reported by users of extensions for
TypeScript
,Python
,ruby
andgo
formatOnSave
-commands can take longer than the hard coded750 ms
, e.g. for large projects or complex commands.This removes the hardcoded value and instead makes it user configurable.