neoclide / coc-yaml

Yaml language server extension for coc.nvim
MIT License
248 stars 23 forks source link

How I can change version kubernetes schema from 1.22.4 to another #61

Open pilot513 opened 2 years ago

pilot513 commented 2 years ago

In last update I found that in coc-yaml used KUBERNETES_SCHEMA_URL="https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.22.4-standalone-strict/all.json"

How is it possible to change, for example, to 1.19.7 or 1.23.5 ?

barn commented 2 years ago

Did adding this JSON to your :CocConfig (~/.vim/coc-settings.json for me) work at all? It's vaguely working for me I think.

{
  "yaml.schemas": {
          "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.5-standalone-strict/all.json": [ "/*.yaml" ]
  }
}
pilot513 commented 2 years ago

My coc-settings.json looks like that: изображение But when I start typing, the autocomplete doesn't work: изображение

When I start editing the settings file, autocomplete works. I don't understand what is wrong with the yaml schema: изображение Can someone please explain why the above schema doesn't work with yaml???

pilot513 commented 2 years ago

By default settings schema ("kubernetes": "/*.yaml" (1.22.4) изображение

and autocomplete works

pilot513 commented 2 years ago

Can someone explain why that is?

So, the schema 1.23.5 is accessed: изображение

barn commented 2 years ago

what path is it set to? "/*.yaml"

barn commented 2 years ago

no idea how YAML will handle the bare string, so try quoting it in "?

pilot513 commented 2 years ago

So everything is, in doublequotation marks. It's just that the coc-json plugin does not display them: изображение

barn commented 2 years ago

Screenshot 2022-05-27 at 23 24 01

is what I appear to have with:

{

  // https://github.com/dense-analysis/ale#faq-coc-nvim
  "diagnostic.displayByAle": true,

  // no idea if these even arent default.
  "yaml.completion": true,
  "yaml.format": true,
  "yaml.validate": true,
  "yaml.schemaStoreEnabled": true,
  "json.format.enable": true,

  // https://octetz.com/c/vim-k8s-yaml-support/
  "yaml.schemas": {
     // Use https://github.com/yannh/kubernetes-json-schema as they're actually updated.
     "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.5-standalone-strict/all.json": [ "/*.yaml" ]

     // Local copy of above, purely so it has a better filename in coc-yaml
     // "//Users/bea/.vim/k8s-v1.22.4-standalone-strict.json": [ "/*.yaml" ]
  }
}

This is my :CocInfo

## versions

vim version: VIM - Vi IMproved 8.2 8025000
node version: v18.2.0
coc.nvim version: 0.0.81-21a8e00b 2022-05-26 03:12:31 +0800
coc.nvim directory: /Users/bea/.vim/plug/coc.nvim
term: iTerm.app
platform: darwin

If that helps at all? Though I am not sure I have been any.

pilot513 commented 2 years ago

Oh, thank you very much! Earned! изображение

The difference is in the options: изображение