galaxyproject / galaxy-language-server

Galaxy Language Server to help in Galaxy (https://galaxyproject.org/) tool wrappers development.
Apache License 2.0
22 stars 11 forks source link

Instructions to start the server #60

Closed mtekman closed 3 years ago

mtekman commented 3 years ago

Hi, thanks for this great work -- I cannot seem to get the galaxy-language-server to start

Steps

git clone git@github.com:galaxyproject/galaxy-language-server.git
cd galaxy-language-server/server
virtualenv myenv && source myenv/bin/activate
pip install -r ./requirements-dev.txt
python install . 
>
> Successfully built galaxy-language-server
> Installing collected packages: galaxy-language-server
>   Attempting uninstall: galaxy-language-server
>     Found existing installation: galaxy-language-server 0.0.0
>     Uninstalling galaxy-language-server-0.0.0:
>       Successfully uninstalled galaxy-language-server-0.0.0
> Successfully installed galaxy-language-server-0.0.0
> 
# ??? now what

In the galaxy-language-server/server/build folder I see:

build
├── bdist.linux-x86_64
└── lib
    └── galaxyls
        ├── config.py
        ├── features.py
        ├── __init__.py
        ├── __main__.py
        ├── server.py
        ├── services
        │   ├── completion.py
        │   ├── context.py
        │   ├── format.py
        │   ├── __init__.py
        │   ├── language.py
        │   ├── xml
        │   │   ├── constants.py
        │   │   ├── document.py
        │   │   ├── __init__.py
        │   │   ├── nodes.py
        │   │   ├── parser.py
        │   │   ├── scanner.py
        │   │   ├── types.py
        │   │   └── utils.py
        │   └── xsd
        │       ├── constants.py
        │       ├── __init__.py
        │       ├── parser.py
        │       ├── service.py
        │       ├── types.py
        │       └── validation.py
        └── types.py
galaxyls
├── config.py
├── features.py
├── __init__.py
├── __main__.py
├── server.py
├── services
│   ├── completion.py
│   ├── context.py
│   ├── format.py
│   ├── __init__.py
│   ├── language.py
│   ├── xml
│   │   ├── constants.py
│   │   ├── document.py
│   │   ├── __init__.py
│   │   ├── nodes.py
│   │   ├── parser.py
│   │   ├── scanner.py
│   │   ├── types.py
│   │   └── utils.py
│   └── xsd
│       ├── constants.py
│       ├── __init__.py
│       ├── parser.py
│       ├── service.py
│       ├── types.py
│       └── validation.py
├── tests
│   ├── __init__.py
│   └── unit
│       ├── __init__.py
│       ├── sample_data.py
│       ├── test_completion.py
│       ├── test_config.py
│       ├── test_context.py
│       ├── test_format.py
│       ├── test_validation.py
│       ├── test_xsd_parser.py
│       ├── test_xsd_service.py
│       ├── utils.py
│       └── xml
│           ├── __init__.py
│           └── test_parser.py
└── types.py

Trying to run something

Beyond this, I am not sure how to start the server

davelopez commented 3 years ago

Hi @mtekman, to run the language server manually you have to run it with the -m flag.

The steps would be:

git clone https://github.com/galaxyproject/galaxy-language-server.git
cd galaxy-language-server/server
python3 -m venv myenv
source ./myenv/bin/activate
python3 -m pip install -r ./requirements.txt

python3 -m galaxyls

If everything went well, you can check the log file galaxy-language-server.log was created and the contents have something like this:

INFO:pygls.server:Starting IO server
INFO:pygls.server:Shutting down the server
INFO:pygls.server:Closing the event loop.

By default, the server uses IO pipes to communicate with the client, if you want to use TCP you can pass additional parameters as described here:

python3 -m galaxyls --tcp --host=127.0.0.1 --port=2087

Usually, the client will be in charge of running the server when it is needed like here, but in case someone wants to run it manually, I will add a section in the readme to explain this, so thank you for bringing it up :)

mtekman commented 3 years ago

Oh, I was just about to write that I got it working with

python -m galaxyls <<< 'from galaxyls import server; server.LanguageServer.start_tcp("0.0.0.0","9991");' 

but your way is much easier :D