coc-json icon indicating copy to clipboard operation
coc-json copied to clipboard

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

Open jchook opened this issue 7 months ago • 0 comments

Re: https://github.com/neoclide/coc-json/issues/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.

jchook avatar Jul 16 '25 00:07 jchook