support yaml
I'm using .clang-format file, schemas provided by yamlls, and I have to add schemas manually.
Is it possible to support yaml?
Thans a lot!
Have you seen #3?
🤦♂️Sorry didn't search before issue!
It seems yaml.schemaStore.enable just provide the ability for client to ask for a schema list from yamlls. Then client can select one from the list, and set yaml.schemas accordingly. The implementation at client side do need quite a few code, maybe another plugin.
For me, I just want some schemas. I've tried the example code you mentioned in #3, but it didn't work for me. The format of yaml.schemas is different from json.schemas. I did some tweak and it works:
local json_schemas = require('schemastore').json.schemas {}
local yaml_schemas = {}
vim.tbl_map(function(schema)
yaml_schemas[schema.url] = schema.fileMatch
end, json_schemas)
require('lspconfig').yamlls.setup {
settings = {
yaml = {
schemas = yaml_schemas,
},
},
}
It will be convenient if this plugin could provide a builtin support, something like require('schemastore').yaml.schemas.
❤️Thanks.