Add VS Code Dev Containers plugin for Fresh editor#1110
Open
Add VS Code Dev Containers plugin for Fresh editor#1110
Conversation
Describes a TypeScript plugin that detects .devcontainer/devcontainer.json and provides in-editor info panels, lifecycle command execution, and feature/port browsing — all using existing Fresh plugin APIs. https://claude.ai/code/session_01H3A1ru38B68gxZpbt7cSJK
TypeScript plugin that detects .devcontainer/devcontainer.json and provides: - Status bar summary showing container name, image, features, and ports - Info panel (virtual buffer) with full config details and keybindings - Lifecycle command runner (onCreateCommand, postCreateCommand, etc.) - Feature and port browsing via command palette prompts - Quick open for the devcontainer.json config file - Optional rebuild command via devcontainer CLI Includes JSONC parser for comment/trailing-comma support and i18n translations for en, cs, de, es, fr, ja, ko, and zh-CN. https://claude.ai/code/session_01H3A1ru38B68gxZpbt7cSJK
- Fix: Use `devcontainer up --remove-existing-container` instead of the non-existent `devcontainer rebuild` subcommand - Add: Action popup when devcontainer CLI is not found, offering to copy the install command (npm i -g @devcontainers/cli) or dismiss - Add: Activation popup on editor startup when a devcontainer.json is detected, offering Show Info / Open Config / Dismiss - Add i18n strings for all new popups across all 8 locales https://claude.ai/code/session_01H3A1ru38B68gxZpbt7cSJK
On startup, the activation popup now checks for the devcontainer CLI: - If found: offers "Rebuild Container" (default) / "Show Info" / "Dismiss" - If not found: offers "Copy: npm i -g @devcontainers/cli" / "Show Info" / "Dismiss" This mirrors VS Code's behavior of prompting "Reopen in Container" as the primary action when a devcontainer.json is detected. https://claude.ai/code/session_01H3A1ru38B68gxZpbt7cSJK
New command palette entry "Dev Container: Open Terminal" that: 1. Checks for the devcontainer CLI (shows install popup if missing) 2. Probes the container with `devcontainer exec ... echo` to verify it's running 3. Opens a Fresh terminal split and sends `devcontainer exec` to get an interactive shell inside the container This completes the host-side workflow: detect -> rebuild -> open terminal. https://claude.ai/code/session_01H3A1ru38B68gxZpbt7cSJK
…g rebuild Info panel now has interactive buttons (Run Lifecycle, Open Config, Rebuild, Close) rendered with [bracket] focus indicators. Tab/Shift-Tab cycles between buttons, Enter activates the focused button. Alt+r/Alt+o/Alt+b provide direct keyboard shortcuts. Rebuild command now opens a terminal split streaming live build output instead of blocking silently. https://claude.ai/code/session_01H3A1ru38B68gxZpbt7cSJK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a comprehensive Dev Containers plugin for Fresh that detects and provides in-editor support for VS Code Dev Container configurations (
.devcontainer/devcontainer.json). The plugin surfaces container metadata, lifecycle commands, port forwarding info, and feature listings within Fresh's existing plugin UI patterns.Key Changes
New Plugin:
crates/fresh-editor/plugins/devcontainer.ts- A full-featured plugin (~760 lines) that:.devcontainer/devcontainer.jsonconfigurations on workspace loadDesign Documentation:
docs/internal/DEVCONTAINER_PLUGIN_DESIGN.md- Detailed 800-line design document covering:Internationalization:
crates/fresh-editor/plugins/devcontainer.i18n.json- Multi-language support (English, Czech, German, Spanish, French, Italian, Japanese, Portuguese, Russian, Chinese Simplified/Traditional) for all UI strings and status messagesNotable Implementation Details
.devcontainer/devcontainer.json,.devcontainer.json, and subdirectory configscreateVirtualBufferInSplit()API with custom mode definition and syntax highlighting via overlayseditor.spawnProcess()to execute container lifecycle scripts with live outputspawnProcess,readFile, and buffer management APIsThe plugin remains dormant if no devcontainer configuration is found, ensuring zero overhead for non-containerized workspaces.
https://claude.ai/code/session_01H3A1ru38B68gxZpbt7cSJK