Build with: v .
Check the installed version with vls --version or vls version. Both print VLS 0.0.3
and exit without starting the server. LSP initialize reports the same version in serverInfo.
Place the vls binary in your PATH. For example, on Linux you can place it in /usr/local/bin. On
Windows, you can place it in a directory that is included in your PATH
environment variable.
Otherwise, you can set the path to the vls binary in your editor's settings.
- Build VLS with
v .and place the resultingvlsbinary in yourPATH. - In Sublime Text, open
Package Control: Install Packagefrom the Command Palette and install bothV(for thesource.vsyntax) andLSP. - Open
Preferences > Package Settings > LSP > Server Configurationsand add this toPackages/User/LanguageServers.sublime-settings:
{
"vls": {
"enabled": true,
"command": ["vls"],
"selector": "source.v"
}
}If vls is not in Sublime Text's PATH, replace it with the absolute path to the binary. If the
V compiler is not in that PATH either, use absolute paths and add VLS_V_COMMAND:
{
"vls": {
"enabled": true,
"command": ["/absolute/path/to/vls"],
"selector": "source.v",
"env": {
"VLS_V_COMMAND": "/absolute/path/to/v"
}
}
}Open a folder containing a V project, then open a .v file. The Sublime status bar should show
that VLS has started. Use Tools > Developer > Show Scope Name to confirm that the file's base
scope is source.v if the server does not start.
Install the V extension from the Visual Studio Marketplace. Its source and build instructions are in vlang/vscode-vlang.
Build VLS with v . and make the vls binary available in VS Code's PATH, or set
v.vls.command to its path. Set v.executablePath if the V compiler is not on that PATH.
The extension includes V: Build, V: Run, and V: Test in the Command Palette and in
Tasks: Run Task. Runnable CodeLens actions show their output in a task terminal. Test tasks
also visualize line coverage; set v.vls.coverage.enabled to false to turn that off.
V compiles the code inside $if flag ? { ... } only when the program is built with -d flag.
VLS runs the compiler without defines, so that code is not checked: it gets no errors, and hover
and go-to-definition find little or nothing in it. V adds the options in the VFLAGS environment
variable to every command, so set it where VLS runs to work on such a block. For example, close
the editor and start it again from a shell:
VFLAGS='-d flag' code .In Sublime Text, add "VFLAGS": "-d flag" to the env of its server configuration. The code
inside $if !flag ? { ... } is then the one left unchecked.
gddemo.mov
NOTE: the Zed editor lacks first-party support for the V programming language.
- Build VLS with
v .and place the resultingvlsbinary in yourPATH. - Open
Zed > Open Settings Fileand add this to your settings file:
{
"languages": {
"V": {
"formatter": {
"external": {
"command": "vls",
"arguments": ["-"]
}
}
}
}
}or alternatively if the vls binary is NOT in your PATH:
{
"languages": {
"V": {
"formatter": {
"external": {
"command": "/absolute/path/to/vls",
"arguments": ["-"]
}
}
}
}
}