olofk / fusesoc

Package manager and build abstraction tool for FPGA/ASIC development
BSD 2-Clause "Simplified" License
1.21k stars 246 forks source link

provide schema as json #696

Open WisniewskiP opened 5 months ago

WisniewskiP commented 5 months ago

currently schema is defined inside fusesoc/capi2/json_schema.py as a multi line string variable. to use schema outside fusesoc it would be easier to have it as standard JSON file.

Use case: for editing yaml files I'm using VSCode with redhat.vscode-yaml extension that supports json schema and provides validation inside editor.

at this moment I just saved schema info JSON file and then inside settings, I configured that *.core should use this schema. following setting are needed to make it work:

    "yaml.schemas": {
        "/path/to/fusesoc.schema.json": "*.core"
    },
    "files.associations": {
        "*.core": "yaml"
    }

after that I get suggestions and validation during editing of core file.