someone-stole-my-name / yaml-companion.nvim

Get, set and autodetect YAML schemas in your buffers.
MIT License
203 stars 18 forks source link

CRD Matchers #41

Open astephanh opened 7 months ago

astephanh commented 7 months ago

Hello,

is there a way to add custom matchers for CRDs from https://github.com/datreeio/CRDs-catalog? I'd like to use the automatching functionality with crd resources as well.

to define matchers for CRDs might be better than define schemas and load manually. Maybe if there was an builtin matcher "kubernetes-crd" which could be configured via lua tables to create matchers based on the configuration? I'm no lua programmer, but it doesn't seem too hard to do (as the logic is almost implemented already).

Best Regards Stephan

astephanh commented 7 months ago

Hi again.

I'm by no means a programmer, but i managed to hack a simple Function to load the schema. Maybe you can use it to write something more "production ready".

https://github.com/someone-stole-my-name/yaml-companion.nvim/compare/main...astephanh:yaml-companion.nvim:main

szechp commented 7 months ago

if it works, why not create a pull request?

kevin-schmid commented 6 months ago

@astephanh awesome job! I was looking for exactly this feature. I'm currently using your fork and it works as expected.

astephanh commented 6 months ago

Hi,

the Problem is, that it will not work if there is no definition found. I also have trouble if i'm offline. I think some caching would be beneficial for speed. So as i'm not really a dev (in lua even less) i was hoping, someone could implement it properly :)