Example configurations for Snyk Language Server

Example configuration for Sublime Text

// Settings in here override those in "LSP/LSP.sublime-settings"
{
  // Show permanent language server status in the status bar.
  "show_view_status": true,

  // Language server configurations
  "clients": {
    "snyk": {
      // enable this configuration
      "enabled": true,
      "command": [
        "/usr/local/bin/snyk", // path to the downloaded CLI binary
        "language-server", // start CLI in language server mode
        "-l", // define log level
        "info", // level info
        "-f", // file logging
        "/path/to/log/dir/snyk-ls-sublime.log" // log file
      ],
      // the selector that selects which type of buffers this language server attaches to
      "selector": "source", // all file types
      "initializationOptions": {
        "activateSnykCode":"true", // Enable Snyk Code
        "token": "xxx" // Set your Snyk Token to not authenticate on every start
      }
    },
  },
}

After opening a supported file, the Language Server should be started by Sublime Text and findings will be highlighted.

Snyk Open Source findings displayed in Sublime Text
Snyk Code findings displayed in Sublime Text

Example configuration for Neovim

If the project root directory cannot be obtained from Git information, this script tries to set the root directory to your home directory by vim.loop.os_homedir(). Depending on the contents of your home directory, this may consume a large amount of memory. If this happens, set an alternative root directory for your environment.

The set up is as follows:

The following is an example init.lua script:

Snyk Code findings displayed in Neovim

Last updated

Was this helpful?