From e952c7cbe673a0930414ac2d77b7242ec984d08f Mon Sep 17 00:00:00 2001 From: "Ganesh B. Nalawade" Date: Mon, 18 Oct 2021 10:00:58 +0530 Subject: [PATCH 1/9] doc: update readme file with language server settings * Add newly added language server settings in the README file * Fix markdownlint issues --- README.md | 94 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 62 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index b02fd1a2..cc1d90e1 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,34 @@ # Ansible Language Server + This language server adds support for Ansible and is currently used by the following projects: * [Ansible extension for vscode/codium](https://github.com/ansible/vscode-ansible) * [Ansible extension for coc.nvim](https://github.com/yaegassy/coc-ansible) -### Getting started +## Getting started 1. Install prerequisites: - - latest [Visual Studio Code](https://code.visualstudio.com/) - - [Node.js](https://nodejs.org/) v12.0.0 or higher + * latest [Visual Studio Code](https://code.visualstudio.com/) + * [Node.js](https://nodejs.org/) v12.0.0 or higher 2. Fork and clone this repository 3. Install the dependencies + ```bash cd ansible-language-server - $ npm ci + npm ci ``` 4. Build the language server + ```bash - $ npm run compile + npm run compile ``` 5. The new built server is now located in ./out/server/src/server.js. + ```bash node /out/server/src/server.js --stdio ``` @@ -32,6 +36,7 @@ following projects: ## Features ### Syntax highlighting + ![Syntax highlighting](images/syntax-highlighting.png) **Ansible keywords**, **module names** and **module options**, as well as @@ -46,11 +51,13 @@ curly braces. > default will do better. ### Validation + ![YAML validation](images/yaml-validation.gif) While you type, the syntax of your Ansible scripts is verified and any feedback is provided instantaneously. #### Integration with ansible-lint + ![Linter support](images/ansible-lint.gif) On opening and saving a document, `ansible-lint` is executed in the background @@ -63,20 +70,27 @@ are shown as warnings instead. > 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 error it will fallback to `ansible --syntax-check` for validation. + ### Smart autocompletion + ![Autocompletion](images/smart-completions.gif) 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 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; + +* 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]([LINK](https://docs.ansible.com/ansible/latest/user_guide/collections_using.html#simplifying-module-names-with-the-collections-keyword)) are honored. This behavior can be disabled in extension settings. #### Auto-closing Jinja expressions + ![Easier Jinja expression typing](images/jinja-expression.gif) When writing a Jinja expression, you only need to type `"{{ `, and it will be @@ -84,6 +98,7 @@ 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](images/hover-documentation-module.png) Documentation is available on hover for Ansible keywords, modules and module @@ -91,50 +106,65 @@ 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](images/go-to-definition.gif) 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`. -## Requirements -- [Ansible 2.9+](https://docs.ansible.com/ansible/latest/index.html) -- [Ansible Lint](https://ansible-lint.readthedocs.io/en/latest/) (required, - unless you disable linter support) -- [yamllint](https://yamllint.readthedocs.io/en/stable/) (optional) +## Language Server Settings -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. +The following settings are supported. -## Configuration -This extension supports multi-root workspaces, and as such, can be configured on -any level (User, Remote, Workspace and/or Folder). - -- `ansible.ansible.path`: Path to the `ansible` executable. -- `ansible.ansible.useFullyQualifiedCollectionNames`: Toggles use of +* `ansible.ansible.path`: Path to the `ansible` executable. +* `ansible.ansible.useFullyQualifiedCollectionNames`: Toggles use of fully qualified collection names (FQCN) when inserting a module name. Disabling it will only use FQCNs when necessary, that is when the collection isn't configured for the task. -- `ansible.ansibleLint.enabled`: Enables/disables use of `ansible-lint`. -- `ansible.ansibleLint.path`: Path to the `ansible-lint` executable. -- `ansible.ansibleLint.arguments`: Optional command line arguments to be +* `ansible.ansibleLint.arguments`: Optional command line arguments to be appended to `ansible-lint` invocation. See `ansible-lint` documentation. -- `ansible.python.interpreterPath`: Path to the `python`/`python3` executable. +* `ansible.ansibleLint.enabled`: Enables/disables use of `ansible-lint`. +* `ansible.ansibleLint.path`: Path to the `ansible-lint` executable. +* `ansible.ansibleNavigator.path`: Path to the `ansible-navigator` executable. +* `ansible.ansiblePlaybook.path`: Path to the `ansible-playbook` executable. +* `ansible.executionEnvironment.containerEngine`: The container engine to be used + while running with execution environment. Valid values are `auto`, `podman` and + `docker`. For `auto` it will look for `podman` then `docker`. +* `ansible.executionEnvironment.enabled`: Enable or disable the use of an + execution environment. +* `ansible.executionEnvironment.image`: Specify the name of the execution environment image. +* `ansible.executionEnvironment.pullPolicy`: Specify the image pull policy. Valid values are `always`, + `missing`, `never` and `tag`. Setting `always` will always pull the image when extension is activated or reloaded. + Setting `missing` will pull if not locally available. Setting `never` will never pull the image and setting + tag will always pull if the image tag is 'latest', otherwise pull if not locally available. +* `ansible.python.interpreterPath`: Path to the `python`/`python3` executable. This setting may be used to make the extension work with `ansible` and `ansible-lint` installations in a Python virtual environment. -- `ansible.python.activationScript`: Path to a custom `activate` script, which +* `ansible.python.activationScript`: Path to a custom `activate` script, which will be used instead of the setting above to run in a Python virtual environment. +## Requirements + +* [Ansible 2.9+](https://docs.ansible.com/ansible/latest/index.html) +* [Ansible Lint](https://ansible-lint.readthedocs.io/en/latest/) (required, + unless you disable linter support) +* [yamllint](https://yamllint.readthedocs.io/en/stable/) (optional) + +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. -- Nested module options are not supported yet. -- Only Jinja *expressions* inside Ansible YAML files are supported. In order to + +* The shorthand syntax for module options (key=value pairs) is not supported. +* Nested module options are not supported yet. +* Only Jinja *expressions* inside Ansible YAML files are supported. In order to have syntax highlighting of Jinja template files, you'll need to install other extension. -- Jinja *blocks* (inside Ansible YAML files) are not supported yet. +* Jinja *blocks* (inside Ansible YAML files) are not supported yet. ## Credit From 9639f2e5d9d777e990bdd8dca50284fbc463f62a Mon Sep 17 00:00:00 2001 From: "Ganesh B. Nalawade" Date: Mon, 18 Oct 2021 21:10:05 +0530 Subject: [PATCH 2/9] doc: update readme doc and add development doc * Update newly added setting releated to EE in readme * Fix markdownlint issues * Add development docs --- README.md | 56 ++++++++++++++++++++++-------------------- doc/development.md | 61 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+), 27 deletions(-) create mode 100644 doc/development.md diff --git a/README.md b/README.md index cc1d90e1..891e29cb 100644 --- a/README.md +++ b/README.md @@ -6,33 +6,6 @@ following projects: * [Ansible extension for vscode/codium](https://github.com/ansible/vscode-ansible) * [Ansible extension for coc.nvim](https://github.com/yaegassy/coc-ansible) -## Getting started - -1. Install prerequisites: - * latest [Visual Studio Code](https://code.visualstudio.com/) - * [Node.js](https://nodejs.org/) v12.0.0 or higher - -2. Fork and clone this repository - -3. Install the dependencies - - ```bash - cd ansible-language-server - npm ci - ``` - -4. Build the language server - - ```bash - npm run compile - ``` - -5. The new built server is now located in ./out/server/src/server.js. - - ```bash - node /out/server/src/server.js --stdio - ``` - ## Features ### Syntax highlighting @@ -145,6 +118,35 @@ The following settings are supported. will be used instead of the setting above to run in a Python virtual environment. +## Developer support + +1. Install prerequisites: + * latest [Visual Studio Code](https://code.visualstudio.com/) + * [Node.js](https://nodejs.org/) v12.0.0 or higher + +2. Fork and clone this repository + +3. Install the dependencies + + ```bash + cd ansible-language-server + npm ci + ``` + +4. Build the language server + + ```bash + npm run compile + ``` + +5. The new built server is now located in ./out/server/src/server.js. + + ```bash + node /out/server/src/server.js --stdio + ``` + +For details on setting up development environment and debugging [refer](doc/development.md) + ## Requirements * [Ansible 2.9+](https://docs.ansible.com/ansible/latest/index.html) diff --git a/doc/development.md b/doc/development.md new file mode 100644 index 00000000..dd7745df --- /dev/null +++ b/doc/development.md @@ -0,0 +1,61 @@ +# Development + +## Setting up development environment + +It is recommended to work on the forked copy of this repository from your github account to raise pull requests. + +```code +git clone git@github.com:/ansible-language-server.git +cd ansible-language-server +git remote add upstream git@github.com:ansible/ansible-language-server.git +git checkout -b +``` + +## Running & debugging the language-server with vscode + +* Install dependent packages within ansible-language-server root directory + +```code +ansible-language-server$ npm install . +``` + +This will install the dependent modules under `node_modules` folder within the current directory. + +* Clone the repository containing the vscode extension code into the `vscode-ansible` directory *next to* the root directory of this repository. + +```code +cd .. +git clone git@github.com:ansible/vscode-ansible.git +cd vscode-ansible +``` + +* Open a new vscode window and add folder to workspace `File -> Add folder to workspace` and add `vscode-ansible` and `ansible-language-server` folders to the workspace + +* Once the language server and vscode-ansible directory is prepared, compile both client and server using command + +```code +npm run compile:withserver +``` + +* In the Run and debug window select **Client + Server (source)** configuration + and start debugging `Run -> Start Debugging`. This will open up a new vscode window + which is the `Extension development Host` window. + +* In the `Extension development Host` window add a new folder that has ansible files. + +* You can set the ansible-language-server settings by adding `.vscode/settings.json` file under the root folder. Example settings: + +```code +{ + "ansible.python.interpreterPath": "", + "ansible.ansible.path": "", + "ansibleServer.trace.server": "verbose" +} +``` + +A demo of the setup can be found [on youtube](https://youtu.be/LsvWsX7Mbo8). + +## Cleaning the output + +If you hit an odd compilation or debugger problem, don't hesitate to clean the +output directory by running `npm run clean` under the `vscode-ansible` folder. You should also run it whenever you are switching between debug/compilation modes. From 9e91efa7c83a3a806fd543adf135d683f3ffc3ae Mon Sep 17 00:00:00 2001 From: "Ganesh B. Nalawade" Date: Mon, 18 Oct 2021 21:23:56 +0530 Subject: [PATCH 3/9] update development doc link --- README.md | 15 +++++++++------ doc/development.md | 4 ++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8e36cebf..523bacc2 100644 --- a/README.md +++ b/README.md @@ -110,11 +110,15 @@ The following settings are supported. `docker`. For `auto` it will look for `podman` then `docker`. * `ansible.executionEnvironment.enabled`: Enable or disable the use of an execution environment. -* `ansible.executionEnvironment.image`: Specify the name of the execution environment image. -* `ansible.executionEnvironment.pullPolicy`: Specify the image pull policy. Valid values are `always`, - `missing`, `never` and `tag`. Setting `always` will always pull the image when extension is activated or reloaded. - Setting `missing` will pull if not locally available. Setting `never` will never pull the image and setting - tag will always pull if the image tag is 'latest', otherwise pull if not locally available. +* `ansible.executionEnvironment.image`: Specify the name of the execution + environment image. +* `ansible.executionEnvironment.pullPolicy`: Specify the image pull policy. + Valid values are `always`, + `missing`, `never` and `tag`. Setting `always` will always pull the image + when extension is activated or reloaded. + Setting `missing` will pull if not locally available. Setting `never` will + never pull the image and setting tag will always pull if the image tag is + 'latest', otherwise pull if not locally available. * `ansible.python.interpreterPath`: Path to the `python`/`python3` executable. This setting may be used to make the extension work with `ansible` and `ansible-lint` installations in a Python virtual environment. @@ -122,7 +126,6 @@ The following settings are supported. will be used instead of the setting above to run in a Python virtual environment. - ## Developer support For details on setting up development environment and debugging [refer](doc/development.md) diff --git a/doc/development.md b/doc/development.md index 6e911e91..51df68bb 100644 --- a/doc/development.md +++ b/doc/development.md @@ -2,6 +2,8 @@ ## Setting up development environment +A demo of the setup can be found [on youtube](https://youtu.be/LsvWsX7Mbo8). + It is recommended to work on the forked copy of this repository from your github account to raise pull requests. ```code @@ -53,8 +55,6 @@ npm run compile:withserver } ``` -A demo of the setup can be found [on youtube](https://youtu.be/LsvWsX7Mbo8). - ## Cleaning the output If you hit an odd compilation or debugger problem, don't hesitate to clean the From 13d4911f367fb6f24cb21605de4a4b7468b1a56f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 18 Oct 2021 15:55:53 +0000 Subject: [PATCH 4/9] chore: auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- doc/development.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/development.md b/doc/development.md index 51df68bb..edbffb7a 100644 --- a/doc/development.md +++ b/doc/development.md @@ -46,7 +46,7 @@ npm run compile:withserver * In the `Extension development Host` window add a new folder that has ansible files. * You can set the ansible-language-server settings by adding `.vscode/settings.json` file under the root folder. Example settings: - + ```code { "ansible.python.interpreterPath": "", From 1e149f45a8e4a172d85081f54b4233ab7a040bb9 Mon Sep 17 00:00:00 2001 From: "Ganesh B. Nalawade" Date: Tue, 19 Oct 2021 08:07:28 +0530 Subject: [PATCH 5/9] fix review comments --- README.md | 2 +- docs/development.md | 89 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 docs/development.md diff --git a/README.md b/README.md index 523bacc2..59a46154 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,7 @@ The following settings are supported. ## Developer support -For details on setting up development environment and debugging [refer](doc/development.md) +For details on setting up development environment and debugging [refer](https://github.com/ansible/ansible-language-server/blob/main/docs/development.md) ## Requirements diff --git a/docs/development.md b/docs/development.md new file mode 100644 index 00000000..385351a0 --- /dev/null +++ b/docs/development.md @@ -0,0 +1,89 @@ +# Development + +## Setting up development environment + +A demo of the setup can be found [on youtube](https://youtu.be/LsvWsX7Mbo8). + +It is recommended to work on the forked copy of this repository from your github account to raise pull requests. + +```bash +git clone git@github.com:/ansible-language-server.git +cd ansible-language-server +git remote add upstream git@github.com:ansible/ansible-language-server.git +git fetch --all +git checkout -b upstream/main +``` + +## Running & debugging the language-server with vscode + +* Install dependent packages within ansible-language-server root directory + +```console +ansible-language-server$ npm install . +``` + +This will install the dependent modules under `node_modules` folder within the current directory. + +* Clone the repository containing the vscode extension code into the `vscode-ansible` directory *next to* the root directory of this repository. + +```bash +cd .. +git clone git@github.com:ansible/vscode-ansible.git +cd vscode-ansible +``` + +* Open a new vscode window and add folder to workspace `File -> Add folder to workspace` and add `vscode-ansible` and `ansible-language-server` folders to the workspace + +* Once the language server and vscode-ansible directory is prepared, compile both client and server using command + +```bash +npm run compile:withserver +``` + +* In the Run and debug window select **Client + Server (source)** configuration + and start debugging `Run -> Start Debugging`. This will open up a new vscode window + which is the `Extension development Host` window. + +* In the `Extension development Host` window add a new folder that has ansible files. + +* You can set the ansible-language-server settings by adding `.vscode/settings.json` file under the root folder. Example settings: + +```json +{ + "ansible.python.interpreterPath": "", + "ansible.ansible.path": "", + "ansibleServer.trace.server": "verbose" +} +``` + +## Cleaning the output + +If you hit an odd compilation or debugger problem, don't hesitate to clean the +output directory by running `npm run clean` under the `vscode-ansible` folder. You should also run it whenever you are switching between debug/compilation modes. + +### Building server locally + +1. Install prerequisites: + * latest [Visual Studio Code](https://code.visualstudio.com/) + * [Node.js](https://nodejs.org/) v12.0.0 or higher + +2. Fork and clone this repository + +3. Install the dependencies + + ```bash + cd ansible-language-server + npm ci + ``` + +4. Build the language server + + ```bash + npm run compile + ``` + +5. The newly built server is now located in ./out/server/src/server.js. + + ```bash + node /out/server/src/server.js --stdio + ``` From 1ea71c6ee1da9624000fa17bbd4523ebd56a72a9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 19 Oct 2021 02:40:17 +0000 Subject: [PATCH 6/9] chore: auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/development.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/development.md b/docs/development.md index 385351a0..aaa419a0 100644 --- a/docs/development.md +++ b/docs/development.md @@ -47,7 +47,7 @@ npm run compile:withserver * In the `Extension development Host` window add a new folder that has ansible files. * You can set the ansible-language-server settings by adding `.vscode/settings.json` file under the root folder. Example settings: - + ```json { "ansible.python.interpreterPath": "", From 420431c06caa73fe24f37ab99b34bf674310f370 Mon Sep 17 00:00:00 2001 From: "Ganesh B. Nalawade" Date: Tue, 19 Oct 2021 08:30:03 +0530 Subject: [PATCH 7/9] remove doc folder --- doc/development.md | 88 ---------------------------------------------- 1 file changed, 88 deletions(-) delete mode 100644 doc/development.md diff --git a/doc/development.md b/doc/development.md deleted file mode 100644 index edbffb7a..00000000 --- a/doc/development.md +++ /dev/null @@ -1,88 +0,0 @@ -# Development - -## Setting up development environment - -A demo of the setup can be found [on youtube](https://youtu.be/LsvWsX7Mbo8). - -It is recommended to work on the forked copy of this repository from your github account to raise pull requests. - -```code -git clone git@github.com:/ansible-language-server.git -cd ansible-language-server -git remote add upstream git@github.com:ansible/ansible-language-server.git -git checkout -b -``` - -## Running & debugging the language-server with vscode - -* Install dependent packages within ansible-language-server root directory - -```code -ansible-language-server$ npm install . -``` - -This will install the dependent modules under `node_modules` folder within the current directory. - -* Clone the repository containing the vscode extension code into the `vscode-ansible` directory *next to* the root directory of this repository. - -```code -cd .. -git clone git@github.com:ansible/vscode-ansible.git -cd vscode-ansible -``` - -* Open a new vscode window and add folder to workspace `File -> Add folder to workspace` and add `vscode-ansible` and `ansible-language-server` folders to the workspace - -* Once the language server and vscode-ansible directory is prepared, compile both client and server using command - -```code -npm run compile:withserver -``` - -* In the Run and debug window select **Client + Server (source)** configuration - and start debugging `Run -> Start Debugging`. This will open up a new vscode window - which is the `Extension development Host` window. - -* In the `Extension development Host` window add a new folder that has ansible files. - -* You can set the ansible-language-server settings by adding `.vscode/settings.json` file under the root folder. Example settings: - -```code -{ - "ansible.python.interpreterPath": "", - "ansible.ansible.path": "", - "ansibleServer.trace.server": "verbose" -} -``` - -## Cleaning the output - -If you hit an odd compilation or debugger problem, don't hesitate to clean the -output directory by running `npm run clean` under the `vscode-ansible` folder. You should also run it whenever you are switching between debug/compilation modes. - -### Building server locally - -1. Install prerequisites: - * latest [Visual Studio Code](https://code.visualstudio.com/) - * [Node.js](https://nodejs.org/) v12.0.0 or higher - -2. Fork and clone this repository - -3. Install the dependencies - - ```bash - cd ansible-language-server - npm ci - ``` - -4. Build the language server - - ```bash - npm run compile - ``` - -5. The new built server is now located in ./out/server/src/server.js. - - ```bash - node /out/server/src/server.js --stdio - ``` From b2ef04dbb7577ef094a7dda3d31b17164c450af0 Mon Sep 17 00:00:00 2001 From: "Ganesh B. Nalawade" Date: Tue, 19 Oct 2021 14:36:12 +0530 Subject: [PATCH 8/9] fix review comment --- docs/development.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/development.md b/docs/development.md index aaa419a0..114c3108 100644 --- a/docs/development.md +++ b/docs/development.md @@ -85,5 +85,5 @@ output directory by running `npm run clean` under the `vscode-ansible` folder. Y 5. The newly built server is now located in ./out/server/src/server.js. ```bash - node /out/server/src/server.js --stdio + node ./out/server/src/server.js --stdio ``` From fb59f6b1fe5c2944716fd40a6fd09c49e69d45ef Mon Sep 17 00:00:00 2001 From: "Ganesh B. Nalawade" Date: Tue, 19 Oct 2021 14:59:33 +0530 Subject: [PATCH 9/9] fix linter issues --- README.md | 2 +- docs/development.md | 23 ++++++++++++++++------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 59a46154..392feb1e 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,7 @@ The following settings are supported. ## Developer support -For details on setting up development environment and debugging [refer](https://github.com/ansible/ansible-language-server/blob/main/docs/development.md) +For details on setting up development environment and debugging [refer](https://github.com/ansible/ansible-language-server/blob/main/docs¸/development.md) ## Requirements diff --git a/docs/development.md b/docs/development.md index 114c3108..b991c559 100644 --- a/docs/development.md +++ b/docs/development.md @@ -4,7 +4,8 @@ A demo of the setup can be found [on youtube](https://youtu.be/LsvWsX7Mbo8). -It is recommended to work on the forked copy of this repository from your github account to raise pull requests. +It is recommended to work on the forked copy of this repository from your +github account to raise pull requests. ```bash git clone git@github.com:/ansible-language-server.git @@ -22,9 +23,11 @@ git checkout -b upstream/main ansible-language-server$ npm install . ``` -This will install the dependent modules under `node_modules` folder within the current directory. +This will install the dependent modules under `node_modules` folder within +the current directory. -* Clone the repository containing the vscode extension code into the `vscode-ansible` directory *next to* the root directory of this repository. +* Clone the repository containing the vscode extension code into the + `vscode-ansible` directory *next to* the root directory of this repository. ```bash cd .. @@ -32,9 +35,12 @@ git clone git@github.com:ansible/vscode-ansible.git cd vscode-ansible ``` -* Open a new vscode window and add folder to workspace `File -> Add folder to workspace` and add `vscode-ansible` and `ansible-language-server` folders to the workspace +* Open a new vscode window and add folder to workspace + `File -> Add folder to workspace` and add `vscode-ansible` and + `ansible-language-server` folders to the workspace -* Once the language server and vscode-ansible directory is prepared, compile both client and server using command +* Once the language server and vscode-ansible directory is prepared, + compile both client and server using command ```bash npm run compile:withserver @@ -46,7 +52,8 @@ npm run compile:withserver * In the `Extension development Host` window add a new folder that has ansible files. -* You can set the ansible-language-server settings by adding `.vscode/settings.json` file under the root folder. Example settings: +* You can set the ansible-language-server settings by adding + `.vscode/settings.json` file under the root folder. Example settings: ```json { @@ -59,7 +66,9 @@ npm run compile:withserver ## Cleaning the output If you hit an odd compilation or debugger problem, don't hesitate to clean the -output directory by running `npm run clean` under the `vscode-ansible` folder. You should also run it whenever you are switching between debug/compilation modes. +output directory by running `npm run clean` under the `vscode-ansible` folder. +You should also run it whenever you are switching between debug/compilation +modes. ### Building server locally