All Projects → ansible → ansible-language-server

ansible / ansible-language-server

Licence: MIT license
Ansible Language Server

Programming Languages

typescript
32286 projects
shell
77523 projects

Projects that are alternatives of or similar to ansible-language-server

ltex-ls
LTeX Language Server: LSP language server for LanguageTool 🔍✔️ with support for LaTeX 🎓, Markdown 📝, and others
Stars: ✭ 182 (+59.65%)
Mutual labels:  lsp, lsp-server
glsp-server
Java-based server framework of the graphical language server platform
Stars: ✭ 25 (-78.07%)
Mutual labels:  lsp, lsp-server
LspCpp
A Language Server Protocol implementation in C++
Stars: ✭ 40 (-64.91%)
Mutual labels:  lsp, lsp-server
merlin-language-server
Minimal cross-platform LSP wrapper for merlin
Stars: ✭ 28 (-75.44%)
Mutual labels:  lsp, lsp-server
camel-language-server
The Apache Camel LSP server implementation
Stars: ✭ 31 (-72.81%)
Mutual labels:  lsp, lsp-server
tds-vscode
Totvs Developer Studio for vscode
Stars: ✭ 135 (+18.42%)
Mutual labels:  lsp, lsp-server
glsp-examples
Example diagram editors built with Eclipse GLSP
Stars: ✭ 28 (-75.44%)
Mutual labels:  lsp, lsp-server
vis-lspc
language server protocol client for the vis editor
Stars: ✭ 24 (-78.95%)
Mutual labels:  lsp
Spyglass
Development tools for vanilla Minecraft: Java Edition data pack developers.
Stars: ✭ 163 (+42.98%)
Mutual labels:  lsp
vscode
The Visual Studio Code Extension for the Erlang Language Server
Stars: ✭ 62 (-45.61%)
Mutual labels:  lsp
spacemacs.d
rich Clojure & LSP config for Spacemacs
Stars: ✭ 102 (-10.53%)
Mutual labels:  lsp
vscode-tenkawa-php
Visual Studio Code extension integrating Tenkawa PHP language server.
Stars: ✭ 28 (-75.44%)
Mutual labels:  lsp
lsp-metals
lsp-mode ❤️ metals
Stars: ✭ 49 (-57.02%)
Mutual labels:  lsp
navigator.lua
Source code analysis & navigation plugin for Neovim. Navigate codes like a breeze🎐. Exploring LSP and 🌲Treesitter symbols a piece of 🍰. Take control like a boss 🦍.
Stars: ✭ 781 (+585.09%)
Mutual labels:  lsp
vim-lamp
💡Language Server Protocol client for Vim.
Stars: ✭ 34 (-70.18%)
Mutual labels:  lsp
easy-hls-nix
Easy Haskell Language Server tooling with Nix!
Stars: ✭ 56 (-50.88%)
Mutual labels:  lsp
csharp-language-server
Roslyn-based LSP language server for C#
Stars: ✭ 155 (+35.96%)
Mutual labels:  lsp-server
lsp-ltex
lsp-mode ❤️ LTEX
Stars: ✭ 30 (-73.68%)
Mutual labels:  lsp
aerial.nvim
Neovim plugin for a code outline window
Stars: ✭ 485 (+325.44%)
Mutual labels:  lsp
neovimfiles
My Neovim configuration written in Lua
Stars: ✭ 52 (-54.39%)
Mutual labels:  lsp

Ansible Language Server

[//]: # DO-NOT-REMOVE-README-TITLE

This language server adds support for Ansible and is currently used by the following projects:

Features

Syntax highlighting

Syntax highlighting

Ansible keywords, module names and module options, as well as standard YAML elements are recognized and highlighted distinctly. Jinja expressions are supported too, also those in Ansible conditionals (when, failed_when, changed_when, check_mode), which are not placed in double curly braces.

The screenshots and animations presented in this README have been taken using the One Dark Pro theme. The default VS Code theme will not show the syntax elements as distinctly unless customized. Virtually any theme other than default will do better.

Validation

YAML validation

While you type, the syntax of your Ansible scripts is verified and any feedback is provided instantaneously.

Integration with ansible-lint

Linter support

On opening and saving a document, ansible-lint is executed in the background and any findings are presented as errors. You might find it useful that rules/tags added to warn_list (see Ansible Lint Documentation) are shown as warnings instead.

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 VSCode as errors/warnings.

Note

If ansible-lint is not installed/found or running ansible-lint results in errors, it will fall back to ansible --syntax-check for validation.

Smart auto-completion

Autocompletion

The extension tries to detect whether the cursor is on a play, block or task etc. and provides suggestions accordingly. There are also a few other rules that improve the user experience:

  • the name property is always suggested first
  • on module options, the required properties are shown first, and aliases are shown last, otherwise ordering from the documentation is preserved
  • FQCNs (fully qualified collection names) are inserted only when necessary; collections configured with the collections keyword are honored. This behavior can be disabled in extension settings.

Auto-closing Jinja expressions

Easier Jinja expression typing

When writing a Jinja expression, you only need to type "{{<space>, and it will be mirrored behind the cursor (including the space). You can also select the whole expression and press space to put spaces on both sides of the expression.

Documentation reference

Documentation on hover

Documentation is available on hover for Ansible keywords, modules and module options. The extension works on the same principle as ansible-doc, providing the documentation straight from the Python implementation of the modules.

Jump to module code

Go to code on Ctrl+click

You may also open the implementation of any module using the standard Go to Definition operation, for instance, by clicking on the module name while holding ctrl/cmd.

Standalone Usage

For standalone usage with a language-server client, the Ansible language server can be installed from npm with the following command:

npm install -g @ansible/ansible-language-server

Language Server Settings

For details on settings, their descriptions and their default values refer to settings.

Developer support

For details on setting up the development environment and debugging refer to the development document.

Requirements

For Windows users, this extension works perfectly well with extensions such as Remote - WSL and Remote - Containers.

If you have any other extension providing language support for Ansible, you might need to uninstall it first.

Known limitations

  • The shorthand syntax for module options (key=value pairs) is not supported.
  • Only Jinja expressions inside Ansible YAML files are supported. To do syntax highlighting of Jinja template files, you'll need to install other extensions.
  • Jinja blocks (inside Ansible YAML files) are not supported yet.

Credit

Based on the good work done by Tomasz Maciążek

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].