IDE setup

Since a Viash components consists of a script in one of the supported languages and a YAML file, you can use any editor of your choosing to create these files.

When building a Nextflow pipeline built from Viash components written in Bash, R, and Python, we highly recommend using Visual Studio Code.

What is Visual Studio Code?

Visual Studio Code is an open source code-editor developed by Microsoft for Windows, Linux and macOS. As of 2021, it’s the #1 most popular developer environment tool, and for good reason. It’s lightweight, supports many languages and has a ton of features. Some of its most prominent features include:

  • Syntax highlighting
  • Intelligent code completion
  • Code refactoring
  • Embedded Git
  • Snippets
  • Extensions and themes

Installation

VS Code can be downloaded from this page:

https://code.visualstudio.com/Download

There are installers available for all major operating systems, so simply download and install the version for your system.

Markdown

If you’re planning on writing documentation for components you write, can supplement the description and the CLI with a Markdown document. VS Code has Markdown support built-in, but the extension below makes writing markdown documents even easier!

  • Markdown All in One: Some of the features include keyboard shortcuts for text formatting, list editing, GitHub flavored Markdown and auto completion for Markdown.

Bash

  • shell-format: By installing this extension, you get syntax highlighting and code formatting for shell scripts.

C#

  • C#: Adds syntax highlighting, IntelliSense and debugging capabilities to VS Code for C#.

Python

Python: Adds syntax highlighting, IntelliSense, debugging and code formatting. This extension also installs the PyLance language server and Jupyter for Jupyter Notebook support.

Javascript

Node.js Extension Pack: VS Code actually already has a lot of Node.js features out of the box, but this extension pack adds adds even more. The extensions adds JS code hints, module search, code snippets and IntelliSense for NPM and paths just to name a few features.

R

R: This extension adds syntax highlighting, code analysis, keyboard shortcuts, package management and a lot more for the R language.

Note: This extension requires you to install R and the languageserver CRAN package which depends on libxml2-dev, libcurl4-openssl-dev and libssl-dev before the extension will work.

Scala

WSL2

If you’re using WSL2, you’ll probably want to install the Remote - WSL extension. This extension lets you use your Windows version of VS Code in WSL2, as if it was running native.
The commands, extensions and the terminal will run on WSL, which makes for an ideal hybrid environment.

Once installed, you can connect to WSL2 by clicking the green remote button at the bottom left and choosing New WSL Window in the list that pops up. Alternatively, you can use the command code FOLDER/FILE (e.g. code .) on the WSL2 side to open that file or folder in a remote VS Code session.