VSCode: Vala Development

How to setup VSCodium (Open Source Visual Studio Code) for Vala development.

If you like my work, ❤️ Sponsor Me. It would mean the world to me!

VSCodium

Install VSCodium from deb package (as documented on the official website).

Add the GPG key of the repository:

wget -qO - https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg | gpg --dearmor | sudo dd of=/etc/apt/trusted.gpg.d/vscodium.gpg

Add the repository:

echo 'deb https://paulcarroty.gitlab.io/vscodium-deb-rpm-repo/debs/ vscodium main' | sudo tee --append /etc/apt/sources.list.d/vscodium.list

Update package information and install vscodium:

sudo apt update && sudo apt install codium

Syntax Highlighting

To begin with, you need to install the Vala Plugin for Visual Studio Code:

  1. Visit the plugin's website and click "Download Extension" (a *.vsix file)

  2. Run VSCodium

  3. From within VSCodium, open the Extensions tab (Ctrl + Shift + X)

  4. Click ... > Install from VSIX... on top of the Extensions sidebar

  5. Select the previously downloaded *.vsix file and click Install

Now you can install the Vala Language Server. For this, open a Terminal and execute the following command:

sudo apt install vala-language-server

Debugging

Install the CodeLLDB Plugin for Visual Studio Code:

  1. Visit the plugin's website and click "Download Extension" (a *.vsix file)

  2. Run VSCodium

  3. From within VSCodium, open the Extensions tab (Ctrl + Shift + X)

  4. Click ... > Install from VSIX... on top of the Extensions sidebar

  5. Select the previously downloaded *.vsix file and click Install

Now you can install the LLDB Debugger. For this, open a Terminal and execute the following command:

sudo apt install lldb

Make sure to restart VSCodium and then you are nearly ready to start: When you start the debugger the first time in a project, it will ask for a run configuration. Here's a minimal one which should be enough to get you started:

{
  "version": "0.2.0",
  "configurations": [{
    "type": "lldb",
    "request": "launch",
    "name": "Debug",
    "program": "${workspaceFolder}/build/src/com.github.myteam.myapp",
    "args": [],
    "cwd": "${workspaceFolder}"
  }]
}

If you want to know more, make sure to have a look at the README in the CodeLLDB repo.

Further Reading

Last updated