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

How I can change version kubernetes schema from 1.22.4 to another

Open pilot513 opened this issue 2 years ago • 9 comments

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 ?

pilot513 avatar Apr 14 '22 15:04 pilot513

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" ]
  }
}

barn avatar May 26 '22 08:05 barn

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 avatar May 27 '22 20:05 pilot513

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

and autocomplete works

pilot513 avatar May 27 '22 20:05 pilot513

Can someone explain why that is?

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

pilot513 avatar May 27 '22 20:05 pilot513

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

barn avatar May 27 '22 20:05 barn

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

barn avatar May 27 '22 20:05 barn

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

pilot513 avatar May 28 '22 06:05 pilot513

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.

barn avatar May 28 '22 06:05 barn

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

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

pilot513 avatar May 28 '22 07:05 pilot513