Skip to content
This repository was archived by the owner on Aug 18, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/wac-intellisense-demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@
"children": [
{
"path": "./workspaces/workspaces-as-code/templates.md"
},
{
"path": "./workspaces/workspaces-as-code/code-completion.md"
}
]
}
Expand Down
40 changes: 40 additions & 0 deletions workspaces/workspaces-as-code/code-completion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: "Workspace template code completion"
description: "Learn how to use code completion when creating workspace templates."
state: beta
---

Coder provides a [JSON Schema](https://json-schema.org/) for workspace templates
that enables code completion and syntax checking.

## Requirements

You must have the [YAML extension by Red
Hat](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml)
installed to use this feature.

## How to use

Create a file called `coder.yaml`, and add the following to the top (be sure to
replace the `<deployment_url>` placeholder with your Coder deployment URL):

```yaml
# yaml-language-server: $schema=https://<deployment_url>/api/private/template/schemas/wac.schema.json

# Write your YAML config here
```

At this point, you can use the code completion and syntax checking features.

## Keyboard shortcuts

Some keyboard shortcuts you may find helpful include:

- Document outlining (<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>O</kbd>)
- Auto completion (<kbd>Ctrl</kbd> + <kbd>Space</kbd>)

See the [YAML extension by Red Hat
docs](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml)
for additional shortcuts.

![Code Completion Demo](../../assets/wac-intellisense-demo.gif)
5 changes: 4 additions & 1 deletion workspaces/workspaces-as-code/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ version *0.2*.
Workspaces as code (WAC) allows you to define and create new workspaces using
**workspace templates**.

Workspace templates are written as YAML and have a `.yaml` or `.yml` extension.
Workspace templates are written in YAML and have a `.yaml` or `.yml` extension.
For assistance with creating your Coder YAML file, you can use the [template
intellisense](code-completion.md) feature.

Coder looks for your workspace template at the following path:

```text
Expand Down