Some of my Kubernetes yaml files are in form of:
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: web-deployment
...
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: userdirectory-deployment
...
it looks like the autocomplete/Ctrl+space is not working when there are multiple objects in a single yaml file.
Should this be supported?
Hi! I've fixed this in the latest release, all features now work when you have multiple YAML documents in a single file
I'm running Visual Studio Code versoin 1.21.1 and the excellent (Thank you!) YAML Support by Red Hat (0.0.11 !?).
This issue says that support for multiple YAML files was fixed in November but, it appears to not be working for me. User error, a regression, or...?
yaml: expected a single document in the stream, but found more

As with the issue reporter, Kubernetes (uniquely?) uses this as a convenience in aggregating multiple correlated Kubernetes resources into a single file.
Confirmed regression. 0.0.10 works perfect but its broken in 0.0.11. My guess is its because of this commit https://github.com/redhat-developer/yaml-language-server/commit/808d7edc6437c646b19394eadeb87c05a91761ed
Actually I just realised that i'm facing a different issue then you. When I copy and paste it it works just fine. My only issue with it is that autocompletion isn't working on the root element of multi-document. Did you type out all of that or did you just copy and paste?
I have several other Kubernetes deployment files that surface this issue. When I found this issue, I copied and pasted the example from above to provide a more obvious|consistent repro.
This is what I see when I enter in the file (I just copied and pasted it in). I'm not sure why it would be different between the two but i'm still looking into it.

I just tried on another computer and could not reproduce.
@gorkem Are you able to reproduce this?
Since I posted this, Visual Studio Code has updated (now: 1.22.1) but the problem persists.
I'm running on Linux (Debian) and assume you may be using Mac OS. Perhaps that's a difference?
Version 1.22.1
Commit 950b8b0d37a9b7061b6f0d291837ccc4015f5ecd
Date 2018-04-06T00:24:49.616Z
Shell 1.7.12
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64
I've tried on both Linux (Fedora) and Mac OS and could not reproduce
Can't repro either. I regularly use multiple YAML docs in a single file because that is how my generator works, did not have an issue with it in a while.
This almost feels like your extension is not getting updated although vscode is reporting the correct value. Perhaps uninstall/install may help.
Thanks for the help! I'll try it tomorrow
Resolved :-(
I had a conflicting YAML extension (that I'd forgotten I had installed). I disabled all extensions and reinstalled redhat.vscode-yaml and it works as expected.
By a process of elimination, I identified djabraham.vscode-yaml-validation (link) as the conflicting extension.
When that's disabled, everything WAI.
Apologies for wasting your time.
No apologies needed. I'm just glad its working as expected :smile:
Most helpful comment
No apologies needed. I'm just glad its working as expected :smile: