Skip to content

Add configurable timeout for format on save #173382

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MarkZuber
Copy link
Contributor

Issue: #173381

This diff adds a configurable timeout for format on save. The default timeout is 3 seconds. If the format provider takes longer than this timeout, then the provider is canceled, the save proceeds, and the user is notified that the file was saved but may not be formatted due to a timeout.

To test this, set the timeout down low within the code (such as hardcode it to 100ms) and do a format on save. You should see the message. Note that the configuration shown to users is in seconds, so formatters may not timeout within 1sec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants