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

Bug: autogenerated snippet for keys that contain an array of objects is badly indented #329

Closed
fbaligand opened this issue Oct 5, 2020 · 4 comments · Fixed by redhat-developer/vscode-yaml#375
Assignees
Labels
Milestone

Comments

@fbaligand
Copy link
Contributor

When I validate auto-completion for a key that contain an array of objects, the snippet generated contains 2 extra spaces for each sub-key generated.

Here's an example in kubernetes.yml:

Given that I have this file content:

metadata:
    ownerReferences

Then I go to end of ownerReferences, press Ctrl+Tab and [ENTER] to validate the suggested completion.
I get this result:

metadata:
    ownerReferences:
        - apiVersion: 
            kind: 
            name: 
            uid: 

The problem is that "kind", "name" and "uid" keys have 2 extra spaces in front.

@evidolob
Copy link
Collaborator

evidolob commented Oct 5, 2020

Hi @fbaligand, can you share your settings for editor.tabSize?

@evidolob evidolob added the bug label Oct 5, 2020
@evidolob evidolob self-assigned this Oct 5, 2020
@fbaligand
Copy link
Contributor Author

Hi,

My editor.tabSize setting equals to 4.
So I try to set 2, and so, don't reproduce the issue with this setting.

That said, YAML extension should align all keys of a list entry, whatever tab size.

@evidolob
Copy link
Collaborator

evidolob commented Oct 5, 2020

Yes, it's a bug in template generation, going to fix that soon

@fbaligand
Copy link
Contributor Author

Great!

evidolob added a commit to evidolob/yaml-language-server that referenced this issue Oct 6, 2020
Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
@evidolob evidolob added this to the Sprint #191 milestone Oct 7, 2020
evidolob added a commit that referenced this issue Oct 21, 2020
* #329 fix completion indentation for object in array

Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>

* remove documentation check

Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants