Skip to content

Publish .cargo/config.toml jsonschema to schemastore.org for editor  #12883

@loynoir

Description

@loynoir

Problem

.cargo/config.toml does not have jsonshema.

So editor can not use schemastore to support tab-completion and validation.

Proposed Solution

cargo team implement jsonschema, publish and maintain related jsonschema in https://github.com/SchemaStore/schemastore.

So editor can use schemastore to support tab-completion and validation.

Tasks

  • Added unstable-schema generation for Cargo.toml #14683
    • To generate the manifest.schema.json file, under the crates/cargo-util-schemas directory, run
      SNAPSHOTS=overwrite cargo test -F unstable-schema dump_manifest_schema
  • Add a config mod to cargo-util-schemas that has a top-level struct and re-exports any types shared with other parts of the crate, generating a schema
  • Migrate what structs we can from Cargo to cargo-util-schemas, being careful of non-trivial types, particularly InternedString

Future possibilities

  • Similarly migrate the Index and cargo metadata into their respective mods in cargo-util-schemas

Notes

  • doc

https://doc.rust-lang.org/cargo/reference/config.html

  • vcpkg

microsoft/vcpkg#34706

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-configurationArea: cargo config files and env varsC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions