Skip to main content

A language server for Bioware's nwscript

Project description

nwscript-lsp

The LSP is built on pygls and rollnw. It is derived from the Pygls 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. 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
    
  2. 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
    
  2. 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

  2. The playground relies on the Python extension for VSCode 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.

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

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

  5. 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nwscript_language_server-0.5.dev0.tar.gz (9.8 kB view hashes)

Uploaded Source

Built Distribution

nwscript_language_server-0.5.dev0-py3-none-any.whl (11.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page