Photo by Mika Baumeister on Unsplash
How to enable syntax auto-completion for Kubernetes manifest files in Red Hat's YAML plugin for VSCode
Problem:
When using a plugin for YAML syntax support for VSCode editor developed by Red Hat, it does not enable the auto-completion feature for Kubernetes manifest files by default. As an auto-completion feature, it offers to use the CTRL + Space shortcut key. But this may not be a good option to choose, as the plugin has automatic syntax completion for Kubernetes manifest files during typing without using a shortcut key.
Solution:
- Install the plugin in VSCode from here.
- On the plugin page click on the gear button and select Extension Settings
- Scroll down and in YAML: Schemas select Edit in settings.json:
- In settings add the following code and save the changes:
"yaml.schemas": { "kubernetes": "*.yaml" }
- Restart VSCode.
- Enjoy auto-completion for Kubernetes manifest files!