
# Language server

> **🚧 In development**
>
> The language server is not available in the preview yet.

The language server puts the problems **Save** would report into your editor as you type, and suggests your organization's activities and their inputs while you write. It works in any editor that can run a language server over standard input and output.

## What it shows

Problems are underlined in the file, with the same wording **Save** uses:

| Problem | Where it is underlined |
|---|---|
| The YAML is malformed | At the line and column of the mistake. |
| A key has the wrong kind of value, a step has no known kind, or a key appears twice | On the key or step at fault. A repeated key is marked on its second appearance. |
| An unknown activity, a reference such as `${build.output}` that points nowhere, or a condition that does not parse | On the exact word or expression, as **Save** judges it against your organization's activities and connections. |

A workflow with no problems shows none. Problems clear when you fix them and when you close the file.

## Suggestions and hover

In a workflow file the server suggests from your organization's own activities. It never offers anything your organization does not have.

| Where your cursor is | Suggestions | Hover |
|---|---|---|
| The value of `use:` | Every activity, narrowed by what you typed, with its package. | The activity's package, inputs and outputs. |
| A key under `with:` | The inputs of that activity, required ones first, each showing its type, whether it is required and its default. Inputs already written are left out. | The input's type, whether it is required, its default and its limits. |
| The value of an input that allows only fixed choices | The choices, matched on their value or their name. | The same as the input. |

Choosing a suggestion replaces the word under the cursor, adds the quotes a value needs, and for an input key adds the colon. Nothing is suggested for an activity your organization does not have, or inside a `${…}` reference. Suggestions are a convenience: **Save** still decides whether a workflow is valid.

If your organization's activities cannot be loaded, suggestions pause, you see one message saying why, and the server tries again shortly. Problems are still underlined.

## Setting it up

Start the server with no arguments as the language server for YAML files, and give it three settings:

| Setting | Meaning |
|---|---|
| `baseUrl` | Your Cruma Flow address, for example `https://flow.cruma.io`. |
| `org` | The organization whose activities and connections your workflows use. |
| `token` | An API token with at least the author role in that organization. |

The token stays in the editor session and is sent only to the address in `baseUrl`. It never appears in a message.

The server only looks at a file whose first non-blank line is the schema line for your address:

```yaml
# yaml-language-server: $schema=https://flow.cruma.io/api/schemas/workflow-definition.json
name: check-site
steps:
  - use: cruma.http.request
```

Other YAML files are left alone, so it is safe to leave the server on for every YAML file.

## When it cannot check

If a setting is missing, if Cruma Flow cannot be reached, or if the token is rejected, the schema line is underlined with a message saying which; suggestions are unavailable until it works. An empty list always means the workflow is fine.

See [Editor support](https://cruma.io/book/flow/building-workflows.md) for key completion and hover, which the published schema provides.

---

- Book: [Cruma Flow (Private preview)](https://cruma.io/book/flow.md)
- Previous: [Delivery & governance](https://cruma.io/book/flow/delivery-and-governance.md)
- Pages: [Home](https://cruma.io/home.md) · [Docs](https://cruma.io/docs.md) · [Pricing](https://cruma.io/pricing.md) · [Share localhost](https://cruma.io/share-localhost.md) · [Webhook testing](https://cruma.io/webhook-testing.md) · [Homelab](https://cruma.io/homelab.md) · [AI coding agents](https://cruma.io/ai-coding-agents.md) · [Cruma vs ngrok](https://cruma.io/ngrok-alternative.md) · [Cruma vs Cloudflare Tunnel](https://cruma.io/cloudflare-tunnel-alternative.md) · [Blog](https://cruma.io/blog.md)
