neoclide / coc-yaml

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

Kubernetes schema not working #49

Closed wostal closed 2 years ago

wostal commented 3 years ago

Hi. I'm trying to configure completion for k8s manifests, but with no luck. I have tried various settings eg.

"yaml.schemas": {
            "url": "globPattern",
            "Kubernetes": "globPattern"
    },

and

"yaml.schemas": {
    "kubernetes": ["/*.yaml"]
}

without success. What could be the cause?

I'm using neovim

NVIM v0.4.3
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -g -O2 -fdebug-prefix-map=/build/neovim-gOb7vg/neovim-0.4.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=1 -DDISABLE_LOG -Wdate-time -D_FORTIFY_SOURCE=1 -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim-gOb7vg/neovim-0.4.3/build/config -I/build/neovim-gOb7vg/neovim-0.4.3/src -I/usr/include -I/usr/include/lua5.1 -I/build/neovim-gOb7vg/neovim-0.4.3/build/src/nvim/auto -I/build/neovim-gOb7vg/neovim-0.4.3/build/include
Compiled by team+vim@tracker.debian.org

Vim's config is pure, taken from coc-nvim help.

CocConfig:

  {
    "languageserver": {
        "golang": {
          "command": "gopls",
          "rootPatterns": ["go.mod"],
          "filetypes": ["go"]
        }
    },

    "yaml.schemas": {
            "url": "globPattern",
            "Kubernetes": "globPattern"
    },
    "coc.preferences.extensionUpdateCheck": "daily",
    "yaml.completion": true,
    "yaml.validate": true,
    "yaml.trace.server": "verbose",
    "yaml.schemaStore.enable": true,
    "yaml.schemaStore.url": "https://www.schemastore.org/api/json/catalog.json",
    "yaml.disableAdditionalProperties": false
  }
chemzqm commented 2 years ago

Use:

  "yaml.schemas": {
    "kubernetes": ["/*.yaml"]
  },

in your coc-settings.json.

It works sometimes, seems network issue.

Unable to load schema from 'https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.20.5-standalone-strict/all.json': connect ETIMEDOUT 185.199.108.133:443.
[YAML: 768]