Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to associate schemastore schema with a file path (nvim) #971

Open
1 of 4 tasks
serpro69 opened this issue May 23, 2024 · 1 comment
Open
1 of 4 tasks

Unable to associate schemastore schema with a file path (nvim) #971

serpro69 opened this issue May 23, 2024 · 1 comment

Comments

@serpro69
Copy link

serpro69 commented May 23, 2024

Describe the bug

I'm trying to setup liquibase json schema with yaml-language-server using nvim lsp-config for yamlls and I can't seem to get custom filepaths association to work

So I'm trying to set custom file pattern for liquibase json schema, which doesn't seem to be picked up.

These are the settings for the language server that sets up the yamlls via lspconfig:

  settings = {
    yaml = {
      schemaStore = {
        enable = false
      },
      schemas = {
        ["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*",
        ["https://json.schemastore.org/liquibase-3.2.json"] = {
          "/src/main/resources/*/changelog/*",
          "/src/main/resources/*/liquibase/*",
        },
      },
    },
  }

I've also tried setting schema like ["https://json.schemastore.org/liquibase-3.2.json"] = "/src/main/resources/*/liquibase/*" which results in the same behavior.

Despite registering custom file path for the schema, I'm still not getting it picked up at for the associated files.

Note that I explicitly disabled the schemaStore option for a test because that pulls all schemas by default and seems to set some default paths for each of those ? (E.g. when I enable schemaStore option, I get a usable association for files under src/main/resources/db/changelog, which seems to be a default somewhere?)

LSP Info reports the following:

 Press q or <Esc> to close this window. Press <Tab> to view server doc.
 
 Language client log: /home/sergio/.local/state/nvim/lsp.log
 Detected filetype:   yaml
 
 1 client(s) attached to this buffer: 
 
 Client: yamlls (id: 1, bufnr: [7, 3])
   filetypes:       yaml, yaml.docker-compose, yaml.gitlab
   autostart:       true
   root directory:  /home/sergio/Projects/wlcmtech/backend-poc
   cmd:             /home/sergio/.local/share/nvim/mason/bin/yaml-language-server --stdio
 
 Configured servers list: html, yamlls, tsserver, cssls, lua_ls

Is there anything I'm missing or how can I debug this further?

LspLog reports this:

[WARN][2024-05-23 09:03:57] ...lsp/handlers.lua:135	"The language server yamlls triggers a registerCapability handler for workspace/didChangeConfiguration despite dynamicRegistration set to false. Report upstream, this warning is harmless"

Expected Behavior

Should be able to associate schema with a file glob

Current Behavior

Unable to associate schema with a file glob

Steps to Reproduce

Environment

  • Windows
  • Mac
  • Linux
  • other (please specify)
@agorgl
Copy link
Contributor

agorgl commented May 29, 2024

Same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants