-
Notifications
You must be signed in to change notification settings - Fork 59
feat: Pre-install VS Code extensions and settings #376
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
Open
Pranith124
wants to merge
2
commits into
coder:main
from
Pranith124:feat/207-vscode-preinstall-extensions
+140
−12
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
47 changes: 37 additions & 10 deletions
registry/coder/modules/vscode-desktop/README.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,63 @@ | ||
--- | ||
display_name: VS Code Desktop | ||
description: Add a one-click button to launch VS Code Desktop | ||
description: Add a one-click button to launch VS Code Desktop with pre-installed extensions and settings. | ||
icon: ../../../../.icons/code.svg | ||
verified: true | ||
tags: [ide, vscode] | ||
--- | ||
|
||
# VS Code Desktop | ||
|
||
Add a button to open any workspace with a single click. | ||
Add a button to open any workspace with a single click. This module can also pre-install VS Code extensions and apply custom settings for a ready-to-code environment. | ||
|
||
Uses the [Coder Remote VS Code Extension](https://github.com/coder/vscode-coder). | ||
It uses the [Coder Remote VS Code Extension](https://github.com/coder/vscode-coder). | ||
|
||
## Basic Usage | ||
|
||
```tf | ||
module "vscode" { | ||
count = data.coder_workspace.me.start_count | ||
source = "registry.coder.com/coder/vscode-desktop/coder" | ||
version = "1.1.1" | ||
source = "[registry.coder.com/coder/vscode-desktop/coder](https://registry.coder.com/coder/vscode-desktop/coder)" | ||
version = "1.2.0" # Or latest version | ||
agent_id = coder_agent.example.id | ||
} | ||
``` | ||
|
||
## Examples | ||
|
||
### Open in a specific directory | ||
|
||
```tf | ||
module "vscode" { | ||
count = data.coder_workspace.me.start_count | ||
source = "registry.coder.com/coder/vscode-desktop/coder" | ||
version = "1.1.1" | ||
source = "[registry.coder.com/coder/vscode-desktop/coder](https://registry.coder.com/coder/vscode-desktop/coder)" | ||
version = "1.2.0" # Or latest version | ||
agent_id = coder_agent.example.id | ||
folder = "/home/coder/project" | ||
} | ||
``` | ||
|
||
## Pre-install extensions and apply settings | ||
|
||
```tf | ||
module "vscode" { | ||
source = "[registry.coder.com/coder/vscode-desktop/coder](https://registry.coder.com/coder/vscode-desktop/coder)" | ||
version = "1.2.0" # Or latest version | ||
agent_id = coder_agent.example.id | ||
folder = "/home/coder/project" | ||
|
||
# A list of extension IDs from the VS Code Marketplace to install on startup. | ||
extensions = [ | ||
"ms-python.python", | ||
"golang.go", | ||
"hashicorp.terraform", | ||
"esbenp.prettier-vscode" | ||
] | ||
|
||
# A map of settings that will be converted to JSON | ||
# and written to the settings file. Use the jsonencode function for this. | ||
settings = jsonencode({ | ||
"editor.fontSize": 14, | ||
"terminal.integrated.fontSize": 12, | ||
"workbench.colorTheme": "Default Dark+", | ||
"editor.formatOnSave": true | ||
}) | ||
} | ||
``` |
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
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
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.