Browse Source

Add a readme in getting started with VSCode YAML Support

tags/v0.3.5-fix4
haixuanTao 1 year ago
parent
commit
558fa14907
3 changed files with 26 additions and 1 deletions
  1. +24
    -0
      libraries/core/README.md
  2. +1
    -1
      libraries/core/dora-schema.json
  3. +1
    -0
      libraries/core/src/bin/generate_schema.rs

+ 24
- 0
libraries/core/README.md View File

@@ -5,3 +5,27 @@
```bash
cargo run -p dora-core generate_schemas
```

## VSCode YAML Dataflow Support

We can pass the JSON Schema to VSCode [`redhat.vscode-yaml`](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) to enables features such as:

- Type validation
- Suggestions
- Documentation

### Getting started

1. Install [`redhat.vscode-yaml`](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml)

2. Open User Settings(JSON) in VSCode within `ctrl`+ `shift` + `p` search bar.

3. Add the following:

```json
"yaml.schemas": {
"https://raw.githubusercontent.com/dora-rs/dora/json-schemas/libraries/core/dora-schema.json": "/*"
},
```

And you should be set! 🔥

+ 1
- 1
libraries/core/dora-schema.json View File

@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Descriptor",
"title": "dora-rs specification",
"description": "Dataflow description",
"type": "object",
"required": [


+ 1
- 0
libraries/core/src/bin/generate_schema.rs View File

@@ -25,6 +25,7 @@ fn main() -> () {
}",
"true",
);
let raw_schema = raw_schema.replace("Descriptor", "dora-rs specification");

// Get the Cargo root manifest directory
let manifest_dir = env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR is not set");


Loading…
Cancel
Save