Skip to content
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

Describe build schema setup for common tools #3220

Merged
merged 3 commits into from Dec 2, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
37 changes: 37 additions & 0 deletions docs/faq.md
Expand Up @@ -324,3 +324,40 @@ principle being making the tradeoff of worse build times for less resource
usage on the machine.

See also [Configuring the number of compiler processes](#configuring-the-number-of-compiler-processes).

## How can I setup my editor to work with `build.yaml` files?

A schema for valid keys and values in build configuration files is available on
[SchemaStore.org](https://www.schemastore.org/json/), but it is not assigned to
any file names by default. You can configure your editor to use the correct
schema.

### VS Code

When using VS Code, you can use the [YAML extension] by RedHat to validate the
schema of build configuration files.
Add the following snippet to your `settings.json` to use the correct schema for
`build.yaml` files:

```json
"yaml.schemas": {
"https://json.schemastore.org/dart-build": [
"build.yaml",
"*.build.yaml",
"build.*.yaml"
]
}
```

### IntelliJ-based editors (e.g. IDEA, Android Studio, Webstorm)

JetBrains IDEs have builtin support for YAML schema verification, but the
correct schema for `build.yaml` files needs to be configured here too.
To do so, open Settings and select "Languages & Frameworks", "Schemas and
DTDs" and "JSON Schema Mappings".
Add a new configuration with `https://json.schemastore.org/dart-build.json` as
a schema URL. The configuration should look similar to this:

![Schema configuration for IDEA based IDEs](images/idea_schema_config.png)

[YAML extension]: https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml
Binary file added docs/images/idea_schema_config.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.