Skip to content

fix(beautify): skip beautify-on-save for file types with no provider - #3109

Merged
abose merged 1 commit into
mainfrom
ai
Aug 17, 2026
Merged

fix(beautify): skip beautify-on-save for file types with no provider#3109
abose merged 1 commit into
mainfrom
ai

Conversation

@abose

@abose abose commented Aug 17, 2026

Copy link
Copy Markdown
Member

_beautifyOnSave only checked the global on/off preference before running the beautify command, not whether any provider was actually registered for the saved file's language. Saving a file type with no beautify provider (eg. plain text) unconditionally attempted to beautify, which failed and surfaced an error popover on every save.

Guard with the same _getEnabledProviders() check already used to enable/disable the manual Beautify command, so unsupported file types silently no-op on save instead.

Fixes #3103

Also adds a safety-net afterEach in BeautificationManager-test.js that resets "beautify on save" if a test leaves it toggled on, and a new integration suite (Beautify-integ-test.js) that exercises the real save -> documentSaved -> beautify-on-save flow end to end, covering both the no-provider no-op case and the happy path.

_beautifyOnSave only checked the global on/off preference before
running the beautify command, not whether any provider was actually
registered for the saved file's language. Saving a file type with no
beautify provider (eg. plain text) unconditionally attempted to
beautify, which failed and surfaced an error popover on every save.

Guard with the same _getEnabledProviders() check already used to
enable/disable the manual Beautify command, so unsupported file types
silently no-op on save instead.

Fixes #3103

Also adds a safety-net afterEach in BeautificationManager-test.js that
resets "beautify on save" if a test leaves it toggled on, and a new
integration suite (Beautify-integ-test.js) that exercises the real
save -> documentSaved -> beautify-on-save flow end to end, covering
both the no-provider no-op case and the happy path.
@sonarqubecloud

Copy link
Copy Markdown

@abose
abose merged commit 99b3858 into main Aug 17, 2026
12 of 21 checks passed
@abose
abose deleted the ai branch August 17, 2026 08:22
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.

txt files shouldn't give failed beautify popup

1 participant