Skip to content

[bug] manifest.json matches multiple schemas in catalog.json, cannot override #83

@jchook

Description

@jchook

Re: #58

By default, coc-json appears to load several unrelated schemas for manifest.json files and lints them all at once.

I have this in my coc-settings.json:

{
  "json.schemas": [
    {
      "fileMatch": ["manifest.json"],
      "url": "https://www.schemastore.org/webextension.json"
    }
  ]
}

And I have tried deleting ~/.config/coc/extensions/coc-json-data/json-schema-cache and restarting Coc.

The only way to stop it from loading/linting against several schemas is to disable the default schemas with "json.enableDefaultSchemas": false or "json.schemaDownload.enable": false, which is undesirable because the default schemas are important to have.

I have also tried a more specific fileMatch directive, e.g.

{
  "json.schemas": [
    {
      "fileMatch": ["browser-extension/src/manifest.json"],
      "url": "https://www.schemastore.org/webextension.json"
    }
  ]
}

Still, more than one unrelated schemas are loaded and I get unwanted/irrelevant errors like this:

Image

It is clear that the desired schema is loaded as well (property is not allowed, but is paradoxically well-documented!)

Image

As a side-note, it would be very helpful to see which schema is causing the warning/error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions