This repository contains two projects:
- Galaxy Language Server: Python implementation of the Language Server Protocol.
- Galaxy Tools extension: Visual Studio Code extension in Node.js.
This project has the following main goals:
- Encourage best practices: one of the most important goals of this project is to assist the developer in writing tools that follow the best practices established by the Intergalactic Utilities Commission by providing features like attribute sorting or auto-formatting and many more to come!
- Easy onboarding of new Galaxy tool developers: with the intelligent code completion and the documentation tooltips, new developers can reduce the need for memorizing tags and attributes as well as easily discover what they need as they write avoiding syntax and structural errors on the way.
- Development speed: more experienced developers can greatly boost their speed writing tools for Galaxy by using the code snippets to quickly write code for commonly used tag or even generating scaffolding code for the tests covering most of the conditional paths of their tool.
Please note this is still a work in progress so bugs and issues are expected. If you find any, you are welcome to open a new issue.
- Getting Started
- Features
- Tag and attribute auto-completion
- Documentation on Hover
- Document validation
- Document auto-formatting
- Tag auto-closing
- Snippets
- Embedded syntax highlighting
- Auto-generate tests
- Auto-generate command section
- Auto-sort param attributes
- Run planemo tests in the Test Explorer
- Improved macros support
- Extract macro
- Full Galaxy tool linter integration
- Document Outline
- Insert param reference New feature! ✨
If you just want to use the features provided by the Galaxy Language Server, the easiest and recommended option is to install the VSCode extension from the Market or, if you prefer, you can use VSCodium and the Open VSX registry. Additionally, you can download the VSIX package from the releases page and install it manually.
If you are considering contributing, please read the contribution guide.
To setup your development environment, please check this guide.
You can watch a (somewhat old) short video with a tour of some of the features of the Galaxy Tools extension here:
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.
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.
In addition to basic XML syntax validation, the tools are validated against the Galaxy.xsd schema.
Since version 0.8.0 the full Galaxy linting is directly reported on the document diagnostics.
When the tool file is saved it gets auto-formatted to comply with the Galaxy IUC Standards Style Guide.
Whenever you write a closing (>
), the corresponding closing tag will be inserted. You can also type /
in an open tag to close it.
Snippets can be really helpful to speed up your tool wrapper development. They allow you 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.
Basic support for Cheetah
and reStructuredText
syntax highlighting inside the <command>
, <configfile>
and <help>
tags. The embedded code should be inside a CDATA
block.
After you define the <inputs>
and <outputs>
of the tool, you can press Ctrl+Alt+t
(or Cmd+Alt+t
in Mac) to create a <tests>
section with a basic structure and some test cases. This is especially useful when using conditionals and other nested parameters since you can get right away most of the boilerplate XML. You can always change the key bindings to your personal preference, see the documentation.
Similar to the auto-generate tests command, but this time it will generate boilerplate Cheetah
code for the <command>
section.
Now you can automatically sort the attributes of param elements according to the IUC Coding Style guidelines using a key-shortcut or the command palette. This can be done for each <param>
element individually or for the full document.
You can now run planemo test
for the currently opened tool directly from the Test Explorer
.
- The tests are automatically discovered by the
galaxy-language-server
when you open a tool or save the document (this can be controlled by the settings). - You can then run all the tests from the
Test Explorer
by usingplanemo test
in the background. Currently running individual tests is not supported as AFAIKplanemo
does not have an option to do so at the moment. - After successfully running the tests, the results will be displayed in a convenient way directly on your source XML.
The failing tests will be marked in red and the reason for failure can be seen directly beside the test definition (or you can right click the icon next to your test definition and choose Peek Error
). You can also directly navigate to each of the tests XML source from the Test Explorer
.
This can be very convenient especially when having a large number of tests in your tool.
Since version 0.5.0
we added some interesting features around the use of macros. For example, you can now better troubleshoot validation errors caused by some included macro. The error messages will be more detailed and you can even navigate to a expanded
version of the tool to see what the real tool document look like and what was causing the error.
There are also a lot of features around macros auto-completion. You can now navigate to macro
and token
definitions with F12
or get dynamic attribute auto-completion with parametrized macros and more.
You can select (a complete) XML element and then extract it to a local macro (directly in the tool wrapper) or into an external macro file. If there are several imported macro files, you can choose where to put them or if there is no imported file it will be created and imported directly.
You can now see a document outline of the currently opened tool document. This is especially useful when working with large tool documents. You can navigate to the different sections of the document in a quick and convenient way.
Now you can use new commands to insert input parameter references into your wrapper. To insert a parameter reference in the command section, place your cursor in the desired position and then invoke the Insert a reference to a param element.
command from the command palette (ctrl+shift+p
) or directly use the default key binding for that command ctrl+alt+i ctrl+alt+p
.
In a similar way, you can also invoke a command but for inserting a param reference that can be used inside an output filter. The default key binding for that is ctrl+alt+i ctrl+alt+f
.