-
Notifications
You must be signed in to change notification settings - Fork 874
feat(cli): support opening devcontainers in vscode #17189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
de4e8ca
to
c29d517
Compare
There was a problem hiding this 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 adds support for opening development containers in VS Code via the CLI. Key changes include:
- Updating the CLI documentation to include a new flag (-c, --container) for specifying the container name.
- Adding tests to cover various scenarios for opening VS Code in dev container mode.
- Updating the CLI command implementation to handle container-based logic and URL link generation for dev containers.
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
docs/reference/cli/open_vscode.md | Added documentation for the new container flag. |
cli/open_test.go | Introduced new tests for dev container support and behavior. |
cli/open.go | Implemented container flag handling and URL building tailored for dev containers. |
Files not reviewed (1)
- cli/testdata/coder_open_vscode_--help.golden: Language not supported
Comments suppressed due to low confidence (1)
cli/open.go:145
- Consider including the specified container name in the error message (e.g., 'no container found matching ') for improved clarity.
if (!foundContainer) {
fe73989
to
e8479f6
Compare
e8479f6
to
9cc49f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice tests!
cli/open.go
Outdated
if !ok { | ||
return xerrors.New("container missing `devcontainer.local_folder` label") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't happen in theory, but no harm to check.
- Invert an if-condition to reduce how nested the code was. - Hide `-c` flag for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice change and tests!
Closes #16427
Adds the option
-c,--container
toopen vscode
that allows opening VSCode into a running devcontainer.