Skip to content

fixes https://github.com/microsoft/vscode/issues/291188#314713

Merged
meganrogge merged 1 commit intomicrosoft:mainfrom
Larsjep:dev/lje/fix_291188
May 8, 2026
Merged

fixes https://github.com/microsoft/vscode/issues/291188#314713
meganrogge merged 1 commit intomicrosoft:mainfrom
Larsjep:dev/lje/fix_291188

Conversation

@Larsjep
Copy link
Copy Markdown
Contributor

@Larsjep Larsjep commented May 6, 2026

This PR fixes #291188.

How to test:

  • Enable editor.formatOnSave, and set task.saveBeforeRun to "always".
  • Change a file and run a task. Observe that the modified file is correctly formatted before being saved.

Copilot AI review requested due to automatic review settings May 6, 2026 12:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses #291188 by changing how VS Code saves dirty editors before running (and rerunning) tasks so that save participants (e.g., format-on-save and codeActionsOnSave) run as expected, matching the behavior users see when starting a debug session.

Changes:

  • Update task “save before run” to use an explicit save reason so formatting/code actions run during the pre-task save.
  • Update task rerun flow to use the same explicit save reason when saving dirty editors.

Comment thread src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts
Comment thread src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts
Copy link
Copy Markdown
Collaborator

@meganrogge meganrogge left a comment

Choose a reason for hiding this comment

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

Thanks!

@meganrogge meganrogge added this to the 1.120.0 milestone May 8, 2026
@meganrogge meganrogge enabled auto-merge (squash) May 8, 2026 16:34
@meganrogge meganrogge merged commit 25035fb into microsoft:main May 8, 2026
29 of 30 checks passed
wpfleger96 added a commit to wpfleger96/vscode that referenced this pull request May 8, 2026
…2-not-clearing-terminal-title

* upstream/main:
  chat: hide plugin actions for synced customization items (microsoft#315320)
  fixes microsoft#291188 (microsoft#314713)
  sessions: restore last active session on reload (microsoft#315312)
  Replace "Agents app" with "Agents window" in user-facing strings (microsoft#315302)
  chat: remove 'Bridged' badge from MCP servers in AI Customizations UI (microsoft#315319)
  Add proposal for custom editor diff/merge priority
  agentHost: revert undefined-field omission, update tests instead
  sessions: fix Customizations single-entry width overflow (microsoft#315125)
  agentHost: rewrite Resource attachments and omit undefined fields
  agentHost: support image and blob user-message attachments
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.

Save on Build/Debug tasks doesn't format files

4 participants