The anthaVM comes packaged with a development environment (LiteIDE) configured for code autocompletion and syntax highlighting of antha code. You can also install LiteIDE with Homebrew if you are on OSX.
Installing LiteIDE is easy with Homebrew. To install lite IDE, copy and paste the following command into your terminal:
brew install Caskroom/cask/LiteIDE
Once Homebrew has finished installing LiteIDE it is ready to use to edit your Antha files. However, editing them will be easier with syntax highlighting. Syntax highlighting is a feature that many IDEs have where keywords and special characters are coloured in different ways. This makes it easier to edit files and avoid mistakes.
To add syntax highlighting to liteIDE, you can borrow a configuration file located in the "antha-tools" repository on github. To get antha-tools from github, copy the following command into your terminal:
go get github.com/antha-lang/antha-tools
Note: the following message may appear when you run this command:
can't load package: package github.com/antha-lang/antha-tools: no buildable Go source files in /Users/josialemke/go/src/github.com/antha-lang/antha-tools
This is normal and the Go repository will have been downloaded properly.
Next we have to copy the configuration file from antha-tools into LiteIDE. You can do this easily from the terminal with the following command:
cp $GOPATH/src/github.com/antha-lang/antha-tools/syntax_highlighting_plugins/kate/antha.xml /Applications/LiteIDE.app/Contents/Resources/liteeditor/kate/
Sometimes when editing your code, you need to view the .go files which make up the backbone of antha. However, finding the source of various functions inside those Go files can be difficult to find. In LiteIDE you can edit an environment variables file so that you can quickly and easily find the declarations of any Go function.
The edit environment variables file can be accessed by clicking the small grey rectangle at the top of the LiteIDE window.
The environment variables file is an editable text file. The default view should look like the image below.
You need to add a GOPATH environment variable to this file, and it needs to match the contents of your computers GOPATH environment variable exactly. To find what that value is, type the following into your terminal:
You should see something that resembles the following:
Copy the value from Step 3 and paste it into the environment variables document in LiteIDE. If you do this correctly, your document shold look similar to the one below. When you have done this, save the file.
To ensure that you have configured your environment variables correctly, open a Go file from antha-lang/elements. To open a file in LiteIDE, click "File" and "Open File" from the top menu.
Navigate to go, src, github.com, antha-lang, elements, and lib to find all of the compiled go files in Antha. Choose "Aliquot.go"
Inside of Aliquot.go, find a function for which you would like to trace it's declaration. Right click or the function and choose "Jump to Declaration."
If your environment variables have been configured properly, a new file will be opened with the function declaration highlighted.