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

Error when file has "Type" attribute --- yamlValidation #317

Closed
caobincb opened this issue Sep 15, 2020 · 3 comments · Fixed by #328
Closed

Error when file has "Type" attribute --- yamlValidation #317

caobincb opened this issue Sep 15, 2020 · 3 comments · Fixed by #328
Assignees
Labels

Comments

@caobincb
Copy link

Request textDocument/completion failed.
Message: Request textDocument/completion failed with message: Cannot read property 'type' of undefined
Code: -32603

@evidolob
Copy link
Collaborator

@caobincb Can you provide yaml sample on witch you has that error?

@evidolob evidolob added the bug label Sep 15, 2020
@GhostLyrics
Copy link

GhostLyrics commented Oct 1, 2020

Create the following file as roles/example/tasks/main.yml to simulate using Ansible and open the top level folder with e.g. Visual Studio Code with yaml-language-server enabled:

---
- 

After typing the list indicator, type any string and you'll get the error message for every key you hit. Example:

---
- na

Result:

[Error - 8:34:51 PM] Request textDocument/completion failed.
  Message: Request textDocument/completion failed with message: Cannot read property 'type' of undefined
  Code: -32603 

@evidolob evidolob self-assigned this Oct 2, 2020
evidolob added a commit to evidolob/yaml-language-server that referenced this issue Oct 2, 2020
Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
evidolob added a commit that referenced this issue Oct 6, 2020
* #317 fix error if schema doesn't contain type

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

* Remove unused import

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

bendem commented Oct 30, 2020

Thanks god for that fix ❤️

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.

4 participants