redhat-developer / yaml-language-server

Language Server for YAML Files
MIT License
1.1k stars 264 forks source link

Double exclamation mark "python" variable in YAML fails in NeoVim #990

Open metal3d opened 1 month ago

metal3d commented 1 month ago

Hello,

Using Mkdocs with Material, the YAML file should sometimes use this:

markdown_extensions:
  - pymdownx.highlight:
      anchor_linenums: true
  - pymdownx.superfences:
      custom_fences:
        - name: mermaid
          class: mermaid
          format: !!python/name:pymdownx.superfences.fence_code_format

But... NeoVim with nvim-lspconfig fails to accept the !!python tag:

image

I tried many configurations...

And a dozen of others. This fails. Yamls-language-server continuously says that there is an error in the YAML file.

This is the configuration I have now, still doesn't work:

return {
  {
    "neovim/nvim-lspconfig",
    opts = {
      servers = {
        yamlls = {
          settings = {
            yaml = {
              validate = true,
              customTags = { "!!python/name" },
            },
          },
        },
      },
    },
  },
}

Thanks if someone can help me.