Eglot + yaml-language-server #918
-
Hi folks, I'm trying to get my project nicely setup with After a few hours of fiddling & learning, I managed to configure the ((yaml-mode
. ((eglot-workspace-configuration
. ((yaml schemas . ((Kubernetes . (["/k8s/**/*.yaml"])))
)))))) I am checking that the format makes sense by running {
"yaml": {
"schemas": {
"Kubernetes": ["/k8s/**/*.yaml"]
}
}
} However the trouble comes when I want to add an additional schema: ((yaml-mode
. ((eglot-workspace-configuration
. ((yaml schemas . ((https://json.schemastore.org/kustomization.json . (["/k8s/**/kustomization.yaml"])) .
(Kubernetes . (["/k8s/**/*.yaml"])))
))))) Which produces: {
"yaml": {
"schemas": {
"https://json.schemastore.org/kustomization.json": [
"kustomization.yaml"
]
},
"kubernetes": [
"*.yaml"
]
}
} I can't figure out how to produce the correct structure of JSON: the "kubernetes" and "https://json.schemastore.org/kustomization.json" keys should be siblings. I've been staring at it for hours and I haven't been able to move forward - would someone be so kind as to point me in the right direction? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I don't know if this is still relevant. I also don't have the slightest idea why this works but this seems to create the correct json: ((yaml-mode . ((eglot-workspace-configuration . ((yaml schemas . ((
https://raw.githubusercontent.com/ansible-community/schemas/main/f/ansible.json\#/definitions/playbook "/DMZ/kafka/provision/playbooks/*.yml"
https://raw.githubusercontent.com/ansible-community/schemas/main/f/ansible-inventory.json "/DMZ/kafka/provision/hosts_*.yml"
https://raw.githubusercontent.com/ansible-community/schemas/main/f/ansible.json\#/definitions/tasks [
"/DMZ/kafka/provision/roles/*/tasks/*.yml"
"/DMZ/kafka/provision/roles/*/handlers/*.yml"
"/DMZ/kafka/provision/tests/smoke/tasks/**/*.yml"
]
https://raw.githubusercontent.com/ansible-community/schemas/main/f/ansible-meta.json "/DMZ/kafka/provision/roles/*/meta/*.yml"
https://raw.githubusercontent.com/ansible-community/schemas/main/f/ansible-vars.json [
"/DMZ/kafka/provision/roles/*/vars/*.yml"
"/DMZ/kafka/provision/playbooks/vars/**/*.yml"
]
))
))
)))) The result is {
"yaml":{
"schemas":{
"https://raw.githubusercontent.com/ansible-community/schemas/main/f/ansible.json#/definitions/playbook":"/DMZ/kafka/provision/playbooks/*.yml",
"https://raw.githubusercontent.com/ansible-community/schemas/main/f/ansible-inventory.json":"/DMZ/kafka/provision/hosts_*.yml",
"https://raw.githubusercontent.com/ansible-community/schemas/main/f/ansible.json#/definitions/tasks":[
"/DMZ/kafka/provision/roles/*/tasks/*.yml",
"/DMZ/kafka/provision/roles/*/handlers/*.yml",
"/DMZ/kafka/provision/tests/smoke/tasks/**/*.yml"
],
"https://raw.githubusercontent.com/ansible-community/schemas/main/f/ansible-meta.json":"/DMZ/kafka/provision/roles/*/meta/*.yml",
"https://raw.githubusercontent.com/ansible-community/schemas/main/f/ansible-vars.json":[
"/DMZ/kafka/provision/roles/*/vars/*.yml",
"/DMZ/kafka/provision/playbooks/vars/**/*.yml"
]
}
}
} |
Beta Was this translation helpful? Give feedback.
I don't know if this is still relevant. I also don't have the slightest idea why this works but this seems to create the correct json: