Skip to content

Don't emit extensionsApiProposals if it has not changed#312287

Merged
mjbvz merged 1 commit intomainfrom
dev/mjbvz/little-prawn
Apr 24, 2026
Merged

Don't emit extensionsApiProposals if it has not changed#312287
mjbvz merged 1 commit intomainfrom
dev/mjbvz/little-prawn

Conversation

@mjbvz
Copy link
Copy Markdown
Collaborator

@mjbvz mjbvz commented Apr 24, 2026

This triggers our watcher scripts, causing an extra recompile on first watch

This triggers our watcher scripts, causing an extra recompile

Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings April 24, 2026 02:46
@mjbvz mjbvz enabled auto-merge April 24, 2026 02:46
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 prevents extensionsApiProposals.ts from being re-emitted when its generated contents are unchanged, avoiding an unnecessary file write that triggers watcher scripts and causes an extra recompile during initial watch.

Changes:

  • Add a read/compare step for src/vs/platform/extensions/common/extensionsApiProposals.ts and short-circuit emission when the contents match.
  • Centralize the generated output path into a filePath constant for emission.
Show a summary per file
File Description
build/lib/compilation.ts Skips emitting extensionsApiProposals.ts when unchanged to avoid triggering watchers/extra recompiles.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 1

Comment thread build/lib/compilation.ts
Comment on lines +342 to +345
const filePath = 'vs/platform/extensions/common/extensionsApiProposals.ts';
try {
const existing = fs.readFileSync(path.join('src', filePath), 'utf-8');
if (existing === contents) {
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

filePath is introduced here, but the function still hard-codes the same path earlier when reading for EOL detection (src/vs/platform/extensions/common/extensionsApiProposals.ts). Consider reusing filePath for that earlier read as well to avoid the two strings drifting if the file is ever moved/renamed.

Copilot uses AI. Check for mistakes.
@mjbvz mjbvz merged commit 3146146 into main Apr 24, 2026
30 checks passed
@mjbvz mjbvz deleted the dev/mjbvz/little-prawn branch April 24, 2026 03:07
@vs-code-engineering vs-code-engineering Bot added this to the 1.118.0 milestone Apr 24, 2026
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.

3 participants