{"id":13600651,"url":"https://github.com/yaegassy/coc-ansible","last_synced_at":"2025-03-09T13:30:44.852Z","repository":{"id":37674192,"uuid":"405953658","full_name":"yaegassy/coc-ansible","owner":"yaegassy","description":"ansible-language-server extension for coc.nvim","archived":false,"fork":false,"pushed_at":"2024-05-17T23:29:35.000Z","size":309,"stargazers_count":72,"open_issues_count":2,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-07T00:37:33.599Z","etag":null,"topics":["ansible","coc","coc-extension","cocnvim","neovim","vim"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@yaegassy/coc-ansible","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yaegassy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-13T11:56:35.000Z","updated_at":"2025-02-23T16:22:46.000Z","dependencies_parsed_at":"2024-01-16T23:26:08.449Z","dependency_job_id":"404b3fbb-1284-4b7a-8af4-5a35731a2e87","html_url":"https://github.com/yaegassy/coc-ansible","commit_stats":null,"previous_names":[],"tags_count":51,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaegassy%2Fcoc-ansible","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaegassy%2Fcoc-ansible/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaegassy%2Fcoc-ansible/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaegassy%2Fcoc-ansible/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yaegassy","download_url":"https://codeload.github.com/yaegassy/coc-ansible/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242309918,"owners_count":20106737,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","coc","coc-extension","cocnvim","neovim","vim"],"created_at":"2024-08-01T18:00:45.777Z","updated_at":"2025-03-09T13:30:44.358Z","avatar_url":"https://github.com/yaegassy.png","language":"TypeScript","funding_links":[],"categories":["Language Support"],"sub_categories":[],"readme":"# coc-ansible\n\n[ansible-language-server](https://github.com/ansible/ansible-language-server) extension for [coc.nvim](https://github.com/neoclide/coc.nvim)\n\n\u003cimg width=\"780\" alt=\"coc-ansible-demo\" src=\"https://user-images.githubusercontent.com/188642/133183623-7eb4529b-cf4b-4778-adfe-b57105194b7c.gif\"\u003e\n\n## Install\n\n**CocInstall**:\n\n```vim\n:CocInstall @yaegassy/coc-ansible\n```\n\n\u003e scoped packages\n\n**vim-plug**:\n\n```vim\nPlug 'yaegassy/coc-ansible', {'do': 'yarn install --frozen-lockfile'}\n```\n\n## Note\n\n### [!! Very important !!] Filetype related\n\n1. The \"filetype\" must be `yaml.ansible` for this extension to work.\n\n   If you install ansible's vim plugin, `yaml.ansible` filetype will be added automatically, which is very useful (e.g. [pearofducks/ansible-vim](https://github.com/pearofducks/ansible-vim) or [sheerun/vim-polyglot](https://github.com/sheerun/vim-polyglot)).\n\n2. You also need to set `g:coc_filetype_map` in `.vimrc/init.vim`.\n\n   ```vim\n   let g:coc_filetype_map = {\n     \\ 'yaml.ansible': 'ansible',\n     \\ }\n   ```\n\n## Requirements (Tools)\n\n- [Ansible 2.9+](https://docs.ansible.com/ansible/latest/index.html)\n- [Ansible Lint](https://ansible-lint.readthedocs.io/en/latest/) (required, unless you disable linter support)\n  - [TIPS] `coc-ansible` will **automatically disable the feature** if `ansible-lint` is not found\n- [yamllint](https://yamllint.readthedocs.io/en/stable/) (optional)\n\n\u003e If you also install `yamllint`, `ansible-lint` will detect it and incorporate into the linting process. Any findings reported by `yamllint` will be exposed in coc.nvim as errors/warnings.\n\n## Bult-in install\n\ncoc-ansible allows you to create an extension-only \"venv\" and install `ansible`, `ansible-lint` and `yamllint`.\n\n`yamllint` will be installed by setting `ansible.builtin.isWithYamllint` to `true` (default: `false`).\n\nYou can also specify the version of each tool. (setting: `ansible.bultin.ansibleVersion`, `ansible.bultin.ansibleLintVersion`, `ansible.bultin.yamllintVersion`)\n\n---\n\nThe first time you use coc-ansible, if ansible, ansible-lint is not detected, you will be prompted to do a built-in installation.\n\nYou can also run the installation command manually.\n\n```\n:CocCommand ansible.builtin.installRequirementsTools\n```\n\n## Configuration options\n\n- `ansible.enable`: Enable coc-ansible extension, default: `true`\n- `ansible.disableProgressNotifications`: Disable progress notifications from ansible-language-server, default: `false`\n- `ansible.builtin.isWithYamllint`: Whether to install yamllint the built-in installer, default: `false`\n- `ansible.builtin.ansibleVersion`: Version of `ansible` for built-in install, default: `\"\"`\n- `ansible.builtin.ansibleLintVersion`: Version of `ansible-lint` for built-in install, default: `\"\"`\n- `ansible.builtin.force`: Whether to force builtin tools instead those in the PATH, default: `false`\n- `ansible.builtin.yamllintVersion`: Version of `yamllint` for built-in install, default: `\"\"`\n- `ansible.ansible.useFullyQualifiedCollectionNames`: Always use fully qualified collection names (FQCN) when inserting a module name. Disabling it will only use FQCNs when necessary, default: `true`\n- `ansible.python.interpreterPath`: Path to the python/python3 executable. This settings may be used to make the extension work with ansible and ansible-lint installations in a python virtual environment, default: `\"\"`\n- `ansible.validation.enabled`: Toggle validation provider. If enabled and ansible-lint is disabled, validation falls back to ansible-playbook --syntax-check, default: `true`\n- `ansible.validation.lint.enabled`: Toggle usage of ansible-lint, default: `true`\n- `ansible.validation.lint.arguments`: Optional command line arguments to be appended to ansible-lint invocation, default `\"\"`\n- `ansible.completion.provideRedirectModules`: Toggle redirected module provider when completing modules, default: `true`\n- `ansible.completion.provideModuleOptionAliases`: Toggle alias provider when completing module options, default: `true`\n- `ansible.ansibleDoc.path`: Path to the ansible-doc executable, default: `ansible-doc`\n- `ansible.ansibleDoc.enableSplitRight`: Use vertical belowright for ansible-doc terminal window, default: `true`\n- `ansible.ansibleNavigator.path`: Points to the ansible-navigator executable, default: `\"ansible-navigator\"`\n- `ansible.dev.serverPath`: Absolute path to ansible language server module. If it is not set, use the extention's server module. (For develop and check), default: `\"\"`\n- `ansibleServer.trace.server`: Traces the communication between coc.nvim and the ansible language server, default: `\"off\"`\n\n## Commands\n\n**Command List**:\n\n\u003e :CocCommand [CommandName]\n\u003e\n\u003e **e.g.** :CocCommand ansible.server.restart\n\n- `ansible.builtin.installRequirementsTools`: Install `ansible`, `ansible-lint` and `yamllint` (optional) with extension's venv\n  - It will be installed in this path:\n    - Mac/Linux:\n      - `~/.config/coc/extensions/@yaegassy/coc-ansible-data/ansible/venv/bin/ansible`\n      - `~/.config/coc/extensions/@yaegassy/coc-ansible-data/ansible/venv/bin/ansible-lint`\n      - `~/.config/coc/extensions/@yaegassy/coc-ansible-data/ansible/venv/bin/yamllint`\n    - Windows:\n      - `~/AppData/Local/coc/extensions/@yaegassy/coc-ansible-data/ansible/venv/Scripts/ansible.exe`\n      - `~/AppData/Local/coc/extensions/@yaegassy/coc-ansible-data/ansible/venv/Scripts/ansible-lint.exe`\n      - `~/AppData/Local/coc/extensions/@yaegassy/coc-ansible-data/ansible/venv/Scripts/yamllint.exe`\n  - **[Note]** `ansible` is a very large tool and will take some time to install\n- `ansible.server.restart`: Restart ansible language server\n- `ansible.server.showMetaData`: Show ansible-metadata for ansible language server | [DEMO](https://github.com/yaegassy/coc-ansible/pull/24)\n- `ansible.server.resyncAnsibleInventory`: Resync Ansible Inventory | [DEMO](https://github.com/yaegassy/coc-ansible/pull/25)\n- `ansible.ansbileDoc.showInfo`: Run the `ansible-doc` command in a terminal window with various options to display information about the plugins | [DEMO](https://github.com/yaegassy/coc-ansible/pull/22#issuecomment-1178586815)\n- `ansible.ansbileDoc.showSnippets`: Run the `ansible-doc` command in a terminal window with various options to display a snippets of the plugins | [DEMO](https://github.com/yaegassy/coc-ansible/pull/22#issuecomment-1178587359)\n\n**Example of command key mapping**:\n\n```vim\n\" Quickly view a list of all coc.nvim commands\nnnoremap \u003csilent\u003e \u003cC-p\u003e :\u003cC-u\u003eCocCommand\u003cCR\u003e\n```\n\n## Code Actions\n\n**Example key mapping (Code Action related)**:\n\n```vim\nnmap \u003csilent\u003e ga \u003cPlug\u003e(coc-codeaction-line)\n```\n\n**Usage**:\n\nIn the line with diagnostic message, enter the mapped key (e.g. `ga`) and you will see a list of code actions that can be performed.\n\n**Actions**:\n\n- `Ignoring rules for current line (# noqa [ruleId])` | [DEMO](https://github.com/yaegassy/coc-ansible/pull/13)\n  - Requires `ansible-lint` \"v6.8.1\" or later.\n- `Show web documentation for [ruleId]` | [DEMO](https://github.com/yaegassy/coc-ansible/pull/21#issue-1296813716)\n  - Requires `ansible-lint` \"v6.8.1\" or later.\n\n## Thanks\n\n- [ansible/ansible-language-server](https://github.com/ansible/ansible-language-server)\n- [ansible/vscode-ansible](https://github.com/ansible/vscode-ansible)\n\n## License\n\nMIT\n\n---\n\n\u003e This extension is built with [create-coc-extension](https://github.com/fannheyward/create-coc-extension)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaegassy%2Fcoc-ansible","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyaegassy%2Fcoc-ansible","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaegassy%2Fcoc-ansible/lists"}