Cruma
DashboardDownload

Private preview

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:

ProblemWhere it is underlined
The YAML is malformedAt 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 twiceOn 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 parseOn 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 isSuggestionsHover
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 choicesThe 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:

SettingMeaning
baseUrlYour Cruma Flow address, for example https://flow.cruma.io.
orgThe organization whose activities and connections your workflows use.
tokenAn 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-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 for key completion and hover, which the published schema provides.