Skip to content

Feature: Pre-Install VS Code extensions in desktop VS Code module - #218

Closed
yashksaini-coder wants to merge 10 commits into
coder:mainfrom
yashksaini-coder:feature/pre-install
Closed

yashksaini-coder wants to merge 10 commits into
coder:mainfrom
yashksaini-coder:feature/pre-install

Conversation

@yashksaini-coder

Copy link
Copy Markdown

/claim #207

Closes #207

Description

  • Add extensions parameter to automatically install the VS-Code extensions
  • Add settings parameter for workspace-specific configuration
  • Create setup.sh script to install extensions & settings management
  • Add validation for extension format (publisher.extension-name)
  • Update test to the coverage for new features
  • Support graceful fallback when VS Code CLI is unavailable

This pull request introduces functionality to automate the setup of Visual Studio Code (VS Code) workspaces, including the installation of extensions and configuration of workspace settings. It adds new Terraform variables and resources, a setup script, and corresponding tests to ensure proper behavior.

Terraform Module Enhancements:

  • Added extensions, settings, and install_extensions variables to allow users to specify VS Code extensions, workspace settings, and control automatic installation behavior. Validation ensures proper formatting for extensions. (registry/coder/modules/vscode-desktop/main.tf, registry/coder/modules/vscode-desktop/main.tfR41-R85)
  • Introduced a coder_script resource that dynamically creates a setup script to install extensions and configure settings when applicable. (registry/coder/modules/vscode-desktop/main.tf, registry/coder/modules/vscode-desktop/main.tfR41-R85)

Setup Script:

  • Implemented a comprehensive Bash script (setup.sh) to handle the installation of extensions, configuration of workspace settings, and creation of extension recommendations. The script includes robust error handling, logging, and validation mechanisms. (registry/coder/modules/vscode-desktop/setup.sh, registry/coder/modules/vscode-desktop/setup.shR1-R267)

Documentation Updates:

Testing:

Type of Change

  • New module
  • Bug fix
  • Feature/enhancement
  • Documentation
  • Other

Module Information

Path: registry/coder/modules/vscode-desktop
New version: v1.0.0
Breaking change: [ ] Yes [X] No

Testing & Validation

  • Tests pass (bun test)
  • Code formatted (bun run fmt)
  • Changes tested locally

Related Issues

None

@yashksaini-coder

Copy link
Copy Markdown
Author

@matifali can you please review the PR

fi
done

# Try to install VS Code Desktop (which provides the CLI)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Image

I think we only need the CLI and not the full VS Code.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@yashksaini-coder Another option is to not install the code CLI at all and direct download and place extensions VSIX files in the --extensions-dir directory.
We can take that as input to the moudle with a sane default.

Additionally, downloading extensions directly would work with Other VSCode-based IDEs, such as Cursor, WindSurf, and Kiro.

WDYT?

See: https://code.visualstudio.com/docs/configure/extensions/extension-marketplace#_command-line-extension-management

@matifali matifali left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@yashksaini-coder

Copy link
Copy Markdown
Author

@matifali understood let me work on this

@bpmct

bpmct commented Jul 19, 2025

Copy link
Copy Markdown
Member

Hey @yashksaini-coder - can you please submit a video of this working in a coder deployment once those fixes are made?

@yashksaini-coder

Copy link
Copy Markdown
Author

Hey @yashksaini-coder - can you please submit a video of this working in a coder deployment once those fixes are made?

I'm on windows and have performing testing on my code. Haven't been able to deploy properly

@yashksaini-coder
yashksaini-coder deleted the feature/pre-install branch July 21, 2025 08:34
@yashksaini-coder

Copy link
Copy Markdown
Author

@matifali @bpmct I will close this PR, and start again on scratch, discontinued in middle due to end sem exams. so going to start fresh.

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.

Pre-install VS Code extensions in desktop VS Code module

3 participants