This repository has been archived by the owner on Oct 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 91
doc: update readme file and add development docs #80
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
e952c7c
doc: update readme file with language server settings
ganeshrn 9639f2e
doc: update readme doc and add development doc
ganeshrn 3d3ab8c
doc: update readme file and add development docs
ganeshrn 9e91efa
update development doc link
ganeshrn 13d4911
chore: auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 1e149f4
fix review comments
ganeshrn 1ea71c6
chore: auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 420431c
remove doc folder
ganeshrn 2618e99
Merge branch 'update_docs' of https://github.com/ganeshrn/ansible-lan…
ganeshrn b2ef04d
fix review comment
ganeshrn fb59f6b
fix linter issues
ganeshrn ca30ae0
Merge branch 'main' into update_docs
ssbarnea File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# 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 [email protected]:<your-github-id>/ansible-language-server.git | ||
cd ansible-language-server | ||
git remote add upstream [email protected]:ansible/ansible-language-server.git | ||
git fetch --all | ||
git checkout -b <name_of_branch> 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 [email protected]: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": "<change to python3 executable path>", | ||
"ansible.ansible.path": "<change to ansible executable 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 | ||
``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This got
¸
broken.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by #83.