Skip to content

Extra schemas are ignored for yamlls #49

Description

@varac

I want to add extra schemas to yamlls, but it doesn't seem to work.
Here's a minimal config to reproduce:

vim.lsp.config("yamlls", {
  settings = {
    yaml = {
      schemaStore = {
        enable = false,
        url = "",
      },
      schemas = require("schemastore").yaml.schemas({
        select = {
          "gitlab-ci",
        },
        extra = {
          {
            name = "Flux HelmRelease",
            description = "https://github.com/fluxcd-community/flux2-schemas",
            url = "https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/helmrelease-helm-v2beta2.json",
            fileMatch = { "hr.yaml", "*-release.yaml" },
          },
        },
      }),
    },
  },
})
vim.lsp.enable("yamlls")

Here's what LspInfo shows:

==============================================================================
vim.lsp:                                                                    ✅

- LSP log level : WARN
- Log path: /home/varac/.local/state/nvim/lsp.log
- Log size: 66835 KB

vim.lsp: Active Clients ~
- yamlls (id: 2)
  - Version: ? (no serverInfo.version response)
  - Root directory: nil
  - Command: { "yaml-language-server", "--stdio" }
  - Settings: {
      redhat = {
        telemetry = {
          enabled = false
        }
      },
      yaml = {
        format = {
          enable = true
        },
        schemaStore = {
          enable = false,
          url = ""
        },
        schemas = {
          ["https://gitlab.com/gitlab-org/gitlab-foss/-/raw/master/app/assets/javascripts/editor/schema/ci.json"] = { "**/.gitlab-ci.yml", "**/.gitlab-ci.yaml", "**/*.gitlab-ci.yml", "**/*.gitlab-ci.yaml" },
          ["https://www.schemastore.org/kustomization.json"] = { "kustomization.yaml", "kustomization.yml" }
        },
        validate = {
          enable = true
        }
      }
    }
  - Attached buffers: 1

...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions