microsoft / azure-pipelines-language-server

A language server for Azure Pipelines YAML
37 stars 25 forks source link

Schema not recognizing YAML files in "tasks" dir #165

Open brianrobt opened 1 month ago

brianrobt commented 1 month ago

Hello,

I've been using the azure-pipelines-language-server for a couple of weeks, and noticed a weird issue where the YAML schema isn't recognizing YAML files in a directory named called "tasks". If I change the name of the directory to something like "stages", then the schema works. I think I've configured the schema correctly with Neovim. The snippet below is using yamlls, but I get the same issue when using azure-pipelines-language-server, too.

["yamlls"] = function()
  lspconfig["yamlls"].setup({
    capabilities = capabilities,
    root_dir = lspconfig.util.find_git_ancestor,
    single_file_support = true,
    settings = {
      filetypes = {},
      redhat = { telemetry = { enabled = false } },
      yaml = {
        schemaStore = {
      enable = false,
      url = "",
    },
    schemas = require("schemastore").yaml.schemas({
      replace = {
        ["Azure Pipelines"] = {
          description = "Azure Pipelines overridden",
          fileMatch = {
            "/azure-pipeline*.y*l",
        "/tasks/*.y*l",
        "/jobs/*.y*l",
        "stages/*.y*l",
          },
          name = "Azure Pipelines",
          url = "https://raw.githubusercontent.com/microsoft/azure-pipelines-vscode/master/service-schema.json",
        },
      },
        }),
    validate = { enable = true },
    completion = { enable = true },
    editor = {
      tabSize = 2,
    },
      },
    },
  })
end,

Screenshot of schema error:

Screenshot 2024-07-16 at 1 14 49 PM

Screenshot of schema error fixed:

Screenshot 2024-07-16 at 1 14 24 PM