Closed pedro757 closed 11 months ago
This is a good idea, I'm open to a PR adding this feature.
im using this to point to a local ado pipelines yaml schema:
schemas = vim.list_extend( { ['/path/to/custom-schemas/ado-pipelines.json'] = { 'ado/**/*.y*ml', '**/*azure*.y*ml', '**/*ado*.y*ml', '**/*ipeline*/**/*.y*ml', } }, require('schemastore').yaml.schemas() ),
This is a good idea, I'm open to a PR adding this feature.
Just confirming that this feature still doesn't exist correct?
@pixelprogrammer That's correct.
Hi. I'm looking to implement this. Is there a proposed API? I was thinking allowing file://
urls in the extra[].url
option. Would this work?
@Zachiah I actually just tested this with jsonls and it already works!
require('schemastore').json.schemas {
replace = {
['package.json'] = {
description = 'package.json overridden',
fileMatch = { 'package.json' },
name = 'package.json',
url = 'file:///tmp/packagejson-schema.json',
},
},
}
I haven't tested yamlls.
Interesting haha. So to be clear, assuming yamlls works, there is no longer anything to do here? I suppose we could write some kind of documentation for it at the very least?
I just tested yamlls and it works as well. Also, both jsonls and yamlls support raw paths like /tmp/foo/bar.json
as well as file URIs like file:///tmp/foo/bar.json
. I agree, we should update the docs to reflect this.
OK. Cool. Are you good with me making a PR to update the docs?
That would be great!
I'm contributing to the schemastore repo but I would like to see if my changes work before creating a PR. Is it possible to use a local schema?