vala-lang/vala-language-server
Acerca de
Code Intelligence for Vala & Genie
Herramientas de desarrolloWhat you can do
- member access and scope-visible completion
- completions for abstract methods/properties to implement
- goto definition
- symbol references
Crecimiento de estrellas medido
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- Recopilando historial
Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.
README.md
OriginalVala Language Server
This is a language server for the Vala programming language.
Installation
We recommend using VSCode with the Vala plugin.
Arch Linux (via AUR):
yay -S vala-language-serveroryay -S vala-language-server-gitFedora (official):
sudo dnf install vala-language-serverelementaryOS:
sudo apt install vala-language-serverAlpine Linux:
apk add vala-language-serverGuix:
guix install vala-language-serverVoid Linux:
xbps-install vala-language-serverWindows (via MSYS2):
pacman -S mingw-w64-x86_64-vala-language-server
...and more. See below:

Table of Contents
Features
- diagnostics
- code completion
- member access and scope-visible completion
- context-sensitive suggestions
- completions for abstract methods/properties to implement
- symbol outline
- goto definition
- symbol references
- goto implementation
- signature help
- hover
- symbol documentation
- from comments in source code
- from GIR and VAPI files
- search for symbols in workspace
- highlight active symbol in document
- rename
- snippets
- for implementing abstract methods/properties
- code lenses
- code actions / quick fixes
- code formatting
- call hierarchy
- inlay hints
- workspaces
- supported projects
- meson
-
compile_commands.json - Vala script (file beginning with
#!/usr/bin/env -S valashebang) - cmake
- autotools
Dependencies
glib-2.0gobject-2.0gio-2.0and eithergio-unix-2.0orgio-windows-2.0gee-0.8json-glib-1.0jsonrpc-glib-1.0 >= 3.28libvala >= 0.48.12- you also need the
posixVAPI, which should come preinstalled - uncrustify, for formatting (optional)
Install dependencies with Guix
If you're using Guix, to launch a shell with build dependencies satisfied:
guix environment vala-language-server
Building from Source
meson -Dprefix=/usr build
ninja -C build
sudo ninja -C build install
This will install vala-language-server to /usr/bin
Editors
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.
vim and neovim
coc.nvim
- Make sure coc.nvim is installed.
- After successful installation, in Vim run
:CocConfigand add a new entry for VLS to thelanguageserverproperty like below:
{
"languageserver": {
"vala": {
"command": "vala-language-server",
"filetypes": ["vala", "genie"]
}
}
}
vim-lsp
- Make sure vim-lsp is installed
- Add the following to your
.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
nvim-lspconfig
- For Neovim 0.5.0 or higher
- Make sure nvim-lspconfig is installed
- see the recommended config in that project
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,
}
Visual Studio Code
GNOME Builder
- requires GNOME Builder >= 3.35
- Running
ninja -C build installshould install the third-party plugin to$PREFIX/lib/gnome-builder/plugins. EnableValaand disableGNOME Vala Language Server.
Kate
- officially supported in Kate git master
- Warning: Kate will silently fail to find symbols when meson cannot be found in path without notifying the user.
Emacs
- supported with the lsp-mode plugin
Sublime Text
- Install the Vala-TMBundle and LSP packages
- Add this to your
LSP.sublime-settings:
{
"clients": {
"vala-language-server": {
"command": [
"/usr/bin/vala-language-server"
],
"selector": "source.vala | source.genie",
"enabled": true
}
}
}
- Run
Tools > LSP > Enable Language Server Globally... > vala-language-server
Specifying dependencies
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
Contributing
Want to help out? Here are some helpful resources:
- Help is wanted on these issues
#valaon gimpnet/IRC is for general discussions about Vala and collaboration with upstream- Discord server is for general discussions about Vala, discussions about this project, and support
- Gitter room is also for project discussions and support, but is less active: https://gitter.im/vala-language-server/community
- Vala wiki: https://wiki.gnome.org/Projects/Vala/
- libvala documentation: https://gnome.pages.gitlab.gnome.org/vala/docs/index.html
Explorar proyectos relacionados
Cargando…