Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for multiple YAML documents in single file #43

Closed
ahmetb opened this issue Nov 13, 2017 · 13 comments
Closed

Support for multiple YAML documents in single file #43

ahmetb opened this issue Nov 13, 2017 · 13 comments
Labels

Comments

@ahmetb
Copy link

ahmetb commented Nov 13, 2017

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?

@JPinkney JPinkney added the bug label Nov 14, 2017
@JPinkney
Copy link
Contributor

Hi! I've fixed this in the latest release, all features now work when you have multiple YAML documents in a single file

@DazWilkin
Copy link

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

image

As with the issue reporter, Kubernetes (uniquely?) uses this as a convenience in aggregating multiple correlated Kubernetes resources into a single file.

@JPinkney
Copy link
Contributor

Confirmed regression. 0.0.10 works perfect but its broken in 0.0.11. My guess is its because of this commit redhat-developer/yaml-language-server@808d7ed

@JPinkney JPinkney reopened this Apr 11, 2018
@JPinkney
Copy link
Contributor

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?

@DazWilkin
Copy link

DazWilkin commented Apr 11, 2018

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.

@JPinkney
Copy link
Contributor

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.

weird_bug

@JPinkney
Copy link
Contributor

I just tried on another computer and could not reproduce.

@gorkem Are you able to reproduce this?

@DazWilkin
Copy link

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

@JPinkney
Copy link
Contributor

I've tried on both Linux (Fedora) and Mac OS and could not reproduce

@gorkem
Copy link
Collaborator

gorkem commented Apr 12, 2018

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.

@DazWilkin
Copy link

Thanks for the help! I'll try it tomorrow

@DazWilkin
Copy link

DazWilkin commented Apr 12, 2018

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.

@JPinkney
Copy link
Contributor

No apologies needed. I'm just glad its working as expected 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants