Metadata-Version: 2.1
Name: galaxy-language-server
Version: 0.3.1
Summary: A language server for Galaxy (https://galaxyproject.org) tool wrappers
Home-page: https://github.com/davelopez/galaxy-language-server/tree/master/server
Author: David López
Author-email: davelopez7391@gmail.com
License: Apache License 2.0
Keywords: galaxy,python,language server
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Requires-Python: ~=3.8
Description-Content-Type: text/markdown
Requires-Dist: pygls (==0.9.1)
Requires-Dist: lxml (==4.6.2)
Requires-Dist: anytree (==2.8.0)
Requires-Dist: galaxy-tool-util (==21.1.0.dev4)

# Galaxy Language Server
[![Actions Status](https://github.com/davelopez/galaxy-language-server/workflows/Language%20Server%20CI/badge.svg)](https://github.com/davelopez/galaxy-language-server/actions)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/galaxy-language-server)
[![PyPI version](https://badge.fury.io/py/galaxy-language-server.svg)](https://badge.fury.io/py/galaxy-language-server)

[Language Server](https://microsoft.github.io/language-server-protocol/) implementation written in Python ([pygls](https://github.com/openlawlibrary/pygls)) to assist in the development of [Galaxy tool wrappers](https://docs.galaxyproject.org/en/latest/dev/schema.html).

#### Dependencies
* [pygls](https://github.com/openlawlibrary/pygls): generic implementation of the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/specification) in Python.
* [lxml](https://lxml.de/index.html): Python library for processing XML files.
* [anytree](https://github.com/c0fec0de/anytree): Python library with an easy to use tree structure.
* [galaxy-tool-util](https://pypi.org/project/galaxy-tool-util/): the [Galaxy](https://galaxyproject.org/) tool utilities for Python.


# Getting Started
Check the [Getting Started](https://github.com/galaxyproject/galaxy-language-server/blob/master/docs/CONTRIBUTING.md#getting-started) section in the [contributing](https://github.com/galaxyproject/galaxy-language-server/blob/master/docs/CONTRIBUTING.md) docs.

# How to manually run the server
Usually, the [client](https://github.com/galaxyproject/galaxy-language-server/tree/master/client) will be in charge of running the server when it is needed, but, in case you want to run it manually for some reason, you can use the following commands:

In any case, it is recommended to create a Python virtual environment first (assuming you are using `Python3.8+`):
````sh
# Create a virtual environment and activate it
python -m venv myenv
source ./myenv/bin/activate
````

## Option 1: Installing from PyPi
````sh
# Install the language server and its dependencies
pip install galaxy-language-server
````

## Option 2: Building from source
````sh
# Clone the repo
git clone https://github.com/galaxyproject/galaxy-language-server.git

# Go to the server directory
cd galaxy-language-server/server

# Install the dependencies
python -m pip install -r ./requirements.txt
````

## Run the server
````sh
# Run the server with the default parameters
python -m galaxyls
````

By default, the server uses IO pipes to communicate with the client. If you want to use TCP, you can pass additional parameters, for example:

````sh
python -m galaxyls --tcp --host=127.0.0.1 --port=2087
````

To check if everything went ok, you can look at the content of the server log file (``galaxy-language-server.log``) that should contain the following lines:
````
INFO:pygls.server:Starting server on 127.0.0.1:2087
INFO:pygls.server:Shutting down the server
INFO:pygls.server:Closing the event loop.
````
# Galaxy Language Server Changelog

## [0.3.1] - 2021-01-09

### Fixed

- The autocompletion of tags and attributes was leaking into the `CDATA` sections ([#86](https://github.com/galaxyproject/galaxy-language-server/pull/86)).

- Weird behavior of the autoclosing tag feature ([#86](https://github.com/galaxyproject/galaxy-language-server/pull/86)).

- When using a custom command to auto-generate the `<command>` or the `<tests>` sections (with a tool document containing `macros`), the insert position inside the document for the code snippets was offset ([#83](https://github.com/galaxyproject/galaxy-language-server/pull/83)).

## [0.3.0] - 2021-01-01

### Added

- A custom command to auto-generate the `<command>` section with boilerplate Cheetah template based on the current `inputs` and `outputs` defined in the tool ([#77](https://github.com/galaxyproject/galaxy-language-server/pull/77)).
- A custom command to auto-generate `<test>` cases based on the current `inputs` and `outputs` defined in the tool ([#73](https://github.com/galaxyproject/galaxy-language-server/pull/73)).

### Fixed

- Avoid processing unknown XML documents (aka *not* tool wrappers) ([#75](https://github.com/galaxyproject/galaxy-language-server/pull/75)).
- Broken XML parsing when more than one comment block was present in the document ([#70](https://github.com/galaxyproject/galaxy-language-server/pull/70)).

## [0.2.1] - 2020-11-22

### Fixed

- The documentation displayed when hovering an element now shows the correct documentation instead of `No documentation available` ([#64](https://github.com/galaxyproject/galaxy-language-server/pull/64)).

## [0.2.0] - 2020-11-13

### Added

- Client settings to control completion features ([#56](https://github.com/galaxyproject/galaxy-language-server/pull/56)).

### Changed

- The XML parser has been replaced with a better implementation ([#55](https://github.com/galaxyproject/galaxy-language-server/pull/55)).

## [0.1.2] - 2020-10-25

### Removed

- Removed unused function ``XsdTree.find_node_by_name()``.

## [0.1.1] - 2020-10-24

### Added

- Support autocompletion for ``<expand>`` element.

### Changed

- Updated dependencies to latest versions.

### Fixed

- Fix error when hovering ``<expand>`` elements or it's atributes (#41).


## [0.1.0] - 2020-10-14

### Added

- Basic tag and attribute auto-completion.
- Auto-close tags feature.
- XML tool validation when opening and saving file.
- Basic validation of macros.
- Auto-formatting document when saving file.
- Display tag and attribute documentation when hovering.


