Skip to content

galaxyproject/galaxy-language-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Galaxy Language Server

Actions Status License

The aim of this project is to implement the Language Server Protocol to assist in the development of Galaxy tool wrappers inside modern code editors.

The idea is to provide realtime XML validation, code completion, help/documentation and other smart features to help in following best practices during the development process of XML tool wrappers for Galaxy.

This repository contains both the server implementation in Python and the client implementation of a Visual Studio Code extension in Node.js.

Please note this is still an early work in progress and bugs and issues are expected.

Features

Tag and attribute auto-completion

Demo feature auto-completion

The tags and attributes are suggested based on the Galaxy.xsd schema. They will appear in the same order that they are declared in the schema, so they can comply with the best practices recommendations defined in the Galaxy IUC Standards Style Guide.

Documentation on Hover

Demo feature hover documentation

The documentation of tags and attributes is retrieved from the Galaxy.xsd schema.

Please note that some elements in the schema are still missing documentation. This will probably be improved over time.

Document validation

Demo feature validation

The tools are also validated against the Galaxy.xsd schema.

Document auto-formatting

Demo feature auto-formatting

When the tool file is saved it gets auto-formatted to maintain a consistent format with the Galaxy IUC Standards Style Guide.

Tag auto-closing

Demo feature auto-close tags

Whenever you write a closing > the corresponding closing tag will be inserted. You can also type / in an open tag to close it.

Snippets

Demo snippets

Snippets can be really helpful to speed up your tool wrapper development. They allow to quickly create common blocks and let you enter just the important information by pressing tab and navigating to the next available value.

If you want to add more snippets check the guide in the contribution guidelines.


Release History

Current version: Unreleased

See the change log for details.


Getting Started

If you are considering contributing, please read the contribution guide.

Setup for local development

  1. Fork this repo on Github

  2. Clone your fork locally:

    git clone https://github.com/<your_github_name>/galaxy-tools-extension.git
  3. Create a virtual environment using conda and install the dependencies:

    conda create -n <environment-name> python=3.8
    conda activate <environment-name>
    
    # For the language server:
    pip install -r requirements-dev.txt
    
    # For the client extension:
    conda install nodejs typescript
    npm install
  4. Run the tests locally

    # For the language server:
    pytest
    # Additionally you can check the coverage:
    pytest --cov=server
  5. Create a branch for local development:

    git checkout -b name-of-your-bugfix-or-feature

    Now you can make your changes locally.

    Remember to check the Style Guide to maintain an uniform code style.

  6. When you're done making changes, check that your changes pass style linter and the tests.

    flake8
    pytest
  7. Commit your changes and push your branch to GitHub::

    git add .
    git commit -m "Your detailed description of your changes."
    git push origin name-of-your-bugfix-or-feature
  8. Submit a pull request through the GitHub website.

Setup Visual Studio Code for debugging

If you want to debug the extension and the Language Server at the same time follow these steps:

  1. Open the galaxy-tool-extension directory in Visual Studio Code
  2. Open debug view (ctrl + shift + D)
  3. Select Server + Client and press F5