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

Provide default object as completion snippet #291

Merged

Conversation

evidolob
Copy link
Collaborator

@evidolob evidolob commented Aug 3, 2020

@evidolob evidolob requested review from gorkem and JPinkney August 3, 2020 07:48
@evidolob evidolob self-assigned this Aug 3, 2020
@JPinkney
Copy link
Contributor

JPinkney commented Aug 4, 2020

I've just tried testing this and it looks like I'm getting unexpected results.

Attempting to autocomplete:

env: 

in VSCode gives

env: 	KEY: VALUE

which is invalid YAML. I think it needs to do:

env:
  KEY: VALUE

@evidolob
Copy link
Collaborator Author

evidolob commented Aug 4, 2020

@JPinkney Yes, you are right

@JPinkney
Copy link
Contributor

JPinkney commented Aug 4, 2020

I've tested with:

{
    "type": "object",
    "properties": {
        "env": {
            "type": "object",
            "default": {
                "KEY": "VALUE",
                "KEY2": {
                    "TEST": "TEST2"
                },
                "KEY3": ["Test", "Test2"]
            }
        }
    }
}

and it looks like we get:

env: 
  KEY: VALUE
  KEY2: [object Object]
  KEY3: Test,Test2

I wonder if it makes sense to continously check every child value as well. I've just tried with json language server and it seems to work correctly:

{
    "env": {
        "KEY": "VALUE",
        "KEY2": {
            "TEST": "TEST2"
        },
        "KEY3": [
            "Test",
            "Test2"
        ]
    }
}

Signed-off-by: Yevhen Vydolob <[email protected]>
@evidolob
Copy link
Collaborator Author

evidolob commented Aug 6, 2020

@JPinkney I done:
ezgif com-video-to-gif (28)

Copy link
Contributor

@JPinkney JPinkney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great!

@JPinkney JPinkney merged commit cf7fde0 into redhat-developer:master Aug 6, 2020
@evidolob evidolob deleted the fix-scheme-default-object branch August 6, 2020 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

auto completion error on Object
2 participants