Metadata-Version: 2.1
Name: nwscript-language-server
Version: 0.6.dev0
Summary: A language server for Bioware's nwscript
Home-page: https://github.com/jd28/nwscript-lsp
Keywords: nwscript,completion,lsp,language-server-protocol
Author: jmd
Author-email: joshua.m.dean@gmail.com
Requires-Python: >=3.10,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: cattrs (>=23.1.2)
Requires-Dist: docstring-to-markdown (==0.*)
Requires-Dist: lsprotocol (>=2022.0.0a9)
Requires-Dist: pygls (>=1.2.1,<2.0.0)
Requires-Dist: rollnw (==0.23.*)
Project-URL: Repository, https://github.com/jd28/nwscript-lsp
Description-Content-Type: text/markdown

# nwscript-lsp

The LSP is built on [pygls](https://github.com/openlawlibrary/pygls) and [rollnw](https://github.com/jd28/rollnw).  It is derived from the [Pygls Playground](https://github.com/openlawlibrary/pygls/tree/main/examples/vscode-playground) and aims, at this point, only to be a tested bed for implementing LSP features.  A more robust implementation will come later maybe integrating with [nasher.cfg](https://github.com/squattingmonk/nasher#nashercfg).  For now only the current document path will be added to the include path of the script context resman.

That the testbed extension is for vscode is out of simplicity, obviously plugins for any LSP client emacs, (neo)vim, etc will be supported.

Currently, it implements:
* Completions
* Hover
* Workspace Diagnostics
* Document Symbols
* Signature Help

## Setup

### Install Server Dependencies

Open a terminal in the repository's root directory

1. Create a virtual environment
   ```
   python -m venv env
   ```

1. Install pygls
   ```
   python -m pip install -r requirements.txt
   ```

### Install Client Dependencies

Open terminal in the same directory as this file and execute following commands:

1. Install node dependencies

   ```
   npm install
   ```
1. Compile the extension

   ```
   npm run compile
   ```
   Alternatively you can run `npm run watch` if you are going to be actively working on the extension itself.

### Run Extension

1. Open this directory in VS Code

1. The playground relies on the [Python extension for VSCode](https://marketplace.visualstudio.com/items?itemName=ms-python.python) for choosing the appropriate Python environment in which to run the example language servers.
   If you haven't already, you will need to install it and reload the window.

1. Open the Run and Debug view (`ctrl + shift + D`)

1. Select `Launch Client` and press `F5`, this will open a second VSCode window with the `vscode-playground` extension enabled.

1. You will need to make sure that VSCode is using a virtual environment that contains an installation of `pygls`.
   The `Python: Select Interpreter` command can be used to pick the correct one.

   Alternatively, you can set the `pygls.server.pythonPath` option in the `.vscode/settings.json` file

