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

Fix error on completion 'null' value #360

Merged

Conversation

evidolob
Copy link
Collaborator

What does this PR do?

Fix error during completion when schema contains null value in enum, example:

{
   "type": "object",
   "properties": {
      "kind": {
        "enum": [
          "project",
          null
       ],
     }
   }
}

With this PR error is gone, but I have doubt about behaviour.
We generate completion item with label null but insert only new line\n.
According to yaml spec

kind:

and

kind: null

are equal, but maybe it would be better if we will insert null\n instead of just \n?

What issues does this PR fix or reference?

Found during #344 investigation.

Is it tested? How?

Use example schema and yaml content:

kind: 

call completion after kind: , you should see completion list with two items project and null.

@coveralls
Copy link

coveralls commented Nov 20, 2020

Coverage Status

Coverage increased (+0.6%) to 80.22% when pulling 560de41 on evidolob:fix-error-on-null-completion into 33b090a on redhat-developer:master.

@JPinkney
Copy link
Contributor

According to yaml spec

kind:
and

kind: null
are equal, but maybe it would be better if we will insert null\n instead of just \n?

I think I like the idea of inserting null\n a bit better. I tried with it just inserting \n but I'm not sure when anyone would actually use the completionitem for that rather then just pressing enter but I could be wrong

@evidolob
Copy link
Collaborator Author

@JPinkney Done, just note, to alight with other string completion we will insert just null string, without \n

@evidolob evidolob merged commit ce1609d into redhat-developer:master Nov 24, 2020
@evidolob evidolob deleted the fix-error-on-null-completion branch November 24, 2020 07:10
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.

4 participants