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

Incorrect Modules URL since 2.9 release and Ansible docs changes #269

Open
niallvwalshe opened this issue Aug 25, 2020 · 5 comments
Open

Comments

@niallvwalshe
Copy link

Environment

  • Extension version: 0.5.2
  • OS Type: MacOS

Summary

Computed URL for modules links to 404s, the hover shows an older syntax which worked pre 2.9 it would appear.

Reproduce steps

Example module, hover over and select the link shown:

image

Expected Results

Working url for the example is https://docs.ansible.com/ansible/2.7/modules/postgresql_db_module.html and that should be the hover link.

Actual Results

Clicked link for the example is https://docs.ansible.com/ansible/latest/postgresql_db_module.html which actually redirects to https://docs.ansible.com/ansible/latest/postgresql_db_module/modules/.html which gives a image

@eightnoneone
Copy link

item.documentation = `http://docs.ansible.com/ansible/${module.module}_module.html`;

contents: `module, documentation at http://docs.ansible.com/ansible/${content}_module.html`,

@joshuaclausen
Copy link

As a bit of a hack-workaround, you can edit a few files in your locally-installed extension. The following 3 places were what I changed, and at least at first blush it seems to "work". I didn't want to move away from this extension just yet, so this is a workaround.

Get to the extension here (at least for my default installation):

%USERPROFILE%\.vscode\extensions\vscoss.vscode-ansible-0.5.2

Edit the following files, adding "/2.9/modules" to the URL template (or whatever version you want):

out\completionData.js

# change to this
item.documentation = `http://docs.ansible.com/ansible/2.9/modules/${module.module}_module.html`;

out\server\services\yamlHover.js

# change to this
contents: `module, documentation at http://docs.ansible.com/ansible/2.9/modules/${content}_module.html`,

server\src\services\yamlHover.ts

# change to this
contents: `module, documentation at http://docs.ansible.com/ansible/2.9/modules/${content}_module.html`,

@niallvwalshe
Copy link
Author

out\completionData.js

item.documentation = `http://docs.ansible.com/ansible/2.9/modules/${module.module}_module.html`;

out\server\services\yamlHover.js

contents: `module, documentation at http://docs.ansible.com/ansible/2.9/modules/${content}_module.html`,

server\src\services\yamlHover.ts

contents: `module, documentation at http://docs.ansible.com/ansible/2.9/modules/${content}_module.html`,

Thats a great find, thanks very much, wonder if an option for specifying your active version could be added to the backend of this.

@frafaelribeiro
Copy link

As a bit of a hack-workaround, you can edit a few files in your locally-installed extension. The following 3 places were what I changed, and at least at first blush it seems to "work". I didn't want to move away from this extension just yet, so this is a workaround.

Get to the extension here (at least for my default installation):

%USERPROFILE%\.vscode\extensions\vscoss.vscode-ansible-0.5.2

Edit the following files, adding "/2.9/modules" to the URL template (or whatever version you want):

out\completionData.js

# change to this
item.documentation = `http://docs.ansible.com/ansible/2.9/modules/${module.module}_module.html`;

out\server\services\yamlHover.js

# change to this
contents: `module, documentation at http://docs.ansible.com/ansible/2.9/modules/${content}_module.html`,

server\src\services\yamlHover.ts

# change to this
contents: `module, documentation at http://docs.ansible.com/ansible/2.9/modules/${content}_module.html`,

Thanks for this information.

To remote ssh or WSL, can use de same workaround.

On remote sever.


:~$ cd .vscode-server/extensions/vscoss.vscode-ansible-0.5.2/

:~/.vscode-server/extensions/vscoss.vscode-ansible-0.5.2$ vim out/completionData.js

:~/.vscode-server/extensions/vscoss.vscode-ansible-0.5.2$ vim out/server/services/yamlHover.js

:~/.vscode-server/extensions/vscoss.vscode-ansible-0.5.2$ vim server/src/services/yamlHover.ts

@goniomdq
Copy link

goniomdq commented Oct 5, 2020

Example module, hover over and select the link shown:

image

Expected Results

Working url for the example is https://docs.ansible.com/ansible/2.7/modules/postgresql_db_module.html and that should be the hover link.

Actually, you just need to add '/modules/' before the module name.
For example:
Change, this
http://docs.ansible.com/ansible/postgresql_db_module.html
To this
http://docs.ansible.com/ansible/modules/postgresql_db_module.html

goniomdq added a commit to goniomdq/vscode-ansible that referenced this issue Oct 5, 2020
Fix ansible doc URL
goniomdq added a commit to goniomdq/vscode-ansible that referenced this issue Oct 5, 2020
goniomdq added a commit to goniomdq/vscode-ansible that referenced this issue Oct 5, 2020
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

5 participants