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

Completion suggestions for arrays, integers suggest ${} placeholders #919

Open
n8agrin opened this issue Sep 6, 2023 · 0 comments
Open

Comments

@n8agrin
Copy link

n8agrin commented Sep 6, 2023

Summary

More of a question than a bug report.

We have a JSONSchema that encodes various values like:

          "aliases" : {
            "type" : "array",
            "items" : {
              "type" : "string"
            }
          },

The yaml-language-server provides a completion that is like:

aliases:
  - ${1:""}

Similarly, we've noticed that integer values like:

          "display_order" : {
            "type" : "integer"
          },

which suggests:

display_order: ${1:0}

Why are these the suggested defaults? I read through the code and it looks intentional. That is, it all happens in code that understands it's generating a suggestion for an array value or an integer value.

I double checked the yaml syntax and don't believe this is a standard array format which left me more confused.

I'm happy to open a PR with a patch, but given how long the implementation has existed in the code, I wanted to check first.

I believe this issue may be related, in that when I first hit the problem, I was trying to find a way to insert an array literal as the suggestion: #409

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

No branches or pull requests

1 participant