Code Intelligence for Vala & Genie
LGPL-2.1 License
This is a language server for the Vala programming language.
We recommend using VSCode with the Vala plugin.
Arch Linux (via AUR): yay -S vala-language-server
or yay -S vala-language-server-git
Ubuntu, Fedora, Debian, openSUSE, and Mageia: install from the OBS repo
Fedora (official): sudo dnf install vala-language-server
elementaryOS: sudo apt install vala-language-server
Alpine Linux: apk add vala-language-server
Guix: guix install vala-language-server
Void Linux: xbps-install vala-language-server
Windows (via MSYS2): pacman -S mingw-w64-x86_64-vala-language-server
...and more. See below:
compile_commands.json
#!/usr/bin/env -S vala
shebang)glib-2.0
gobject-2.0
gio-2.0
and either gio-unix-2.0
or gio-windows-2.0
gee-0.8
json-glib-1.0
jsonrpc-glib-1.0 >= 3.28
libvala >= 0.48.12
posix
VAPI, which should come preinstalledIf you're using Guix, to launch a shell with build dependencies satisfied:
guix environment vala-language-server
meson -Dprefix=/usr build
ninja -C build
sudo ninja -C build install
This will install vala-language-server
to /usr/bin
An important note: VLS cannot know what arguments are used for the file you are editing unless it can locate a build script, compile commands list, or shebang to analyze. (This is generally true for most language servers of compiled languages.) Before making an issue, check whether you have a build script or shebang for your file.
:CocConfig
and add a new entrylanguageserver
property like below:{
"languageserver": {
"vala": {
"command": "vala-language-server",
"filetypes": ["vala", "genie"]
}
}
}
.vimrc
:if executable('vala-language-server')
au User lsp_setup call lsp#register_server({
\ 'name': 'vala-language-server',
\ 'cmd': {server_info->[&shell, &shellcmdflag, 'vala-language-server']},
\ 'whitelist': ['vala', 'genie'],
\ })
endif
require'lspconfig'.vala_ls.setup {
-- defaults, no need to specify these
cmd = { "vala-language-server" },
filetypes = { "vala", "genie" },
root_dir = root_pattern("meson.build", ".git"),
single_file_support = true,
}
ninja -C build install
should install the third-party plugin to $PREFIX/lib/gnome-builder/plugins
. Enable Vala
and disable GNOME Vala Language Server
.LSP.sublime-settings
:{
"clients": {
"vala-language-server": {
"command": [
"/usr/bin/vala-language-server"
],
"selector": "source.vala | source.genie",
"enabled": true
}
}
}
Tools > LSP > Enable Language Server Globally... > vala-language-server
If you're using meson, vala-language-server will automatically detect the packages you depend on.
If you just want to write a quick script without a build system, you can add a shebang line to the top of your .vala file:
#!/usr/bin/env -S vala --pkg gtk4
Want to help out? Here are some helpful resources:
#vala
on gimpnet/IRC is for general discussions about Vala and collaboration with upstream