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

Hover module documentation failures over variable files. #63

Closed
ichundu opened this issue Feb 2, 2018 · 8 comments
Closed

Hover module documentation failures over variable files. #63

ichundu opened this issue Feb 2, 2018 · 8 comments
Assignees

Comments

@ichundu
Copy link

ichundu commented Feb 2, 2018

Since the latest update (version 0.1.3) I'm getting multiple failures output messages every time I lay the mouse cursor over some text in ansible variable files.
I think this is related to the feature that displays a link to the Ansible module documentation when hovering over a module.

The exact error message I'm getting is:

[Error - 8:35:20 AM] Request textDocument/hover failed.
  Message: Request textDocument/hover failed with message: Cannot read property 'push' of undefined
  Code: -32603 

Also is there a way to disable this feature?

@yungez
Copy link
Collaborator

yungez commented Feb 2, 2018

@ichundu thanks for reporting the issue, we'll look at it and update later.

@ichundu
Copy link
Author

ichundu commented Feb 3, 2018

@yungez It seems only my windows machine is affected. I'm not able to replicate this on my Linux laptop.
Regards

Update:
Correction, it is also happening on Linux.

@yungez
Copy link
Collaborator

yungez commented Feb 5, 2018

@ichundu thanks for the update. Actually I tested several variable files, didn't see the error. could you pls share your variable files to help investigate? thanks in advance.
meanwhile, a configuration item #69 will be added to disable hover ability, and in future, more configuration for other language ability to let user customize their own workspace.

Pls share us any comments/pain point when you use ansible. We'll discuss and investigate to see how to help real ansible user like you by adding more new features to this extension.

@thomasleveil
Copy link

thomasleveil commented Feb 6, 2018

This error happens when I hover anything from this yml file:

MYSQL_DATABASE: bar
MYSQL_DATABASE: foo2

The fact that I have two keys with the same name seems to be the cause of the Request textDocument/hover failed. error

@yungez yungez self-assigned this Feb 7, 2018
@yungez
Copy link
Collaborator

yungez commented Feb 7, 2018

@ichundu thanks for sharing the info. after investigation, the error happens when yaml file is invalid, such as wrong indent or in your example, duplicate key. Fix here includes:

  • provide configuration to enable/disable hover experience
  • swallow the error message when hover found invalid yaml file. Reason to swallow it is because hover events happens a lot, we don't want to flush user's output with error message.

Next release contains the fix will be around end of Feb. Stay tuned. Again thanks for feedback.

@ichundu
Copy link
Author

ichundu commented Feb 7, 2018

@yungez you are correct, after some further investigation the issue seems to happen when there is some syntax related error in the yml file. Because the error output is instant and and takes half of the editor workspace it is a deal breaker.
vscode-ansible

Thanks for the fix.

Also the hover feature that displays the module link is very helpful, but it doesn't seem to work in role tasks for me. It's only showing module links on the top level playbook tasks.
Could you also check for this?
Regards

@yungez
Copy link
Collaborator

yungez commented Feb 8, 2018

@ichundu currently we only support hover over on modules in tasks. Thanks for suggestion on modules in roles. Will add it and update here once ready.

@yungez yungez mentioned this issue Feb 23, 2018
@yungez
Copy link
Collaborator

yungez commented Feb 24, 2018

fixed in PR # 69. release in 0.1.4 version. The config item to enable/disable hover functionality is:
ansible.hover, default value is true.

pls have a try and let us know if any further question. thanks.

@yungez yungez closed this as completed Feb 24, 2018
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

3 participants