Is there a way to tell lua file patterns to exclude something? I am struggling so badly with this right now :thinkies:
I want it to always use my special schema from datree.io for files ending in _argocd_appset.yaml or _argocd_app.yaml, but then fall back to the default kubernetes schema if those aren't matched. It should never use BOTH the datree and the default kubernetes schemas, but I have no idea how to say that in lua file pattern matching syntax... It always needs to match stuff under a templates directory btw, because helm.
config = {
schemas = {
["https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/argoproj.io/application_v1alpha1.json"] = "templates/**_argocd_app.yaml",
["https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/argoproj.io/applicationset_v1alpha1.json"] = "templates/**_argocd_appset.yaml",
kubernetes = "templates/**!(argocd_app.yaml)",
},
completion = true,
hover = true,
}
I've tried a number of things, but I'm starting to wonder if this is even possible?
I tried the following, but they don't seem to work:
templates/**!(argocd_app.yaml)templates/**!{argocd_app.yaml}templates/**![argocd_app.yaml]templates/**[!argocd_app.yaml]
The config I'm trying to get work is this helm language server:
https://github.com/mrjosh/helm-ls/tree/master?tab=readme-ov-file#default-configuration
It normally works like a charm, but struggles on special CRDs, which would be fine if it let me override just those and not just end up using both default k8s object schemas AND the special CRD schemas...
I really need both the power of helm templating syntax highlighting and autocompletion/validation AND validation of specific templated special CRDs, but this is proving harder than it should be and I know it's probably just like, one character away from working if it's meant to work at all...
Update: click this post to see the thread, it did not go well :[
#lua #neovim #kubernetes #k8s #helm