Skip to content

Existing Dev Container schema references VSCode-specific extensions #5310

@JakePi3

Description

@JakePi3

Area with issue?

JSON Schema

✔️ Expected Behavior

When using neovim to edit a local devcontainer.json file, if neovim is properly configured, I would expect schema validation to work.

❌ Actual Behavior

No schema validation is done and a single warning is issued Unable to load schema from 'vscode://schemas/setting/machine': Method not found.

One possible fix is to replace the schema location of https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.schema.json with https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.base.schema.json

One workaround I have found is to set the $schema manually inside devcontainer.json to reference the base schema.

JSON, YAML, or TOML file that does not work.

Contents of https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.schema.json:

{
    "allOf": [
        {
            "$ref": "./devContainer.base.schema.json"
        },
        {
            "$ref": "https://raw.githubusercontent.com/microsoft/vscode/main/extensions/configuration-editing/schemas/devContainer.codespaces.schema.json"
        },
        {
            "$ref": "https://raw.githubusercontent.com/microsoft/vscode/main/extensions/configuration-editing/schemas/devContainer.vscode.schema.json"
        }
    ]
}

The last file is causing the issue since it contains vscode specific URIs.

IDE or code editor.

Other

Are you making a PR for this?

No, someone else must create the PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedissue:bugReport errors or unexpected behavior (auto-generated by issue forms)

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions