Skip to content

Conversation

@brunobergher
Copy link
Collaborator

@brunobergher brunobergher commented Jan 16, 2026

Motivation

Developing the extension in code-server environments (remote, containers, etc.) has been problematic because native file system watchers often fail to detect changes properly. This PR introduces a streamlined development workflow with polling-based file watching. May close ROO-398.

Changes

New pnpm serve command

  • Automatically installs code-server if missing
  • Symlinks the extension to code-server's extension directory for live development
  • Starts code-server on configurable port (default 8443)
  • Runs all file watchers in parallel with proper cleanup on exit

Improved file watching with chokidar

  • Replaced esbuild's native watcher in src/esbuild.mjs with chokidar for more reliable detection
  • Added new webview-ui/watch.mjs script for webview builds
  • Supports polling via CHOKIDAR_USEPOLLING and CHOKIDAR_INTERVAL env vars
  • Better handling of rebuild debouncing and error logging

Extension auto-reload enhancements

  • extension.ts now also watches compiled output (dist/extension.js and webview-ui/build)
  • Triggers reload when builds complete, not just when source changes

Configuration

  • Added serve command to .roo/roomotes.yml with port setting
  • Added chokidar dependency to webview-ui/package.json

Important

Introduces a code-server development workflow with improved file watching using chokidar for reliable change detection in remote environments.

  • New pnpm serve command:
    • Installs code-server if missing and symlinks the extension for live development.
    • Starts code-server on port 8443 and runs file watchers with cleanup on exit.
  • File Watching:
    • Replaces esbuild's native watcher with chokidar in src/esbuild.mjs for reliable detection.
    • Adds webview-ui/watch.mjs for webview builds with polling support.
    • Supports polling via CHOKIDAR_USEPOLLING and CHOKIDAR_INTERVAL env vars.
  • Extension Auto-Reload:
    • extension.ts watches dist/extension.js and webview-ui/build for reloads.
  • Configuration:
    • Adds serve command to .roo/roomotes.yml.
    • Adds chokidar dependency to webview-ui/package.json.

This description was created by Ellipsis for 9e91335. You can customize this summary. It will automatically update as commits are pushed.

@roomote
Copy link
Contributor

roomote bot commented Jan 16, 2026

Rooviewer Clock   See task on Roo Cloud

All issues resolved. The redundant problem matcher markers have been removed.

  • Remove redundant [esbuild-problem-matcher#...] markers in src/esbuild.mjs (lines 202-212) since the plugin already emits them
Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

Comment on lines 202 to 212
rebuildTimeout = setTimeout(async () => {
console.log(`[${name}] File ${eventType}: ${path.relative(srcDir, filePath)}`)
console.log(`[esbuild-problem-matcher#onStart]`)
try {
await Promise.all([extensionCtx.rebuild(), workerCtx.rebuild()])
console.log(`[esbuild-problem-matcher#onEnd]`)
} catch (err) {
console.error(`[${name}] Rebuild failed:`, err.message)
console.log(`[esbuild-problem-matcher#onEnd]`)
}
}, 200)
Copy link
Contributor

Choose a reason for hiding this comment

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

The manual [esbuild-problem-matcher#onStart] and [esbuild-problem-matcher#onEnd] markers here are redundant since the esbuild-problem-matcher plugin (lines 80-94) already emits these markers via esbuild's build.onStart() and build.onEnd() hooks. This causes duplicate markers in the output which could confuse VS Code problem matchers that expect balanced start/end pairs.

Suggested change
rebuildTimeout = setTimeout(async () => {
console.log(`[${name}] File ${eventType}: ${path.relative(srcDir, filePath)}`)
console.log(`[esbuild-problem-matcher#onStart]`)
try {
await Promise.all([extensionCtx.rebuild(), workerCtx.rebuild()])
console.log(`[esbuild-problem-matcher#onEnd]`)
} catch (err) {
console.error(`[${name}] Rebuild failed:`, err.message)
console.log(`[esbuild-problem-matcher#onEnd]`)
}
}, 200)
rebuildTimeout = setTimeout(async () => {
console.log(`[${name}] File ${eventType}: ${path.relative(srcDir, filePath)}`)
try {
await Promise.all([extensionCtx.rebuild(), workerCtx.rebuild()])
} catch (err) {
console.error(`[${name}] Rebuild failed:`, err.message)
}
}, 200)

Fix it with Roo Code or mention @roomote and request a fix.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@roomote pls fix

Copy link
Contributor

@roomote roomote bot Jan 26, 2026

Choose a reason for hiding this comment

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

Fixaroo Clock   See task on Roo Cloud

Fixed the reported issues. All local checks passed.

View commit | Revert commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

4 participants