Skip to content

Latest commit

 

History

178 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VLS - V Language Server

Build with: v .

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.

Sublime Text

  1. Build VLS with v . and place the resulting vls binary in your PATH.
  2. In Sublime Text, open Package Control: Install Package from the Command Palette and install both V (for the source.v syntax) and LSP.
  3. Open Preferences > Package Settings > LSP > Server Configurations and add this to Packages/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.

Building the VS Code VLS extension

cd vscode-extension
npm install
npm run build

You should get a vls-{version}.vsix file.

Or download the vsix file from here:

https://github.com/vlang/vls/releases/

In VS Code run Extensions: Install from VSIX...

The extension includes V: Build, V: Run, and V: Test in the Command Palette and in Tasks: Run Task. Runnable CodeLens actions open a task terminal so program and compiler output is always visible. Set vls.vCommand when the V compiler is not available through VS Code's PATH. Test tasks also visualize line coverage: covered executable lines are green and uncovered lines are red. The visualization can be disabled with vls.coverage.enabled.

Features

Instant errors

image

Go to definition

gddemo.mov

Autocomplete for module functions

image

Information about function parameters

image

Autocomplete for struct fields and methods

image

About

V language server

Topics

Resources

Stars

371 stars

Watchers

26 watching

Forks

Releases

Packages

Contributors

Languages