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

bad completion with array of objects #793

Closed
fbaligand opened this issue Oct 18, 2022 · 3 comments · Fixed by #804
Closed

bad completion with array of objects #793

fbaligand opened this issue Oct 18, 2022 · 3 comments · Fixed by #804
Assignees
Labels
Milestone

Comments

@fbaligand
Copy link
Contributor

fbaligand commented Oct 18, 2022

Describe the bug

Given that I have an array of objects in my schema; if in my YAML file, I add an array item, return to the line and invoke completion, the completion wrongly provides "{} - (array item) object" instead of the different properties available in my current object.

Here's a visual example:
test2

My JSON schema is the following:

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "prop1": {
        "type": "string"
      },
      "prop2": {
        "type": "string"
      },
      "prop3": {
        "type": "string"
      }
    }
  }
}

Expected Behavior

In my example, completion should provide "prop2" and "prop3", and not "{} - (array item) object"

Current Behavior

In my example, completion actually provide "{} - (array item) object", and not "prop2" and "prop3"

Steps to Reproduce

  1. given the following YAML file:
- prop1: a
  
  1. go to 2nd line, write 2 spaces, and then do "Ctrl+Tab"
  2. you get the wrong completion list, that is to say "{} - (array item) object", and not "prop2" and "prop3"

Environment

  • Windows
  • Visual Studio Code
  • YAML extension v1.10.1 and also YAML extension v1.11.10112022
@chuyangguangshin
Copy link

I reproduce this issue in version 1.10.1 . And find that it suggest properties correctly with version 0.23.0 .

@gorkem
Copy link
Collaborator

gorkem commented Nov 18, 2022

@msivasubramaniaan can you take a look at this one? Feels like we fixed this before.

@fbaligand
Copy link
Contributor Author

I just tested YAML vscode extension v1.11.0 and it works great!
Thank you @msivasubramaniaan for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment