Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"connor4312.esbuild-problem-matchers",
"ms-vscode.extension-test-runner"
"connor4312.esbuild-problem-matchers"
]
}
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
"packages/vscode/dist": true,
"packages/codev/dist": true
},
"files.watcherExclude": {
"**/.builders/**": true,
"**/node_modules/**": true
},
"search.exclude": {
"**/.builders/**": true,
"**/node_modules/**": true,
"packages/vscode/out": true,
"packages/vscode/dist": true,
"packages/codev/dist": true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
id: bugfix-1022
title: vscode-dev-config-exclude-buil
protocol: bugfix
phase: pr
plan_phases: []
current_plan_phase: null
gates:
pr:
status: approved
requested_at: '2026-06-12T23:15:12.240Z'
approved_at: '2026-06-12T23:30:41.187Z'
iteration: 1
build_complete: false
history: []
started_at: '2026-06-12T23:08:50.454Z'
updated_at: '2026-06-12T23:30:41.187Z'
pr_ready_for_human: false
20 changes: 20 additions & 0 deletions codev/state/bugfix-1022_thread.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Builder thread: bugfix-1022

VSCode dev config: exclude `.builders/` + `node_modules` from watch/search; drop Extension Test Runner recommendation (issue #1022).

## Investigate

Confirmed both pieces of the root cause by inspection:

- `.vscode/extensions.json` recommends `ms-vscode.extension-test-runner`. On workspaces with builder worktrees, its test discovery runs `rg --no-ignore --follow` globs that walk every `.builders/*/node_modules` pnpm symlink farm, pegging CPU.
- `.vscode/settings.json` has no `files.watcherExclude` block at all, and its `search.exclude` only covers `packages/*/out|dist` — nothing for `.builders/` or `node_modules`.
- `packages/vscode/vsc-extension-quickstart.md` line 14 tells devs to install recommended extensions including the test runner (and `amodio.tsl-problem-matcher`, which was never in `extensions.json`).

This is a config-only fix; no reproduction beyond inspection is possible or needed (the bug manifests as VSCode-host `rg` process storms, environmental).

Plan for fix phase:
1. Add `files.watcherExclude` and extend `search.exclude` in `.vscode/settings.json` with `**/.builders/**` and `**/node_modules/**`.
2. Remove `ms-vscode.extension-test-runner` from `extensions.json` recommendations (keep eslint + esbuild-problem-matchers; keep the file).
3. Fix quickstart line 14 to match actual recommendations. Keep the "Run tests" section's manual install link — installing the test runner deliberately when working on extension tests is still valid; the bug was the blanket recommendation.

No regression test is practical for editor config JSON; the verification is the config content itself.
52 changes: 52 additions & 0 deletions packages/codev/src/__tests__/bugfix-1022-vscode-dev-config.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/**
* Regression test for bugfix #1022: VSCode dev config must not walk the
* builder worktree farm.
*
* Two repo-provided pieces collided: `.vscode/extensions.json` recommended
* ms-vscode.extension-test-runner (whose test discovery runs
* `rg --no-ignore --follow` over the whole tree), and `.vscode/settings.json`
* had no watcher/search excludes for `.builders/` or `node_modules`. On a
* workspace with ~15 builder worktrees this pegged CPU for ~30s at a time.
*
* Guards:
* - extensions.json never re-recommends the test-runner extension
* - settings.json keeps `.builders` and `node_modules` excluded from both
* the file watcher and search
*/

import { describe, it, expect } from 'vitest';
import * as fs from 'node:fs';
import * as path from 'node:path';

// Resolve repo root (packages/codev -> repo root)
const repoRoot = path.resolve(__dirname, '..', '..', '..', '..');

function readJson(relPath: string): Record<string, unknown> | null {
const fullPath = path.join(repoRoot, relPath);
if (!fs.existsSync(fullPath)) {
return null;
}
return JSON.parse(fs.readFileSync(fullPath, 'utf-8'));
}

describe('bugfix-1022: VSCode dev config excludes the builder worktree farm', () => {
it('.vscode/extensions.json does not recommend ms-vscode.extension-test-runner', () => {
const extensions = readJson('.vscode/extensions.json');
expect(extensions, '.vscode/extensions.json must exist').not.toBeNull();

const recommendations = (extensions!.recommendations ?? []) as string[];
expect(recommendations).not.toContain('ms-vscode.extension-test-runner');
});

it('.vscode/settings.json excludes .builders and node_modules from watch and search', () => {
const settings = readJson('.vscode/settings.json');
expect(settings, '.vscode/settings.json must exist').not.toBeNull();

for (const section of ['files.watcherExclude', 'search.exclude'] as const) {
const excludes = settings![section] as Record<string, boolean> | undefined;
expect(excludes, `${section} must be present`).toBeDefined();
expect(excludes!['**/.builders/**'], `${section} must exclude **/.builders/**`).toBe(true);
expect(excludes!['**/node_modules/**'], `${section} must exclude **/node_modules/**`).toBe(true);
}
});
});
4 changes: 2 additions & 2 deletions packages/vscode/vsc-extension-quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

## Setup

* install the recommended extensions (amodio.tsl-problem-matcher, ms-vscode.extension-test-runner, and dbaeumer.vscode-eslint)
* install the recommended extensions (dbaeumer.vscode-eslint and connor4312.esbuild-problem-matchers)


## Get up and running straight away
Expand All @@ -33,7 +33,7 @@

## Run tests

* Install the [Extension Test Runner](https://marketplace.visualstudio.com/items?itemName=ms-vscode.extension-test-runner)
* Install the [Extension Test Runner](https://marketplace.visualstudio.com/items?itemName=ms-vscode.extension-test-runner). It is deliberately not in the workspace's recommended extensions: its test discovery walks the whole tree ignoring `.gitignore`, which is very expensive on workspaces containing `.builders/` worktrees. Install it only when working on extension tests.
* Run the "watch" task via the **Tasks: Run Task** command. Make sure this is running, or tests might not be discovered.
* Open the Testing view from the activity bar and click the Run Test" button, or use the hotkey `Ctrl/Cmd + ; A`
* See the output of the test result in the Test Results view.
Expand Down
Loading